Stuck on a WebActivity example

Showing 1-8 of 8 messages
Stuck on a WebActivity example David Bruant 11/22/12 3:14 AM
Hi,

I'm working on the WebActivity documentation and would like to have a
pair of activities working together.
Here is the code https://github.com/DavidBruant/MozApps/tree/locally
In each subdirectory, you can find the app that's handling the
"increment" activity and the other that's using the activity.
The basic idea is that the using the "increment" activity increment a
counter internal to the activity handler which just returns the count.
That's a dummy activity just to show how it works. The app handling the
activity increments when called as an activity and displays arguments of
apps delegating to it. I've made the activity declaration in the manifest.

The apps can be installed locally (hence the branch name) using the
FirefoxOS simulator.
I was expecting things to work, but I get a "NO PROVIDER error" although
the other app is installed. Am I doing something wrong or forgetting
something?

Is there somewhere an example of a working pair of apps?

Thanks,

David
Re: Stuck on a WebActivity example JOSE MANUEL CANTERA FONSECA 11/22/12 3:35 AM
Can we have a better example for Web Activities? Something like pick or
view something, for instance a text file? It seems like you are using
activities with a no very clear use case for them.

Thanks, best

El 22/11/12 12:13, "David Bruant" <brua...@gmail.com> escribió:
>_______________________________________________
>dev-webapi mailing list
>dev-w...@lists.mozilla.org
>https://lists.mozilla.org/listinfo/dev-webapi
>



________________________________

Este mensaje se dirige exclusivamente a su destinatario. Puede consultar nuestra política de envío y recepción de correo electrónico en el enlace situado más abajo.
This message is intended exclusively for its addressee. We only send and receive email on the basis of the terms set out at:
http://www.tid.es/ES/PAGINAS/disclaimer.aspx
Re: Stuck on a WebActivity example David Bruant 11/22/12 4:50 AM
Le 22/11/2012 12:34, JOSE MANUEL CANTERA FONSECA a écrit :
> Can we have a better example for Web Activities?
What do you mean by "better"? Where are the existing working ones?

> Something like pick or
> view something, for instance a text file?
I'm trying to build an example where I wouldn't have to use an
additional API. I'm suffering enough with WebActivities in isolation, I
don't feel like trying another API yet. But I will if necessary.
It seems that WebActivities as designed heavily rely on files and
passing files around from an app to another. Is is absolutely necessary
to use files to work with WebActivities (it would explain why my
examples do not work)

> It seems like you are using
> activities with a no very clear use case for them.
Completely, I'm making a use case up, but it doesn't change that I
should be able to build a working example even without a clear use case
in mind. I'm writing documentation, not a fully-fleshed app.

Thanks,

David
Re: Stuck on a WebActivity example JOSE MANUEL CANTERA FONSECA 11/22/12 7:36 AM
El 22/11/12 13:50, "David Bruant" <brua...@gmail.com> escribió:

>Le 22/11/2012 12:34, JOSE MANUEL CANTERA FONSECA a écrit :
>> Can we have a better example for Web Activities?
>What do you mean by "better"? Where are the existing working ones?
>
>> Something like pick or
>> view something, for instance a text file?
>I'm trying to build an example where I wouldn't have to use an
>additional API. I'm suffering enough with WebActivities in isolation, I
>don't feel like trying another API yet. But I will if necessary.
>It seems that WebActivities as designed heavily rely on files and
>passing files around from an app to another. Is is absolutely necessary
>to use files to work with WebActivities (it would explain why my
>examples do not work)

You need to pass a result whatever is it. My suggestion was to provide an
example that could make sense while at the same time is illustrative and
inspirational for devs

>
>> It seems like you are using
>> activities with a no very clear use case for them.
>Completely, I'm making a use case up, but it doesn't change that I
>should be able to build a working example even without a clear use case
>in mind. I'm writing documentation, not a fully-fleshed app.

Yes, but the examples should be coherent and not misleading
Re: Stuck on a WebActivity example David Bruant 11/22/12 7:39 AM
Le 22/11/2012 16:36, JOSE MANUEL CANTERA FONSECA a écrit :
> El 22/11/12 13:50, "David Bruant" <brua...@gmail.com> escribió:
>
>> Le 22/11/2012 12:34, JOSE MANUEL CANTERA FONSECA a écrit :
>>> Can we have a better example for Web Activities?
>> What do you mean by "better"? Where are the existing working ones?
>>
>>> Something like pick or
>>> view something, for instance a text file?
>> I'm trying to build an example where I wouldn't have to use an
>> additional API. I'm suffering enough with WebActivities in isolation, I
>> don't feel like trying another API yet. But I will if necessary.
>> It seems that WebActivities as designed heavily rely on files and
>> passing files around from an app to another. Is is absolutely necessary
>> to use files to work with WebActivities (it would explain why my
>> examples do not work)
> You need to pass a result whatever is it. My suggestion was to provide an
> example that could make sense while at the same time is illustrative and
> inspirational for devs
>
>>> It seems like you are using
>>> activities with a no very clear use case for them.
>> Completely, I'm making a use case up, but it doesn't change that I
>> should be able to build a working example even without a clear use case
>> in mind. I'm writing documentation, not a fully-fleshed app.
> Yes, but the examples should be coherent and not misleading
I am open to suggestions :-)

David
Re: Stuck on a WebActivity example Mounir Lamouri 12/3/12 6:15 AM
On 22/11/12 11:13, David Bruant wrote:
> Hi,
>
> I'm working on the WebActivity documentation and would like to have a
> pair of activities working together.
> Here is the code https://github.com/DavidBruant/MozApps/tree/locally
> In each subdirectory, you can find the app that's handling the
> "increment" activity and the other that's using the activity.
> The basic idea is that the using the "increment" activity increment a
> counter internal to the activity handler which just returns the count.
> That's a dummy activity just to show how it works. The app handling the
> activity increments when called as an activity and displays arguments of
> apps delegating to it. I've made the activity declaration in the manifest.
>
> The apps can be installed locally (hence the branch name) using the
> FirefoxOS simulator.
> I was expecting things to work, but I get a "NO PROVIDER error" although
> the other app is installed. Am I doing something wrong or forgetting
> something?

Llast I checked, you had to listen to 'activity' system message, not the
activity name. I would change "mozSetMessageHandler('increment'," to
"mozSetMessageHandler('activity',".
I wonder if you should register for "activity" system message handling
in the manifest. Unlikely but worth checking.

Did you check recently if that was working?

> Is there somewhere an example of a working pair of apps?

In Gaia.

Cheers,
--
Mounir
Re: Stuck on a WebActivity example Fabrice Desre 12/4/12 8:18 PM
On 12/03/2012 06:15 AM, Mounir Lamouri wrote:

>
> Llast I checked, you had to listen to 'activity' system message, not the
> activity name. I would change "mozSetMessageHandler('increment'," to
> "mozSetMessageHandler('activity',".
> I wonder if you should register for "activity" system message handling
> in the manifest. Unlikely but worth checking.

There's no need to registering for the "activity" system message. We do
that as part as the activity registration itself.

        Fabrice
--
Fabrice Desré
b2g team
Mozilla Corporation
Re: Stuck on a WebActivity example David Bruant 12/6/12 7:02 AM
Le 03/12/2012 15:15, Mounir Lamouri a écrit :
> On 22/11/12 11:13, David Bruant wrote:
>> Hi,
>>
>> I'm working on the WebActivity documentation and would like to have a
>> pair of activities working together.
>> Here is the code https://github.com/DavidBruant/MozApps/tree/locally
>> In each subdirectory, you can find the app that's handling the
>> "increment" activity and the other that's using the activity.
>> The basic idea is that the using the "increment" activity increment a
>> counter internal to the activity handler which just returns the count.
>> That's a dummy activity just to show how it works. The app handling the
>> activity increments when called as an activity and displays arguments of
>> apps delegating to it. I've made the activity declaration in the manifest.
>>
>> The apps can be installed locally (hence the branch name) using the
>> FirefoxOS simulator.
>> I was expecting things to work, but I get a "NO PROVIDER error" although
>> the other app is installed. Am I doing something wrong or forgetting
>> something?
> Llast I checked, you had to listen to 'activity' system message, not the
> activity name. I would change "mozSetMessageHandler('increment'," to
> "mozSetMessageHandler('activity',".
I figured it out a couple of days after posting looking at Gaia :-)

> I wonder if you should register for "activity" system message handling
> in the manifest. Unlikely but worth checking.
>
> Did you check recently if that was working?
For now, I have something sort-of working, so I'll go with that and see
where I can push the thing.

>> Is there somewhere an example of a working pair of apps?
> In Gaia.
I have seen some apps using "built-in" activities, but not a pair
working together.
Do you know a pair of top your head? If not, I'll ask to the Gaia folks
directly.

Thanks :-)

David