Android simulation app

dashboard
#1

Do you have a sample Android app I could use for a device demo posting my phone’s accelerometer data to a device attribute?

0 Likes

#2

You can get access to the accelerometer via a website now, so the easiest approach is probably to host an Experience Page that contains that JavaScript snippet.

I did experiment with a native app a long time ago (periodically reporting GPS). It was tough getting a background task to run continuously. Both Android and iOS try very hard to idle your application and I never got it to run past a day or so.

The Experience Page approach will work as long as the browser is open and the phone’s screen is on.

0 Likes

#3

So I would open the experience page containing that code snippet on my phone?
How would that data end up in a device attribute?

0 Likes

#4

Maybe it’s easier to launch a python script in termux and post data via your API?

0 Likes

#5

If you’re comfortable with Python, then that absolutely works.

For the website, I’d do an Ajax callback to an Experience Endpoint with the data. The Endpoint triggers a workflow which uses a Device State node to record the data.

0 Likes