Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/arrays/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 使用json传递字符串数组_Android_Arrays_Json - Fatal编程技术网

Android 使用json传递字符串数组

Android 使用json传递字符串数组,android,arrays,json,Android,Arrays,Json,目前我正在一个android项目中工作,我需要使用json将数组用户[电子邮件],用户[密码]传递到网页…如果有人能帮我尽快调整此宽度,请…谢谢 我不知道你的意思。但我想你需要这样的东西: JSONObject jsonObj = new JSONObject(); jsonObj.put("email", email); jsonObj.put("password", password); // Create the POST object and add the parameters Htt

目前我正在一个android项目中工作,我需要使用json将数组用户[电子邮件],用户[密码]传递到网页…如果有人能帮我尽快调整此宽度,请…谢谢

我不知道你的意思。但我想你需要这样的东西:

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);`
您可以在这里查看更多文档


详细描述您的问题。。。。
JSONArray jsonArray = new JSONArray(listOfUsers);
String jsonRepresentationForListOfUsers = jsonArray.toString();