# Android simulation app

**URL:** <https://forums.losant.com/t/android-simulation-app/1734>\
**Category:** Help\
**Tags:** dashboard\
**Created:** [April 17, 2019, 4:05pm UTC](https://forums.losant.com/t/android-simulation-app/1734 "2019-04-17T16:05:57Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lars\_Andersson](https://avatars.discourse-cdn.com/v4/letter/l/f05b48/32.png) [@Lars\_Andersson](https://forums.losant.com/u/Lars_Andersson)\
**Post date:** [April 17, 2019, 4:05pm UTC](https://forums.losant.com/t/android-simulation-app/1734/1 "2019-04-17T16:05:57Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Brandon\_Cannaday](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/brandon_cannaday/32/14_2.png) [@Brandon\_Cannaday](https://forums.losant.com/u/Brandon_Cannaday)\
**Post date:** [April 17, 2019, 4:15pm UTC](https://forums.losant.com/t/android-simulation-app/1734/2 "2019-04-17T16:15:31Z")

</div>

You can get access to the accelerometer via a [website now](https://developer.mozilla.org/en-US/docs/Web/API/Accelerometer), 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.

---

<div class="post-metadata">

**Author:** ![Lars\_Andersson](https://avatars.discourse-cdn.com/v4/letter/l/f05b48/32.png) [@Lars\_Andersson](https://forums.losant.com/u/Lars_Andersson)\
**Post date:** [April 17, 2019, 4:30pm UTC](https://forums.losant.com/t/android-simulation-app/1734/3 "2019-04-17T16:30:37Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Lars\_Andersson](https://avatars.discourse-cdn.com/v4/letter/l/f05b48/32.png) [@Lars\_Andersson](https://forums.losant.com/u/Lars_Andersson)\
**Post date:** [April 17, 2019, 4:32pm UTC](https://forums.losant.com/t/android-simulation-app/1734/4 "2019-04-17T16:32:09Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Brandon\_Cannaday](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/brandon_cannaday/32/14_2.png) [@Brandon\_Cannaday](https://forums.losant.com/u/Brandon_Cannaday)\
**Post date:** [April 17, 2019, 4:41pm UTC](https://forums.losant.com/t/android-simulation-app/1734/5 "2019-04-17T16:41:47Z")

</div>

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.
