@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
//사용자 전화번호추출
TelephonyManager mTelephonyMgr = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);
myNumber = mTelephonyMgr.getLine1Number();
//서버전달 함수실행
Connurls();
}
public void Connurls(){
// 접속 URL
String url = "asp페이지url";
// 서버에 전달할 파라메터 세팅
ArrayList<BasicNameValuePair> nameValuePairs = new ArrayList<BasicNameValuePair>();
nameValuePairs.add(new BasicNameValuePair("num", myNumber));
try {
HttpClient http = new DefaultHttpClient();
HttpPost httpPost = new HttpPost(url);
UrlEncodedFormEntity entityRequest = new UrlEncodedFormEntity(nameValuePairs, "UTF-8");
httpPost.setEntity(entityRequest);
http.execute(httpPost);
} catch (Exception e) {
}
}
이클립스내의 avd 로는 테스트가 잘되거든요
그런데 실폰으로 테스트 해보면 안되네용 ㅠ
테스트실폰이 갤3 4.1.2 입니당
avd 는 2.3.3 으로 했거든요 소스도 2.3.3으로 코딩한거구요