android

How to check internet connection in android programmatically

Answer 1.  Whenever we need connectivity in an app, it is a good practice to check that we have it available before requesting any operation and wait for a timeout or similar error. For this you have to use ConnectivityManager and NetworkInfo , I always use the following snippet: 1. private boolean isNetworkConnected(Context context) { …

How to check internet connection in android programmatically Read More »

How to enable usb debugging on android with black screen

Figure out how to take a screenshot on your phone without using the UI. On the Galaxy Series, you can use the hardware buttons to do this. Unlock your phone’s lock screen and connect it to your computer. Open your phone in a file manager. Find the place where the phone stores screenshots. Take a screenshot …

How to enable usb debugging on android with black screen Read More »