Does the location access have any dependency on activity recognition process? In some devices i could get my activity recognition sample working only after turning on my location setting
-
Add some more information to your question. It's hard to help you. – ᗩИᎠЯƎᗩ Oct 02 '13 at 11:08
-
@andrea what i want to know is whether the Activity recognition API is internally making use of the user location – pablogeorge Oct 03 '13 at 05:50
2 Answers
This issue is fixed in latest update of Google Play services(4.3.23 (1069729-030)). All we need to do is replace library project "google-play-services_lib" with latest version(4.3.23 (1069729-030)). I noticed a delay of about 1 minute in AR updates if we toggle location settings, but it works.

- 372
- 3
- 9
The Activity Recognition is part of the Google Play Location API. See the docs here:
You can see that this is part of the Location Services offered by Play. Internally there needs to be some way to determine the speed of movement of the device - and that requires location based calculations.
Below is an extract from the Class Overview paragraph of the ActivityRecognitionClient
documentation:
It only makes use of low power sensors in order to keep the power usage to a minimum.
This suggests (as the OP pointed out) that the API relies on network location, and not GPS location.
So it would make sense from a security aspect.
If I, as a user, decide I don't want to let any apps see or use my location, then I would expect the Play API to obey that decision.
Anything else, and the security is lost.

- 29,432
- 22
- 140
- 255
-
So basically it means that Activity recognition API internally makes use of the user location ?. – pablogeorge Oct 03 '13 at 05:29
-
updated based on the Activity Recognition docs that link this to Location Services. – Richard Le Mesurier Oct 03 '13 at 08:26
-
Pardon me if am wrong.But what does this statement in the docs mean?Activity recognition does not require the permissions ACCESS_COARSE_LOCATION or ACCESS_FINE_LOCATION. – pablogeorge Oct 04 '13 at 10:42
-
1My understanding is that if your app needs Activity Recognition, it does not need location permissions. But if you disable location permissions in your OS entirely (switching off the GPS for example), there is no way for the Play API to calculate any Activity info. If I tell the system I don't want to tell google my location, I do not expect google to be able to access my location. hth – Richard Le Mesurier Oct 04 '13 at 11:03
-
My doubt is that, is it depend on GPS(Satellite based) or network provider ? I tried by turning on GPS alone and switching off the AGPs (network provider), app is not working. So can I conclude that Activity recognition is based on Network provider alone ? – pablogeorge Oct 04 '13 at 11:48
-
1I found info in `ActivityRecognitionClient` online docs that back you up. Edited answer. – Richard Le Mesurier Oct 04 '13 at 12:56
-
Your app never gets given any location data, so it does not need those permissions. But the API does need location data, so it needs you to turn your location settings on. It is the difference between your APP getting location data, and the Play API getting location data. I hope that makes sense? – Richard Le Mesurier Oct 05 '13 at 14:12