Search code examples
htmlmobilegeolocation

Web-based position tracking app for mobile devices


I'm looking at different possibilities to create a mobile app that augments an existing web application. The sole purpose of the mobile app would be to send the current position of the user to the web application.

My preferred approach would be to create a HTML5 mobile app that uses the Geolocation API to periodically determine the users position and send it to the web application. Now I see two potential problems:

  1. The user locks the screen and puts the phone in a pocket. What happens to JS timers running in the app? Do they continue to execute, so that I'll be able to still send position updates?

  2. What happens in areas where there is no network coverage? The right thing to do would be to accumulate position logs until the user is back in an area with network coverage, and then send all the pending position logs at once.

The essence of the questions above is:

Is a HTML5 mobile app the right solution for this kind of app, or am I required to create native apps?


Solution

  • Apparently the answer is

    No, a HTML5 app is not the right solution to this problem.

    The primary reason is that background apps are killed off, see this answer.