Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android - It takes long to get a GPS-Signal. How to implement a good GPS provider?

i wrote an app, that tracks the gps location while jogging. Unfortunately the app needs some time to get a gps signal. When i open other apps like google maps, they are getting immediately the position.

My Problem is: How to implement the gps-provider, so that the app gets as fast as possible a signal.

One idea was, to start a service with the app, so that the provider does some preliminary work. But the tracking-activity is not the main-activity. How can i bind the service in an activity, that does not have started the service? Is this a good idea?

Thanks for reading - and i hope my english is understandable,

Martini

like image 443
sdev Avatar asked Aug 18 '12 09:08

sdev


1 Answers

As I mentioned in my comments, GPS start up is not an instant process. The receiver basically has to know the position of each of the GPS satellites in the constellation in order to calculate it's location. The ephemeris data describes the positions of the satellites to the received and is downloaded from the satellites when the GPS is turned on (and I almost forgot to mention the almanac data, which is also part of the download and describes the orbits of the satellites). Things like downloading from multiple satellites and using the last known position can help speed up this initial process, but you cannot make it "instant".

There are other strategies that can be used to help speed up the location process, especially in cell phones. In addition to the last-known position, things like Cell Tower + Timing positioning (ECID) or Wi-Fi positioning can be used in place of GPS while the GPS is still in the acquisition process.

This link describes some ideas on how to handle locating a mobile phone in android, but the short of it is:

  • check last known position (discard if it is too old)
  • check E-CID position (this is extremely fast, but is a very coarse location)
  • check Wi-Fi position (this can be extremely accurate, but requires WiFi to be on and can sometimes have a large amount of error)
  • finally obtain GPS position
like image 164
psubsee2003 Avatar answered Sep 24 '22 01:09

psubsee2003