You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(Trying to summarize our latest discussion here --- feel free to add your thoughts!)
When you scan a QR code or tap a link in the browser, Android decides which app to supply the URI to depending on the scheme of the URI. For example, an https link will likely open in a new browser tab, market might open the Play store app, mailto the email client, etc.
We can define a custom URI scheme (see RFC3986 §3.1) for Sensibility Testbed, and then use this as a way to input data to running experiments. Then, a user of the app could scan a QR code conforming to our scheme, and the fact that this code has been scanned, together with the contents it encodes, are provided to a running experiment. (You can also add signatures etc. to the content so not everyone can spam your experiment).
The Android Part
You make the app aware of the custom scheme by adding an appropriate intent for the desired android:scheme to the app manifest, see the Android docs and a worked example (or so it seems). Note that this doesn't involve SL4A.
The Repy Part
On the Repy side of things, we need to figure out a couple of things.
Demultiplexing running experiments
We could ensure that only the correct experiment receives the data. On the other hand, maybe we just broadcast to all experiments that have the "scheme sensor" allowed by their IRB, and then they have to figure it out.
Notification method
How will an experiment learn that a custom scheme was sensed? This can go different ways, such as:
Look for a newly-created file containing the data
Listen on a server socket on localhost
Block on the sensor call
Poll using a specific scheme sensor call
Register a callback function that will be called with the data
Find data in a global variable
....
What the blur?
Since it's a sensor (in our definition of the word), there could be blurring and readout/update frequency limits.
The text was updated successfully, but these errors were encountered:
I read a bit about reading QR code. Most of the methods use a library called zxing, see this example. You can add two java classes into your project (first class, second class). I feel these two classes are just wrappers that you can use to fire an intent and get results. These two classes must use a barcode scanner app to do the actual scan. However, I also found a zxing class that uses camera to scan the QR code.
Hope this doesn't make things too complicated. The example code does show how to retrieve scanned result. So if our QR code can embed location coordinates at different places, these data can be returned to Android code. The rest is how to pass the data to repy code.
zxing seems to access the camera etc. as well. Is this what we want? (I don't think so. I'd say we rely on the user to use the (stock) barcode reader installed on their device, and not bring ours that would need to be launched separately, i.e. from within our app).
I started working on this today. But it still needs "some" fine tuning. I guess we'll have to wait until after the conference, to release this feature. For details see aaaaalbert@c256dfb
(Trying to summarize our latest discussion here --- feel free to add your thoughts!)
When you scan a QR code or tap a link in the browser, Android decides which app to supply the URI to depending on the scheme of the URI. For example, an
https
link will likely open in a new browser tab,market
might open the Play store app,mailto
the email client, etc.We can define a custom URI scheme (see RFC3986 §3.1) for Sensibility Testbed, and then use this as a way to input data to running experiments. Then, a user of the app could scan a QR code conforming to our scheme, and the fact that this code has been scanned, together with the contents it encodes, are provided to a running experiment. (You can also add signatures etc. to the content so not everyone can spam your experiment).
The Android Part
You make the app aware of the custom scheme by adding an appropriate intent for the desired
android:scheme
to the app manifest, see the Android docs and a worked example (or so it seems). Note that this doesn't involve SL4A.The Repy Part
On the Repy side of things, we need to figure out a couple of things.
Demultiplexing running experiments
We could ensure that only the correct experiment receives the data. On the other hand, maybe we just broadcast to all experiments that have the "scheme sensor" allowed by their IRB, and then they have to figure it out.
Notification method
How will an experiment learn that a custom scheme was sensed? This can go different ways, such as:
What the blur?
Since it's a sensor (in our definition of the word), there could be blurring and readout/update frequency limits.
The text was updated successfully, but these errors were encountered: