Wednesday, March 20, 2019

geolocation - How can I find out what app is using my GPS from the background?




Possible Duplicate:
How to check which app uses GPS on Galaxy Nexus?




I saw the location icon at the top while on the home screen of my Galaxy Nexus. There were only two running apps and I cleared both of them, but the location icon was still there. I've discovered that if I turn location off then on again, it will go away, but I'd like to find out which of my apps is using this so I can consider uninstalling it or changing a setting.


Is there a way to do this? I presume maybe an app that detects this or some system thing?



Answer



First off, by "clear", what exactly do you mean? Many manufacturers' UI overlays provide ways to remove running apps from quick-access lists, like the one you get with a long press on the home key, but doing that usually doesn't actually close the app. Android, by default, keeps apps running in "background" mode after you back out of them, because they're faster to switch to if they're already in RAM than if you start them "cold".


So, unless you're "force-closing" apps using the Settings view or a "task killer" app, any app you had been running but "cleared out" is still running in "background mode". Most apps do very little in background mode, to economize on CPU and thus battery use, but some will maintain things like GPS access. Any social app that allows you to "check in" somewhere, like Facebook, Foursquare, "footprint" apps, etc is likely to do this, so that you can quickly mark your current location without waiting for the GPS to reacquire satellites and get your location.


If you are force-closing or task-killing apps you think are using GPS, and you're still seeing the GPS icon, it could be one of two things; first, the force-close action is not a "clean" way to shut down applications, and many will not expect to be force-closed, so if you force-close an app that was using GPS it may not clean up things like its connections to phone features such as GPS.


Second, there are some services built into Android, like the E911 service, that use GPS if it's available and that cannot be shut down. So, if you start up GPS for something else, one of those services may ask the OS to keep the acquired signals from the GPS satellites so they can maintain your location just in case you have to call 911, until you manually turn off GPS altogether (at which time the services fall back to less granular location methods, like triangulating from nearby cell towers or known Wi-Fi hotspots).


EDIT: To answer the actual question asked (novel concept, I know), I can't find any apps that will show GPS usage that are available on Google Play and do not require a rooted phone (and/or custom ROM i.e. CyanogenMod etc). The one I did find, Spare Parts Plus PRO, is purported to do so in a roundabout way, by showing battery usage of installed apps with permission to use GPS, but other than one user testimonial here (over a year old) I can't find any evidence it actually does this anymore (the free version does not and none of the documentation specifically says it will), and I'm not gonna spend money to find out just to give you an answer here. Sorry. If you want to try, it's only $1.75; do let the rest of us know.


The only thing I can suggest is to look for an app manager that will list running programs based on the permissions they require. There are several that list apps by permission; aSpotCat, PermissionDog, App Permission Watcher, etc. however I'm not sure which of them will also allow filtering by current running status (PermissionDog pops up a notice when an app starts, showing what it can do).



If you find one, the usage is simple; if it's running, and it needs the GPS, it's a suspect to be the app actually using GPS right now.


Lastly, from a technical standpoint, it's the Android OS actually "using" the phone's GPS. Most apps, especially ones that don't require rooting, cannot directly control any feature of your phone; they instead ask the Android OS to get or set information regarding those features, using the "service managers" that Android exposes in its API. An app that needs your location will simply ask the Android LocationManager service for your current location, optionally requesting "coarse" or "fine" granularity, and Android will then use whatever location services you have told it that it can use (GPS, cell towers, Wi-Fi hotspot location) to find out, returning the location and the method used (or telling the app that the requested level of granularity couldn't be used because you turned it off). Android does not, AFAIK, keep tabs on which apps have made recent requests through the API for its location services (much less which of those requests required the service to spend significant resources to find out); it only knows which apps have permission to do so, and as long as at least one of them is running and has made a request, Android keeps GPS active.


The upshot is that pretty much the best you can do is cross-check running apps with apps that can use GPS, to find out which apps may be using GPS right now. If there's only one running that has the required permission, it's pretty easy to narrow it down. If there are a dozen apps or services with that permission currently "running" (RAM-resident), it's a bit harder (especially because, as I said, some of these may be basic services of the phone that can cause it to crash if you try to force close them).


No comments:

Post a Comment

samsung galaxy s 2 - Cannot restore Kies backup after firmware upgrade

I backed up my Samsung Galaxy S2 on Kies before updating to Ice Cream Sandwich. After the upgrade I tried to restore, but the restore fails ...