I have created an app that uses a web-service (from www.worldweatheronline.com) to acquire certain information but it seems that it doesn't have access to the internet and I get "Unfortunately, Browser has stopped". I say this because when trying to use the emulator's browser it doesn't respond at all and I have tried to use Additional Emulator Command Line Options: -dns-server 8.8.8.8,8.8.4.4
I have also added internet permissions to the manifest:
<uses-permission android:name="android.permission.INTERNET" />
Any suggestions?
Thanks
You need to set proxy setting in your emulator,probably proxy is blocking your internet connection. Try this
To check internet connection. Try this sample code-
boolean b_IsConnect = isNetworkAvailable();
private boolean isNetworkAvailable() {
ConnectivityManager connectivityManager = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo activeNetworkInfo = connectivityManager
.getActiveNetworkInfo();
return activeNetworkInfo != null;
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.