일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 | 31 |
- soundpool
- Mail Server
- 안드로이드 gcm
- javascript
- 폼메일
- not working
- xe
- 자바스크립트
- roundcube
- FCM
- 우분투
- android 효과음
- chart.js
- php 시큐어코딩
- UML
- html5
- php 취약점
- WebView
- dovecot
- C#
- 설치
- C# IO
- 안드로이드 푸시
- 자동 생성
- curl
- mysql
- PHP
- 안드로이드
- 안드로이드 푸쉬
- Android
- Today
- Total
그러냐
안드로이드 service에서 포스트로 데이터 주고 받기 httppost 통신 본문
public void postData() {
try {
httppost = new HttpPost(URL+"/lginsert.php?req=lgins&hpnum="+PhoneNumber+"&bcname="+bcname);
response = httpclient.execute(httppost);
bufreader = new BufferedReader(
new InputStreamReader(response.getEntity().getContent(),
"utf-8"));
line = null;
result = "";
while ((line = bufreader.readLine()) != null) {
result += line;
}
Log.d("22", result);
} catch (Exception e) {
// TODO Auto-generated catch block
}
}
//// 스레드로 접근 ////
new Thread(new Runnable() {
public void run() {
int i = 0;
while (true) {
if(httpflag){
postData();
httpflag = false;
try {
Thread.sleep(2000);
} catch (InterruptedException ie) {
ie.printStackTrace();
}
}
try {
Thread.sleep(100);
} catch (InterruptedException ie) {
ie.printStackTrace();
}
}
}
}).start();
'android' 카테고리의 다른 글
Broadcast Receiver에 대해서 (펌) (0) | 2016.01.28 |
---|---|
부팅시 서비스(Service) 실행하기 (0) | 2016.01.28 |
안드로이드 service에서 alert dialog 띄우기 (0) | 2016.01.28 |
안드로이드 블루투스 신호강도 측정하기 (0) | 2016.01.28 |
sendEmptyMessageDelayed 핸들러 재귀호출 (0) | 2016.01.28 |