i have written a simple gps code , which is turning on and turning off the gps programmatically in some device(say moto g) but some older version or Samsung duos and some o
First of all it depends if you catch the geolocation by Google Play Services or if you do it the "old" way. I would not suggest to do something behind the user. A common way is to check if the GPS is on and at best direct the user to the system settings by using a PreferenceScreen. Also inform the user with a DialogPreference or a toast. Otherwise if you want to do it the dirty way, you can find an answer on Stackoverflow