文章分类 -  网络

HTTP通信
摘要:new Thread(new Runnable() { public void run() { try { HttpURLConnection urlConnection= null; URL url = new URL("http://192.168.1.35"); urlConnection=(HttpURLConnection)url.openConnection(); urlConnection.setRequestMethod("GET"); urlConnection.setDoOutput(true); urlConnection.setD 阅读全文

posted @ 2011-04-14 11:17 Tiger_Dog 阅读(508) 评论(0) 推荐(0)

判断Android手机是否联网
摘要:android 中查看当前是否联网方法如下:ConnectivityManager cManager=(ConnectivityManager)getSystemService(Context.CONNECTIVITY_SERVICE);NetworkInfo info = cwjManager.getActiveNetworkInfo(); if (info != null && info.isAvailable()){ //do something //能联网 return true; }else{ //do something //不能联网 return false; } 阅读全文

posted @ 2011-04-14 10:43 Tiger_Dog 阅读(621) 评论(0) 推荐(0)

导航