sense android app (android 2.3.5) update speed

24 views
Skip to first unread message

Michael Trouw

unread,
Oct 17, 2013, 3:24:25 PM10/17/13
to commonsense...@googlegroups.com
We (me and 2 other students) are using the Common Sense platform and android app for a prototype application.
We measure some sensor values on an android phone with the common sense android app.
The prototype app is an android app running on the same phone (android 2.3.5), built using PhoneGap.

We *should* be making a native app, so that we can measure everything directly on the phone, instead of measuring it,
sending data to common sense, retrieving data from common sense to use in the app.

However, using the common sense android app saves a lot of time (and we have no Android native development experience)

My question is: How long does it take before measuring a sensor value, uploading it to common sense and having that sensor
value available for GET REST requests? right now, it takes a SUPER long time for us to get a sensor value using HTTP GET requests.

for instance, we use the display_activity sensor value, but if we turn on the screen, only between 60 - 120 seconds a change happens
if we look at the sensor data that we get back from common sense.

Even with our approach this seems a VERY long time...

We perform GET requests each 5 seconds, so we expect a sensor change in two or three GET requests instead of 12 - 24 GET requests :(

I hope my question is clear, unfortunately i don't happen to have console.log outputs at the moment, will update as soon i have a good example.

Also, the unread_msg sensor seems to be working very erratically, some times this reflects my android screen activity correctly, sometimes not at all!
What could be the reason of this?


Pim Nijdam

unread,
Oct 17, 2013, 5:31:22 PM10/17/13
to commonsense...@googlegroups.com
Hi Michael,

I understand that you've two applications running on your phone. The common sense platform app, and your own phonegap app that you use to get data from the CommonSense servers.

The most likely reason for the delay that you're experiencing is that the data simply isn't uploaded to common sense yet. In the common sense app you can set the sample frequency and the upload frequency (called "CommonSense sync rate), these are two separate preferences. So you could be sampling every second, but only upload the data every 5 minutes. If you set the upload frequency to real-time there shouldn't be much more than a few seconds delay when you get the data through the REST Api. Be aware thought that uploading more frequently will also drain the battery faster, especially on 3g.

You mention that you should be making a native app, but that you prefer using phonegap as that saves a lot of time. We've experienced the same and have made a phonegap plugin that allows you to directly use the sense android library from within phonegap. See the tutorial. The demo project includes an example to get the sensor data directly from the sense android library.

Regarding the unread_msg senser, that is one of android's sensors. But I've never seen it produce any useful data, I wouldn't know what to use it for... I do think the screen activity sensor works correcly though.

Succes with prototyping. And if you ever need an audience, we'd love to hear, or even better see, what you've come up with.

Pim



2013/10/17 Michael Trouw <mag...@gmail.com>

--
You received this message because you are subscribed to the Google Groups "CommonSense Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to commonsense-devel...@googlegroups.com.
To post to this group, send email to commonsense...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply all
Reply to author
Forward
0 new messages