获取的Json信息? (菜鸟) [英] Get Json Information? (Noob)

查看:145
本文介绍了获取的Json信息? (菜鸟)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是新来的都使用JSON和Android的开发,但我期待学习如何使用JSON API密钥来检索信息。

让我们说这个网站有我需要的所有信息。我怎样才能访问和存储这些信息?

  https://website.com/api/user/key/a015b92aec875bd24e8fdc73477bfdcr

例如,将有这样的事情,

  {平衡:123,原因:3426}


解决方案

要访问它,你需要打开HTTPS连接到具有API密钥,也就是刚才您提供的HTTPS解决服务器。服务器将返回JSON对象为你解析字符串数据,你可以使用 GSON 的。 GSON将翻译所有的JSON对象为Java对象,而且它会帮助你填充您的pre-内置Java数据结构与数据

I'm new to both using json and developing for android, however I'm looking to learn how to retrieve information using a json api key.

Let's say this website has all the information I need. How can I access and store that information?

https://website.com/api/user/key/a015b92aec875bd24e8fdc73477bfdcr

For example it would have something like this,

{"balance":"123","due":"3426"}

解决方案

To access it, you need to open HTTPS connection to the server that has that API key, which is that https address you just provided. The server will return the JSON objects for you, to parse the string data, you can use GSON. GSON will translate all the JSON objects into Java objects, and it will help you populate your pre-built Java data structures with those data

这篇关于获取的Json信息? (菜鸟)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆