안드로이드 개발 질문/답변
(글 수 45,052)
public InputStream connect(String _url) {
_client = new DefaultHttpClient();
httppost = new HttpPost();
HttpGet httpget = new HttpGet();
URI uri =null;
URL url;
try {
url = new URL(_url);
uri = url.toURI();
} catch (MalformedURLException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
} catch (URISyntaxException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
httpget.setURI(uri);
//httppost.setURI(uri);
try {
response = _client.execute(httpget);
resEntity = response.getEntity();
in = resEntity.getContent();
} catch (ClientProtocolException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return in;
}
public ArrayList<String> resgisterChildUser(String _childID, String _childPW, String _childName) {
// TODO Auto-generated method stub
//wnchung 은 부모 아이디.
String url = sURL + "registerChildUser.jsp?pid=" + "wnchung" + "&id=" + _childID + "&pwd=" + _childPW + "&name=" + _childName;
InputStreamReader input = new InputStreamReader(connect(url));
BufferedReader reader = new BufferedReader(input);
StringBuffer output = new StringBuffer();
for(;;) {
String temp = null;
try {
temp = reader.readLine();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
if(temp == null) break;
output.append(temp);
}
return Tokenizer(output.toString(), "|");
}
html 파싱하는부분인데 위와같이 resgisterChildUser 에서 connect 함수를 호출하는데요 ..
에뮬에서는 잘 파싱해오는데 핸드폰(넥서스원)으로하면 자꾸 죽습니다 .. 왜그런거죠 ..
로그 올리겠습니다 ..
_client = new DefaultHttpClient();
httppost = new HttpPost();
HttpGet httpget = new HttpGet();
URI uri =null;
URL url;
try {
url = new URL(_url);
uri = url.toURI();
} catch (MalformedURLException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
} catch (URISyntaxException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
httpget.setURI(uri);
//httppost.setURI(uri);
try {
response = _client.execute(httpget);
resEntity = response.getEntity();
in = resEntity.getContent();
} catch (ClientProtocolException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return in;
}
public ArrayList<String> resgisterChildUser(String _childID, String _childPW, String _childName) {
// TODO Auto-generated method stub
//wnchung 은 부모 아이디.
String url = sURL + "registerChildUser.jsp?pid=" + "wnchung" + "&id=" + _childID + "&pwd=" + _childPW + "&name=" + _childName;
InputStreamReader input = new InputStreamReader(connect(url));
BufferedReader reader = new BufferedReader(input);
StringBuffer output = new StringBuffer();
for(;;) {
String temp = null;
try {
temp = reader.readLine();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
if(temp == null) break;
output.append(temp);
}
return Tokenizer(output.toString(), "|");
}
html 파싱하는부분인데 위와같이 resgisterChildUser 에서 connect 함수를 호출하는데요 ..
에뮬에서는 잘 파싱해오는데 핸드폰(넥서스원)으로하면 자꾸 죽습니다 .. 왜그런거죠 ..
로그 올리겠습니다 ..



