0

I am trying to make an app showing info from an API. I have searched everywhere but I didn't find an answer that solve my problem! Here is an example from the JSON file:

{
"status": 200,
"data": {
    "date": "2018-10-12T00:00:00.000Z",
    "featured": [
        {
            "id": "5bbdc3abdf819b65ea6b733b",
            "name": "Name",
            "price": "1",
            "priceIcon": "priceicon",
            "priceIconLink": "price.png",
            "images": {
                "icon": "icon.png",
                "png": false,
                "gallery": false,
                "featured": false
            },
            "rarity": "rarity",
            "type": "type",
            "readableType": "Type"
        }
    ]
  }
}

How can I fetch the name, price, icon, rarity and readableType?

Please don't mark it as duplicate because I haven't found the answer that I am searching for.

Ramesh R
  • 7,009
  • 4
  • 25
  • 38
  • Possible duplicate of [Reading a json file in Android](https://stackoverflow.com/questions/13814503/reading-a-json-file-in-android) – Joaquín Oct 12 '18 at 16:10
  • Possible duplicate of [Android Java; How can I parse a local JSON file from assets folder into a ListView](https://stackoverflow.com/questions/19945411/android-java-how-can-i-parse-a-local-json-file-from-assets-folder-into-a-listvi) – Marco Lavagnino Oct 12 '18 at 16:12
  • I suggest you to look at Gson library https://github.com/google/gson. Read this article: https://medium.com/@ankit.sinhal/parsing-json-with-gson-library-184d94a04dec – shadowsheep Oct 12 '18 at 16:18

1 Answers1

2

Check this tutorial, no one is going to code it for you, also your question has been made 10000 times Tutorial

Joaquín
  • 1,116
  • 1
  • 10
  • 26