简体   繁体   English

我如何解析给定的 json 格式?

[英]How do i parse the given json format?

{ installedApplications { id: 16 aid: 4539749 appName: "A31-RT1" description: "A31-RT1" applicationLogoUrl: "/applications/16/applicationlogo" applicationCompanyOrBusinessLogoUrl: "/applications/16/companyorbusinesslogo" appProviderName: "" appProviderPersoEndpointUrl: "" appProviderDeleteEndpointUrl: "" androidAppPackageName: "N" isUnpublished: false isInstallationAllowed: true isApprovedForSharedSlot: false lastUpdatedDate: -1 contactEmail: "pallavi.shanmukhaiah@nxp.com" linkToTermsAndConditions: "" linkToApplicationWebsite: "" applicationSize: 288 businessSegment: "Infrastructure" supportedCardLogoUris: "/applications/3/supportedcards/53/cardlogo" 21: 0 }
i tried many times but i am not able to excess the id and aid ?我尝试了很多次,但我无法超过 id 和帮助?
please help me to write an code to parse this json format.请帮我写一个代码来解析这个json格式。

JSONObject obj = new JSONObject();

You have the obj with you so go ahead like:你有 obj ,所以继续:

int id = (int) obj.getJSONObject("installedApplications").get("id");
int aid = (int) obj.getJSONObject("installedApplications").get("aid");

I hope this helps.我希望这有帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM