How can i check for exception while initializing my android app in statement "App42.initialize(API key, Secret key).

0 votes
How can i check for exception while initializing my android app in statement "App42.initialize(API key, Secret key)., suppose the gprs/wifi is not working at this moment, in this case how can i handle the exception and notify the user?
asked Jan 28, 2015 in App42 Cloud API-BaaS by Hitesh Jain (16 points)

1 Answer

+1 vote

Hello Hitesh,

 

Every platform has own native sample to check the internet reachability that internet is connected or not. Please find the code snippet below to check the internet connectivity in Android:

ConnectivityManager cm = (ConnectivityManager)context.getSystemService(Context.CONNECTIVITY_SERVICE);

NetworkInfo activeNetwork = cm.getActiveNetworkInfo();

boolean isConnected = activeNetwork != null &&

activeNetwork.isConnectedOrConnecting();

For more details, please have a look at this this tutorial & let us know if it helps.

Himanshu Sharma

 

answered Jan 29, 2015 by hs00105 (2,005 points)
Thanks a lot :)
It worked, i had no idea about this earlier, thanks :)
Download Widgets
Welcome to ShepHertz Product line forum, where you can ask questions and receive answers from the community. You can also reach out to us on support@shephertz.com
...