In my app i want to provide the user with the option to choose wi-fi / GPRS for network connectivity to the web server. May be answers to the following ques solve my prob ..
You can provide option to user on screen using following code block....
public static ShowAvailable()
{
ConnectivityManager connectivityMgr = (ConnectivityManager)
getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo[] nwInfos = connectivityMgr.getAllNetworkInfo();
for (NetworkInfo nwInfo : nwInfos)
{
Log.d(TAG, "Network Type Name: " +
nwInfo.getTypeName()); Log.d(TAG, "Network available: " +
nwInfo.isAvailable()); Log.d(TAG, "Network c_or-c: " +
nwInfo.isConnectedOrConnecting()); Log.d(TAG, "Network connected: "
+ nwInfo.isConnected());
}
}