펌 OK (출처 표시), 상업적 이용 NO, 컨텐츠 변경 NO

퍼미션은 INTERNET



public void DataSend() {

try{

url = new URI("http://192.168.0.20:8080/testWebapp/Receive.jsp");

new Thread() {

public void run() {

try {

HttpClient httpclient = new DefaultHttpClient();

HttpPost httpPost = new HttpPost(url);

ArrayList<BasicNameValuePair> nameValuePairs = new ArrayList<BasicNameValuePair>();

nameValuePairs.add(new BasicNameValuePair("mark_id", sendMarkId));

nameValuePairs.add(new BasicNameValuePair("store_name", sendName));

nameValuePairs.add(new BasicNameValuePair("latitude", sendLat));

nameValuePairs.add(new BasicNameValuePair("longitude", sendLng));

nameValuePairs.add(new BasicNameValuePair("comments", sendTip));

nameValuePairs.add(new BasicNameValuePair("kind", sendKind));

httpPost.setEntity(new UrlEncodedFormEntity(nameValuePairs, "utf-8"));

httpclient.execute(httpPost);

} catch (Exception e) {

e.printStackTrace();

}

}

}.start();

}catch(Exception e){

Log.e("fureun",e.toString());

}

}

댓글을 달아 주세요

  1.  댓글주소  수정/삭제  댓글쓰기 1 2016.01.11 12:28

    잘보고가요 ㅎㅎ덕분에 됐네요
    근데 Http 관련클래스들중 몇개는 직접 gradle에서 외부라이브러리를 선언해줘야 사용이가능하네요ㅎㅎ
    android{
    useLibrary 'org.apache.http.legacy'
    }이런식으루요