I need to check for internet connection and location. And if some of these is disabled or is not working show the alert dialog which says that you can't use the app without internet/location. I want it to be checked in the background. I don't want to check for internet in each part of code where I need internet. As I understand I should use Broadcast Receiver but I don't know how. I saw some code in the internet, but it's quite old and I think there are some better ways nowadays. If you know some better way, please tell me. Thank you in advance.
Asked
Active
Viewed 70 times
0
-
https://stackoverflow.com/questions/4238921/detect-whether-there-is-an-internet-connection-available-on-android?rq=1 – Pdksock May 20 '15 at 08:03
-
http://stackoverflow.com/questions/10311834/how-to-check-if-location-services-are-enabled – Arsalan Mehmood May 20 '15 at 08:24