草庐IT

jsonArray1

全部标签

json - org.openx.data.jsonserde.json.JSONObject 无法转换为 org.openx.data.jsonserde.json.JSONArray

我正在尝试从配置单元读取json文件。我正在使用JsonSerdeapi加载json却报错...16moreCausedby:java.lang.ClassCastException:org.openx.data.jsonserde.json.JSONObjectcannotbecasttoorg.openx.data.jsonserde.json.JSONArrayatorg.openx.data.jsonserde.objectinspector.JsonListObjectInspector.getList(JsonListObjectInspector.java:38)ator

我如何从jsonarray获得php阵列的2D数组?

这是我获得2D阵列的活动Response.ListenerresponseListener=newResponse.Listener(){@OverridepublicvoidonResponse(Stringresponse){try{JSONObjectjsonResponse=newJSONObject(response);//whattodohere}catch(JSONExceptione){e.printStackTrace();AlertDialog.Builderbuilder=newAlertDialog.Builder(MainActivity.this);builder.

java - 如何通过JSONArray获取API的数据

//MyAPIlink//http://gdata.youtube.com/feeds/base/videos?max-results=10&start-//index=1&alt=json&orderby=published&author=astrobixweb//StringMethodtofetechdatafromserverpublicstaticStringsendRequest(Stringurl){Stringresult="";try{HttpClientclient=newDefaultHttpClient();HttpParamshttpParameters=cl

Android Volley POST JsonObject 并获取 JsonArray 或 JsonObject 或其他响应

在volley中,我们有一些能力从服务器检索数据,例如jsonObject、jsonArray和String。在下面的示例中,我们可以简单地从服务器获取jsonObject或jsonArray响应,publicstaticvoidPOST(HashMapparams,finalListeners.ServerResponseListenerlistener){JsonObjectRequestreq1=newJsonObjectRequest(ApplicationController.URL,newJSONObject(params),newResponse.Listener(){@

Android JsonArray 和 JsonObject 反序列化

我知道JSONArray和JSONObject的区别。我对反序列化它们有疑问。在反序列化对象类型为Cluster的数组时,我可以使用fromJson对象来完成。相反,在反序列化Topic类型的对象时,我不得不使用JSONParser。有什么区别?我不知道什么时候使用JSONParser。仅供引用Cluster类:packagecom.example.android_json;publicclassCluster{publicStringtitle;publicStringstories;publicStringsrc;publicCluster(){}publicCluster(Str

android JSONArray 长度

我有一个来自json提要的数组,我知道在jArray中有一个联盟,但我需要计算出该数组的计数,以防稍后将第二个添加到提要中。目前logcat没有注销“teamFeedStructure”有没有人知道我做错了什么或者知道如何正确地将数组的长度转换为我可以在Intent中使用的字符串?代码如下JSONObjectobj=newJSONObject(json);JSONObjectobjData=obj.getJSONObject("data");JSONArrayjArray=objData.getJSONArray("structure");//Stringleagues=jArray.

php - 将 JSONArray 从 Android 传递到 PHP

我已经阅读了许多关于PHP和JSONArray循环的其他问题。我从我的Android设备发送一个JSONArray,其中包含不同学生的值以及他们的类(class)和studentId。使用这些值,我在数据库中搜索它们的名称并返回一个JSONArray。JSONInput:[{"studentId":"2","class":"2a","dbname":"testDb"}]安卓HttpClientclient=newDefaultHttpClient();HttpResponseresponse;try{HttpPostpost=newHttpPost("http://abc/getNam

Android 使用 Gson 解析嵌套的 JsonArray

我有一个嵌套的JSONArray。我是gson的新手。我已经尝试过很多教程,但这些都没有帮助。编辑:[{"DivisionID":"2c0e9dc1-a6a7","DivisionName":"Qwerty","SubDivision":[{"SubDivisionID":"70c3ac53-eec6","SubDivisionName":"QW123","Vehicle":[{"Nopol":"00571564","LastUpdate":"Oct10201010:10AM","LastSpeed":0,"LastLon":106.82176,"Location":"KNOWHERE

java - 如何将 JSONArray 转换为 ListView?

我有一个代码执行以下操作-通过HttpClient连接到Web服务到PHP文件返回SQL查询的结果返回格式是一个jArray(一个JSONArray)for(inti=0;i当我查看LogCat时,我看到查询的所有“名称”,每条记录都被打印出来。我只需要将这些结果插入到ListView中。我怎样才能做到这一点?PS-我没有单独的ArrayAdapter类。会不会是这个原因? 最佳答案 如果您只想显示一个textView列表,则无需覆盖任何内容,只需将所有项目添加到arrayList中并使用arrayAdapter。在您的xml中放置

jsonarray请求没有回应

我正在尝试从Android到自定义ListView获取数据,但我无法获取!请帮忙我的JSON:_{"College":[{"Name":"NITK","Logo":"http:\/\/192.168.43.164\\Webapp\\Collegelogos\\nitk.jpg"},{"Name":"IITR","Logo":"http:\/\/192.168.43.164\\Webapp\\Collegelogos\\iitr.jpg"},{"Name":"NITT","Logo":"http:\/\/192.168.43.164\\Webapp\\Collegelogos\\nitt.jpg