Search code examples
androidgpslocationmanagerandroid-locationlocationlistener

How to find signal strength of the GPS provider and Network provider for location capturing and how to determine which is having strong strength


I am developing an android application.

The configuration details are minimum sdk version="7"

These are the operations which I am performing in my application:

Capturing the location details (gps location details) when user enter into my application Sometimes GPS provider has high signal strength,sometimes network provider has high signal strength.

I want to check which have high signal strength.After finding high signal strength I need to capture the location details via that provider.

For instance if GPS provider has high signal strength than Network provider means then I If network provider has high signal strength than GPS provider means then I start the location listener with network provider argument.
I want to find signal strength.If gps provider has high signal strength then i go with gps provider only.If network provider signal strength is high means then i go with network provider only.

How to find signal strength of the GPS provider and Network provider for location capturing and how to determine which is having strong signal strength. All are welcome to give your ideas.


Solution

  • This does not make much sense. It would not help you to evaluate signal strength. A GPS location is either valid or not, and has addionally an estimated acuracy (horicontal). (Not only the signal string is import, also the angle between the visisble satellites (expresses as gps attribute hdop). Use location.getAccuaracy() to get the estimated erroor in meters.

    Gps has an accuracy of 2-6m on average. Cell-tower Network locationing is often not more acurate than 1000m. Wlan network may be much better than cell tower, but works only near known wlans.

    You decide whether your app need accuracy 2-6 or 1000m. In the first case use GPS_PROVIDER.

    So probably you should use location.getAccuracy() to optimize your app.