Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Stuck on a WebActivity example

21 views
Skip to first unread message

David Bruant

unread,
Nov 22, 2012, 6:13:52 AM11/22/12
to dev-w...@lists.mozilla.org
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

JOSE MANUEL CANTERA FONSECA

unread,
Nov 22, 2012, 6:34:32 AM11/22/12
to David Bruant, dev-w...@lists.mozilla.org
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

David Bruant

unread,
Nov 22, 2012, 7:50:26 AM11/22/12
to JOSE MANUEL CANTERA FONSECA, dev-w...@lists.mozilla.org
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

JOSE MANUEL CANTERA FONSECA

unread,
Nov 22, 2012, 10:36:27 AM11/22/12
to David Bruant, dev-w...@lists.mozilla.org
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

David Bruant

unread,
Nov 22, 2012, 10:39:28 AM11/22/12
to JOSE MANUEL CANTERA FONSECA, dev-w...@lists.mozilla.org
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

Mounir Lamouri

unread,
Dec 3, 2012, 9:15:26 AM12/3/12
to dev-w...@lists.mozilla.org
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

Fabrice Desre

unread,
Dec 4, 2012, 11:18:49 PM12/4/12
to Mounir Lamouri, dev-w...@lists.mozilla.org
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

David Bruant

unread,
Dec 6, 2012, 10:02:45 AM12/6/12
to Mounir Lamouri, dev-w...@lists.mozilla.org
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
0 new messages