2012-01-06 3 views
-1
JSONObject jsonObj = new JSONObject(); 
jsonObj.put("email", email); 
jsonObj.put("password", password); 
// Create the POST object and add the parameters 
HttpPost httpPost = new HttpPost("http://api.readfa.st/session"); 
StringEntity entity = new StringEntity(jsonObj.toString(), HTTP.UTF_8); 
entity.setContentType("application/json"); 
httpPost.setEntity(entity); 
HttpClient client = new DefaultHttpClient(); 
HttpResponse response = client.execute(httpPost);` 

현재 저는 json을 사용하여 웹 페이지에 배열 사용자 [email], 사용자 [password]를 전달해야하는 Android 프로젝트에서 작업 중입니다. 이걸 최대한 넓힐 수 있습니다. 고마워요!json을 사용하여 문자열 배열을 전달합니다

+1

자세히 알아보기 ... – Richa

답변

0

나는 당신이 무슨 뜻인지 모르겠다. 하지만 다음과 같은 내용이 필요합니다.

JSONArray jsonArray = new JSONArray(listOfUsers); 
String jsonRepresentationForListOfUsers = jsonArray.toString(); 

자세한 내용은 여기를 참조하십시오.

http://developer.android.com/reference/org/json/JSONArray.html

관련 문제