public Boolean isNetAvailable(Context con) {
try{
ConnectivityManager connectivityManager = (ConnectivityManager)
con.getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo wifiInfo = connectivityManager.getNetworkInfo(ConnectivityManager.TYPE_WIFI);con.getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo mobileInfo =
connectivityManager.getNetworkInfo(ConnectivityManager.TYPE_MOBILE);
if (wifiInfo.isConnected() || mobileInfo.isConnected()) {
return true;
}
}
catch(Exception e){
e.printStackTrace();
}
return false;
}
and also add these permissions in manifest.xml
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
Hi Rajareaddy ,
ReplyDeleteYou have posted answer on my stackoverflow profile (http://stackoverflow.com/questions/10024535/how-to-post-json-string-from-android#comment12820534_10024535) , and i have tried it but still not able to get json responce from server. Please help me
post your email id, i will send you full code and then let me know where i have made mistake.
Plz reply ASAP.
you can check it now, i made it clear.
Deleterajareddy511@gmail.com
DeletePlz send your email id
ReplyDeleteplz check your mail, i am really thankfull to you
ReplyDeleteHey , I am working on an android xmpp client , I almost finish facebook and gmail , i saw your post in stackoverflow about other service providers such as yahoo and windows live . what did u find ?
ReplyDelete