On 4 Jul 2014, at 6:28 pm, Athanasios Anastasiou <[email protected]> 
wrote:

> Hello Fabrice
> 
> Thank you for your response. I am sorry for the delay in mine but I did not 
> receive a reminder that the post was approved and posted in this list.
> 
> Please see below:
> 
>>> Android uses intents and it is possible to launch a specific QR-Reader or 
>>> let the user select from the installed apps that can handle this sort of 
>>> activity.
>>> I was happy to spot the Firefox OS - Web Activities API, but they are 
>>> 'ring-fenced' :( and the allowed ones do not include QR-code reading.
>> 
>> 
>> What do you mean by 'ring-fenced'? Any app can implement its own
>> 
>> activities, and expose them to any other app. We don't whitelist anything.
> From this: https://developer.mozilla.org/en-US/docs/Web/API/Web_Activities
> There are certain firefox OS and firefox for android activities that are 
> readily available by the system and there is no hint that any of them could 
> be starting a QR reader. (Please also see below).

That list is just a list of the web activity handlers provided by the system. 
There is no system provided QR reader, but you could implement an app to do 
this. See here for how to register an activity handler: 
https://developer.mozilla.org/en-US/docs/Web/API/Web_Activities#Register_an_activity

For example, you could add this to your manifest:

"activities": {

    // The name of the activity to handle (here "pick")
    “qrcode": {
      "href": “./QRCodeReader.html",
      "disposition": "inline",
      "returnValue": true
    }
  }


> 
>>> Is there a way to query installed applications for the ones that can handle 
>>> QR reading? There are quite a few of them on the marketplace but none 
>>> actively advertises its ability as an activity handler. (Is there one that 
>>> does?)
>> 
>> No. The whole point of activities is to not have such a strong coupling.
> 
> In Android, I can do something like: 
> 
>    Intent intent = new Intent("com.google.zxing.client.android.SCAN");
> Then populate the intent with parameters, start it and wait for the result.
> Doing so, I am using functionality that is exposed by another application.
> 
> In FirefoxOS, I cannot use "com.google.zxing.client.android.SCAN". Therefore, 
> I am asking how can i probe FirefoxOS for those installed applications that 
> expose their QR Reading functionality so that I can start it from within my 
> Firefox OS application with a Web Intent. I hope the question is more clear 
> now.

See the corresponding section for how to start a web activity in the same 
document: 
https://developer.mozilla.org/en-US/docs/Web/API/Web_Activities#Starting_an_activity

To start the above activity from another app, you would do: var activity = new 
MozActivity({name:’qrcode’});

Then the user would be prompted to choose which app they want to use to handle 
this activity (from a list of apps which handle this activity). If there is 
only one suitable handler, this is chosen by default without user interaction. 
No suitable handlers, and you get an error.

> 
>>> Finally, since firefoxOS apps can be installed as stand-alone(ish) on 
>>> Android, can i use an Android intent's URI to launch an Android Intent and 
>>> retrieve its result within my code from firefox OS?
>> 
>> 
>> 
>> I don't think our intent <-> activities support on android allows that
>> 
>> yet, but I may be wrong.
> 
> It would be great to see this kind of interaction between FirefoxOS and 
> Android.

Not sure about this question sorry.

Hope that helps!

> 
> 
> Looking forward to hearing from you
> AA
> _______________________________________________
> dev-webapps mailing list
> [email protected]
> https://lists.mozilla.org/listinfo/dev-webapps

_______________________________________________
dev-webapps mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-webapps

Reply via email to