Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android gps provider and gps icon

Today when i was trying my code, a few doubtful thing appeared in my mind about gps provider, gps hardware, gps icon and fine location permission.

I observed my code and gps icon on Samsung galaxy s3, Htc one m8. And gps is disabled

mLocationManager = (LocationManager) mContext.getSystemService(Context.LOCATION_SERVICE);
mLocationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 1000 * 10, 0, this, Looper.myLooper());
...
@Override
public void onLocationChanged(Location location) {
    mListenerRef.get().onLocationChanged(location);
}

Galaxy s3 - Gps icon didn't appear, it didn't fire onLocationChanged method. (Thats okay)

Htc one m8 - Gps icon appeared, blinking, and fired onLocationChanged (But how ?)

At this moment questions pops up

  • Does ACCESS_FINE_LOCATION permission give the app override gps status on some devices?
  • So, could the app receive location even gps disabled ?

And then i enabled gps on galaxy s3

(First 2 minutes) Gps icon appeared(but not blinking), fired onLocationChanged method (But how ?)

(After 2 minutes) Gps icon appeared(blinking), fired onLocationChanged method

Again questions pops up

  • What does gps icon blinking mean ? any extracanonical meaning ?
  • Does the blinking mean gps hardware trying first fix ?
  • Or blinking means the provider firing onLocationChanged method ?
like image 788
blackkara Avatar asked Dec 15 '15 17:12

blackkara


1 Answers

What does gps icon blinking mean?

-> Well I hope u r aware that GPS provider dosen't work under roof. So it is completely impossible to get Location update from GPS provider under roof. In such situation if user enables the GPS then the GPS blinking icon appears notifying to user that it is searching for GPS.

-> Once it finds the GPS the icon dosen't blink anymore and u'll get location updates from GPS provider.

-> A still GPS icon means Android system is ready to send location updates from GPS provider.


Htc one m8 - Gps icon appeared, blinking, and fired onLocationChanged (But how ?)

-> It sounds weird getting location updates without enabling it. I'm not sure how u confirmd that u got the Location update.

-> I'll recommend u to check if GPS provider is enabled and then request for location update.

like image 85
kevz Avatar answered Oct 03 '22 01:10

kevz