These forums are currently read-only due to receiving more spam than actual discussion. Sorry.

It is currently Sat Dec 02, 2017 4:11 pm Advanced search

Geolocation - no access when screen turned off

Here you can discuss things related to HTML and the Web in general that do not fit in to other categories.

Geolocation - no access when screen turned off

Postby Lightning » Sun Dec 05, 2010 1:43 pm

Hey everyone. I have experimented with creating an application using the Geolocation API. The application gets your location through your GPS and continously updates how far you have moved.

It works great on my Android (2.2, WebKit 3.1), but I have one problem which limits the usability of the application. My problem is that after 1 minute, the screen turns off automatically to lock the phone and save battery. When this happens, I no longer receive updates from the geolocation.watchPosition method. Also, the geolocation.getCurrentPosition doesn't work. The same happens if the user locks the phone manually.

The Javascript Timeout is still running - but it cannot access the hardware. Is there any way to prevent the shutdown of the GPS in standby mode?

Anyway, you can take a look at my test application to see an example of how to use the Geolocation API:
http://simon.sandvei.com/stuff/html5-location/

About the application:
http://simon.sandvei.com/2010/12/04/geo ... -tracking/
Lightning
<h6>
 
Posts: 1
Joined: Sun Dec 05, 2010 11:34 am
Location: http://simon.sandvei.com

Postby Alan » Mon Jan 03, 2011 5:59 am

You should probably ask these questions in an Android forum as I don't see any way to do this from inside a browser.

Your safest bet would be reacting gracefully when the device leaves standby (i.e. if GPS suddenly becomes unavailable, just pause further processing until it is available).
Alan
<h5>
 
Posts: 18
Joined: Sun Oct 31, 2010 2:16 pm
Location: Cologne, Germany


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 2 guests