Android-向服务器发送信息

【Android-向服务器发送信息】花门楼前见秋草,岂能贫贱相看老。这篇文章主要讲述Android-向服务器发送信息相关的知识,希望能为你提供帮助。


public boolean sendPhoneInfo(String path){
URL url = null;
try {
url = new URL(path);
HttpURLConnection conn = (HttpURLConnection)url.openConnection();
conn.setConnectTimeout(5000);
conn.setRequestMethod("GET");
if(conn.getResponseCode() == 200){
return true;
}
} catch (Exception e) {
e.printStackTrace();
}

return false;
}

new Thread(){
@Override
public void run(){
App.isSuccess = sendPhoneInfo(path);
Log.d("czDebug",path);
}
}.start();


    推荐阅读