관리 메뉴

moozi

jsp json 활용 샘플 본문

안드로이드개발강좌

jsp json 활용 샘플

moozi 2015. 6. 3. 16:21

 

 

-  JSON파싱연습

jsonParsing.zip

 

 

- jsp페이지를 요청하여 넘어오는 JSON데이터 파싱

Json1.zip

 

 

- jsp페이지에 post방식으로 패러미터값 전달

Json2.zip

 

 

- jsp페이지 샘플

member1.zip

 

 

- jsp페이지에 post 방식으로 패러미터 전달 후 결과받기

 

HttpResponse response = httpclient.execute(httppost);

 

// 실행하고 결과 response로 받아오기
HttpEntity entityResponse = response.getEntity();

 

// 엔티티 얻어오기
is = entityResponse.getContent(); // is 는 InputStream is; 로 멤버변수로 미리 선언된 것으로 가정.

 

// 응답된 데이터를 읽을수있는 입력스트림 넘어옴
BufferedReader reader = new BufferedReader(new InputStreamReader(is, "UTF-8"), 8);

// 인코딩 처리 버퍼드리더 얻어옴
StringBuilder sb = new StringBuilder();
String line = null;

while ((line = reader.readLine()) != null) {
 sb.append(line).append("\n");  
}
is.close();


 

 

'안드로이드개발강좌' 카테고리의 다른 글

웹뷰예제  (0) 2015.10.12
ActionBar예제  (0) 2015.10.01
jsp post 처리  (0) 2015.05.12
안드로이드 스튜디오에서 JSON 테스트  (0) 2015.04.30
BlurMaskFilter가 적용되지 않을 때  (0) 2015.04.24
Comments