1. Android Emulator is somewhat Unpredictable.
I have experience few hiccup :
- The code below to check the internet connectivity won't work with emulator.
private boolean checkConnection(){
boolean connected = false;
ConnectivityManager cm =
(ConnectivityManager)getSystemService(Context.CONNECTIVITY_SERVICE);
if (cm != null) {
NetworkInfo[] netInfo = cm.getAllNetworkInfo();
for (NetworkInfo ni : netInfo) {
if ((ni.getTypeName().equalsIgnoreCase("WIFI")
|| ni.getTypeName().equalsIgnoreCase("MOBILE"))
& ni.isConnected() & ni.isAvailable()) {
connected = true;
}
}
}
return connected;
}
Somehow the above code is useless to me, as sometime the connection to the wireless router in present but no internet connectivity, at that time it give the wrong result.
Well i create my own code, where on the starting of the App, my code will check for the WAN or Data Packet connectivity, then will check the internet connectivity by sending a request to TimeServer at port 37 to fetch the time in binary form...on this i decide the result.
- Camera
, thats another probs with it, i need to use a physical device for it.
- Sometimes it gives weird errors, then i clean the project and Shutdown my Eclipse, Emulator and then Start them again..