user7090887 user7090887 - 1 year ago 76
Android Question

How to check in realtime if Location services switched off by user in a tracking app

I am developing a tracking app using fused location api. I want to check pragmatically if user has turned off location services while app is running. I am thinking of running a parallel thread to check if GPS has been turned off by user in every 5 sec using method LocationManager.isProviderEnabled(). Is this the right approach or there is a better way to do it.


Answer Source

Use broadcast receiver, when GPS settings will be changes, you will get automatically notify.

here is the link:

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download