안드로이드 개발을 처음 해보는데 어렵네요 ;ㅁ;
웹에서 파싱 강좌를 보면서 따라해보고 있는데 당최 안되요..
아래 코드에서 url을 네이버로 설정하고,
잘 불러왔으면 텍스트를 "이거는!?"로 바꾸고,
아니면 "이거나오믄안되유"로 바꾸는데,
웹 강좌대로 해도 무조건 안되유만 나오네요.
어찌해야하나요 ;ㅁ;....
public class third_page extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.third_layout);
Button btn = (Button)findViewById(R.id.testBtn);
btn.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
HttpClient httpclient = new DefaultHttpClient();
HttpGet httpget = new HttpGet("http://naver.com");
HttpResponse response;
TextView txt = (TextView)findViewById(R.id.textViewTest);
try {
response = httpclient.execute(httpget);
HttpEntity entity = response.getEntity();
if (entity != null) {
txt.setText("이거는!?");
}
} catch (Exception e) {
txt.setText("이거나오믄안되유");
}
}
});
}
}




1. Manifest 파일에 internet사용을 위한 퍼미션은 추가 하셨나요?
2. 혹시 에뮬레이터를 사용중이시라면 가상장비 추가하실때 GSM modem support 추가 하셨나요?
3. 위 조건을 다 만족 하셨다면 catch에서 잡아내는 Exception이 어떤 Exception인가요?