{"id":85018,"date":"2021-09-24T09:00:22","date_gmt":"2021-09-24T03:30:22","guid":{"rendered":"https:\/\/techvidvan.com\/tutorials\/?p=85018"},"modified":"2024-08-15T20:51:57","modified_gmt":"2024-08-15T15:21:57","slug":"json-parsing-in-android","status":"publish","type":"post","link":"https:\/\/techvidvan.com\/tutorials\/json-parsing-in-android\/","title":{"rendered":"JSON Parsing In Android"},"content":{"rendered":"<p>In this article, we will proceed with JSON Parsing in Android. You must be wondering how data flows between your application and the server. So, several ways are using which data flows. The most popular among them are XML(Extensible Markup Language) and JSON(JavaScript Object Notation).<\/p>\n<p>JSON being lightweight and structured, is better than XML and is mainly used these days. Therefore, it becomes essential to understand the steps we need to follow to parse JSON data and get the desired information.<\/p>\n<h3>What is JSON?<\/h3>\n<p>JSON (JavaScript Object notation) is a <strong>lightweight, straightforward,<\/strong> and <strong>structured<\/strong> format to <strong>interchange data<\/strong> between the application and the server. JSON is useful in transferring data (textual information) from server to application or vice versa. Parsing the JSON data helps us in segregating required information from the JSON data.<\/p>\n<h3>Structure of JSON:<\/h3>\n<p>JSON has a structured format that makes developers easily understand and parse it. It can start with any of the following brackets:<\/p>\n<ul>\n<li><strong>[ ] &#8211;<\/strong> The square brackets are useful to define a JSON Array.<\/li>\n<li><strong>{ } &#8211;<\/strong> The curly brackets are useful to denote a JSON Object.<\/li>\n<\/ul>\n<p>JSON can have the following structures:<\/p>\n<p><strong>1. JSON Object &#8211;<\/strong> As discussed before, JSON object starts and ends with curly brackets. JSON Objects consist of several key-value pairs, JSON Arrays, and even other JSON Objects.<br \/>\nBelow is an example of a JSON Object.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">{\r\n  \"Name\": \"TechVidvan\",\r\n  \"Author\": \u201cMohit Kumar\u201d,\r\n  \"Languages\": [\u201cC++\u201d, \u201cJava\u201d, \u201cKotlin\u201d, \u201cDart\u201d, \u201cPython\u201d, \u201cGO\u201d, \u201cJavaScript\u201d]\r\n  \u201cFrameworks\u201d: \r\n   {\r\n        \u201cPython\u201d: [\u201cDjango\u201d, \u201cFlask\u201d],\r\n        \u201cJavaScript\u201d: [\u201cReact\u201d, \u201cIonic\u201d, \u201cAngular\u201d]\r\n   }\r\n}\r\n\r\n<\/pre>\n<p><strong>2. JSON Array &#8211;<\/strong> JSON Array starts and ends with square brackets consisting of a list of several values. These values can be of any type String, Integer, Float, or Boolean. Sometimes these values can also be JSON objects.<\/p>\n<p>Below is an example showing a list of coding platforms in the form of a JSON Array.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">[\u201cCodeChef\u201d,  \u201cCodeForces\u201d,  \u201cAtCoder\u201d,  \u201cTopCoder\u201d, \u201cHackerRank\u201d]\r\n<\/pre>\n<h3>Features of JSON<\/h3>\n<p>JSON provides several features which make it most widely used among developers. Some of the features of JSON are as follows:<\/p>\n<ul>\n<li>It is text-based and easy to understand<\/li>\n<li>It is language-independent, and no matter which language you use, you can use JSON to exchange data between your application and server<\/li>\n<li>JSON is lightweight and structured<\/li>\n<li>It is scalable<\/li>\n<li>It allows you to interchange data between application and server<\/li>\n<li>JSON can carry many types of data<\/li>\n<\/ul>\n<h3>JSON DataTypes<\/h3>\n<p>JSON currently allows six types of data which are as follows:<\/p>\n<p><strong>1. String<\/strong> &#8211; Using JSON, you can easily exchange String constants. Strings are a sequence of characters that is usually enclosed within double quotes(\u201c \u201d). Strings in JSON are useful for representing text values such as names, descriptions, and other textual data, and they support a wide range of characters, including escape sequences for special characters.<\/p>\n<p><strong>2. Numbers<\/strong> &#8211; Using JSON, you can exchange numbers(both integers and floating points).<\/p>\n<p><span style=\"font-weight: 400;\">Numbers in JSON can represent various types of quantitative data, such as ages, prices, or measurements, and they do not require quotes, making them straightforward to parse and use in calculations.<\/span><\/p>\n<p><strong>3. Boolean<\/strong> &#8211; Using JSON, you can exchange Boolean data also, which includes either True or False. Boolean values are essential for representing logical conditions or flags, such as whether a user is active or if a feature is enabled, and are crucial for decision-making in programming.<\/p>\n<p><strong>4. Null<\/strong> &#8211; Boolean values are essential for representing logical conditions or flags, such as whether a user is active or if a feature is enabled, and are crucial for decision-making in programming.<\/p>\n<p><strong>5. Object<\/strong> &#8211; JSON can include nested JSON objects, which are collections of key-value pairs enclosed in curly braces ({}). Objects allow you to structure complex data hierarchies and organize related information together, making it easier to represent and access complex data structures.<\/p>\n<p><strong>6. Array<\/strong> &#8211; JSON supports arrays, which are ordered lists of values enclosed in square brackets ([]). Arrays can contain multiple items of various data types, including strings, numbers, objects, or other arrays, allowing you to represent collections of data in a structured and sequential manner.<\/p>\n<p>Now, the question arises okay, we can handle strings, numbers, booleans, and other textual data, but what happens to the graphical data? How can we handle graphical data using JSON?<\/p>\n<p>Now the answer is quite simple, and if your graphical asset is stored in the server, you can provide the URL as a string in the JSON and exchange data. Suppose you have an image and don\u2019t have its URL, then you can convert it to Base64 format and then send it as a string.<\/p>\n<h3>Why JSON over XML in Android?<\/h3>\n<p>JSON and XML, as we know, are methods to exchange data, but these days JSON has the upper hand compared to XML. Let\u2019s see the points which make JSON more feasible and a better choice than XML.<\/p>\n<ul>\n<li>JSON is much easier to understand and has a high performance<\/li>\n<li>JSON allows us to use arrays<\/li>\n<li>JSON structures are easy to read, write and parse<\/li>\n<li>JSON is language independent and doesn\u2019t involve tags<\/li>\n<li>Fetching information using JSON is easy and quick compared to XML<\/li>\n<li>JSON is lightweight than XML<\/li>\n<li>JSON comes up with many open source libraries which help serialization and deserialization easy<\/li>\n<li>JSON supports several Ajax and backend tools<\/li>\n<\/ul>\n<h3>Examples of XML and JSON<\/h3>\n<h4>Below is an example of XML:<\/h4>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">&lt;?xml version=\"1.0\" encoding=\"UTF-8\" ?&gt;\r\n&lt;root&gt;\r\n  &lt;students&gt;\r\n    &lt;name&gt;Mohit&lt;\/name&gt;\r\n    &lt;college&gt;SRM University AP&lt;\/college&gt;\r\n  &lt;\/students&gt;\r\n  &lt;students&gt;\r\n    &lt;name&gt;Rahul&lt;\/name&gt;\r\n    &lt;college&gt;IIT Bombay&lt;\/college&gt;\r\n  &lt;\/students&gt;\r\n  &lt;students&gt;\r\n    &lt;name&gt;Sahithi&lt;\/name&gt;\r\n    &lt;college&gt;PES University&lt;\/college&gt;\r\n  &lt;\/students&gt;\r\n&lt;\/root&gt;\r\n<\/pre>\n<h4>Below is an example of JSON:<\/h4>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">{\r\n  \"students\": [\r\n    {\r\n      \"name\": \"Mohit\",\r\n      \"college\": \"SRM University AP\"\r\n    },\r\n    {\r\n      \"name\": \"Rahul\",\r\n      \"college\": \"IIT Bombay\"\r\n    },\r\n    {\r\n      \"name\": \"Sahithi\",\r\n      \"college\": \"PES University\"\r\n    }\r\n  ]\r\n}\r\n<\/pre>\n<h3>JSON Parsing Functions in Android<\/h3>\n<p>Several functions help us to parse and take out the required information from the JSON data provided.<\/p>\n<table>\n<tbody>\n<tr>\n<td><b>Method Name<\/b><\/td>\n<td><b>Description<\/b><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">getString(name: String)<\/span><\/td>\n<td><span style=\"font-weight: 400;\">The getString() method returns the string value corresponding to the key name provided in the parameter.\u00a0<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">getInt(name: String)<\/span><\/td>\n<td><span style=\"font-weight: 400;\">The getInt() method returns the integer value corresponding to the key name provided in the parameter.\u00a0<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">getBoolean(name: String)<\/span><\/td>\n<td><span style=\"font-weight: 400;\">The getBoolean() method returns the boolean value corresponding to the key name provided in the parameter.\u00a0<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">getDouble(name: String)<\/span><\/td>\n<td><span style=\"font-weight: 400;\">The getDouble() method returns the double value corresponding to the key name provided in the parameter.\u00a0<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">getJSONArray(name: String)<\/span><\/td>\n<td><span style=\"font-weight: 400;\">The getJSONArray() method returns the JSON Array corresponding to the key name provided in the parameter.\u00a0<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">getJSONObject(name: String)<\/span><\/td>\n<td><span style=\"font-weight: 400;\">The getJSONObject() method returns the JSON Object corresponding to the key name provided in the parameter.\u00a0<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">optString(name: String?)<\/span><\/td>\n<td><span style=\"font-weight: 400;\">The optString() method returns the string value corresponding to the key name provided in the parameter. If no value is present or if the key fails to match, then it returns null.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">get(index: Int)<\/span><\/td>\n<td><span style=\"font-weight: 400;\">The get() method takes an index as a parameter and returns the object present at that index in the JSON Array.\u00a0<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">length()<\/span><\/td>\n<td><span style=\"font-weight: 400;\">The length() method displays the number of key\/value pairs present in a JSON object. It also returns the number of elements present in a JSON Array.\u00a0<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>Implementation of JSON Parsing in Android<\/h3>\n<p>JSON Parsing is quite simple and easy to understand. Below are the steps which will help you in creating an android application involving JSON Parsing. Here we will try to parse the student\u2019s JSON data and display it in a RecyclerView.<\/p>\n<p>Following is the JSON data which we will parse:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">{\r\n   \"students\": [\r\n      {\r\n         \"name\": \"Mohit\"\r\n      },\r\n      {\r\n         \"name\": \"Rahul\"\r\n      },\r\n      {\r\n         \"name\": \"Sahithi\"\r\n      },\r\n      {\r\n         \"name\": \"Pramey\"\r\n      },\r\n      {\r\n         \"name\": \"Nitesh\"\r\n      },\r\n      {\r\n         \"name\": \"Gowtham\"\r\n      }\r\n   ]\r\n}\r\n<\/pre>\n<p>Step 1: Start your Android Studio and click on Create New Project. Name it as TechVidvanJSON.<\/p>\n<p>Step 2: Now open your activity_main.xml file and paste the below code there.<\/p>\n<p><strong>Code: activity_main.xml<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt;\r\n&lt;LinearLayout xmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"\r\n    android:layout_width=\"match_parent\"\r\n    android:layout_height=\"match_parent\"\r\n    android:orientation=\"vertical\"&gt;\r\n\r\n    &lt;TextView\r\n        android:id=\"@+id\/title\"\r\n        android:layout_width=\"match_parent\"\r\n        android:layout_height=\"wrap_content\"\r\n        android:padding=\"20dp\"\r\n        android:gravity=\"center\"\r\n        android:text=\"Tech Vidvan\"\r\n        android:textColor=\"#FF9800\"\r\n        android:textSize=\"40sp\"\r\n        android:textStyle=\"bold\" \/&gt;\r\n\r\n    &lt;ListView\r\n        android:id=\"@+id\/studentsList\"\r\n        android:padding=\"10dp\"\r\n        android:layout_margin=\"10dp\"\r\n        android:layout_width=\"match_parent\"\r\n        android:layout_height=\"wrap_content\"\r\n        \/&gt;\r\n&lt;\/LinearLayout&gt;\r\n<\/pre>\n<p>Step 3: Lastly, come back to your MainActivity.kt file and paste the below code there.<\/p>\n<p><strong>Code: MainActivity.kt<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">package com.techvidvan.techvidvanjson\r\n\r\nimport androidx.appcompat.app.AppCompatActivity\r\nimport android.os.Bundle\r\nimport android.util.Log\r\nimport android.widget.*\r\nimport org.json.JSONException\r\nimport org.json.JSONObject\r\n\r\nclass MainActivity : AppCompatActivity()\r\n{\r\n    lateinit var arrayAdapter: ArrayAdapter&lt;*&gt;\r\n    override fun onCreate(savedInstanceState: Bundle?) {\r\n        super.onCreate(savedInstanceState)\r\n        setContentView(R.layout.activity_main)\r\n\r\n        \/\/binding the ListView with the variable\r\n        val listview: ListView = findViewById(R.id.studentsList)\r\n\r\n        \/\/fetching the JSON data in form of string\r\n        val json_stu: String = getRawJSON()\r\n        try {\r\n            var name_list = ArrayList&lt;String&gt;()\r\n\r\n            \/\/converting the raw json to JSON Object\r\n            val jsObj = JSONObject(json_stu)\r\n\r\n            \/\/fetching the students JSON Array\r\n            val jsArray = jsObj.getJSONArray(\"students\")\r\n            for (i in 0 until jsArray.length()) {\r\n                val obj = jsArray.getJSONObject(i)\r\n\r\n                \/\/adding names of the students in the name_list\r\n                name_list.add(obj.getString(\"name\"))\r\n            }\r\n\r\n            \/\/creating the array adapter object\r\n            arrayAdapter = ArrayAdapter(this,\r\n                android.R.layout.simple_list_item_1, name_list)\r\n\r\n            \/\/providing the array adapter to the list view\r\n            listview.adapter = arrayAdapter\r\n        } catch (ex: JSONException) {\r\n            Log.e(\"JsonParser \", \"Exception\", ex)\r\n        }\r\n    }\r\n\r\n\r\n    private fun getRawJSON(): String {\r\n        return \"{\\n\" +\r\n                \"   \\\"students\\\": [\\n\" +\r\n                \"      {\\n\" +\r\n                \"         \\\"name\\\": \\\"Mohit\\\"\\n\" +\r\n                \"      },\\n\" +\r\n                \"      {\\n\" +\r\n                \"         \\\"name\\\": \\\"Rahul\\\"\\n\" +\r\n                \"      },\\n\" +\r\n                \"      {\\n\" +\r\n                \"         \\\"name\\\": \\\"Sahithi\\\"\\n\" +\r\n                \"      },\\n\" +\r\n                \"      {\\n\" +\r\n                \"         \\\"name\\\": \\\"Pramey\\\"\\n\" +\r\n                \"      },\\n\" +\r\n                \"      {\\n\" +\r\n                \"         \\\"name\\\": \\\"Nitesh\\\"\\n\" +\r\n                \"      },\\n\" +\r\n                \"      {\\n\" +\r\n                \"         \\\"name\\\": \\\"Gowtham\\\"\\n\" +\r\n                \"      }\\n\" +\r\n                \"   ]\\n\" +\r\n                \"}\"\r\n    }\r\n}\r\n<\/pre>\n<p>Now, you are ready to test your application on your device or emulator. You may notice that the data provided was in JSON format, but we can parse it in a list form.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-85072\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/09\/json-app-output.png\" alt=\"json app output\" width=\"350\" height=\"740\" \/><\/p>\n<h3>Summary<\/h3>\n<p>Through this article, you came across another essential topic known as JSON Parsing. You came across what JSON is and the structure it has. Later on, you saw its features and the type of data it can handle. You saw the difference between XML and JSON and understood why JSON is used over XML. Finally, you saw several methods that help in parsing and saw an implementation of the same.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this article, we will proceed with JSON Parsing in Android. You must be wondering how data flows between your application and the server. So, several ways are using which data flows. The most&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":85068,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2791],"tags":[4317,4318,4319],"class_list":["post-85018","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-android","tag-features-of-json","tag-json-datatypes","tag-json-parsing-in-android"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.7 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>JSON Parsing In Android - TechVidvan<\/title>\n<meta name=\"description\" content=\"Learn what is JSON Parsing in Android with implementation. See what is JSON, its features, data types, structure and why JSON over XML.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/techvidvan.com\/tutorials\/json-parsing-in-android\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"JSON Parsing In Android - TechVidvan\" \/>\n<meta property=\"og:description\" content=\"Learn what is JSON Parsing in Android with implementation. See what is JSON, its features, data types, structure and why JSON over XML.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/techvidvan.com\/tutorials\/json-parsing-in-android\/\" \/>\n<meta property=\"og:site_name\" content=\"TechVidvan\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/TechVidvan\/\" \/>\n<meta property=\"article:published_time\" content=\"2021-09-24T03:30:22+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-08-15T15:21:57+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2021\/09\/json-parsing-in-android.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"TechVidvan Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@vidvantech\" \/>\n<meta name=\"twitter:site\" content=\"@vidvantech\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"TechVidvan Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"JSON Parsing In Android - TechVidvan","description":"Learn what is JSON Parsing in Android with implementation. See what is JSON, its features, data types, structure and why JSON over XML.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/techvidvan.com\/tutorials\/json-parsing-in-android\/","og_locale":"en_US","og_type":"article","og_title":"JSON Parsing In Android - TechVidvan","og_description":"Learn what is JSON Parsing in Android with implementation. See what is JSON, its features, data types, structure and why JSON over XML.","og_url":"https:\/\/techvidvan.com\/tutorials\/json-parsing-in-android\/","og_site_name":"TechVidvan","article_publisher":"https:\/\/www.facebook.com\/TechVidvan\/","article_published_time":"2021-09-24T03:30:22+00:00","article_modified_time":"2024-08-15T15:21:57+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2021\/09\/json-parsing-in-android.jpg","type":"image\/jpeg"}],"author":"TechVidvan Team","twitter_card":"summary_large_image","twitter_creator":"@vidvantech","twitter_site":"@vidvantech","twitter_misc":{"Written by":"TechVidvan Team","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/techvidvan.com\/tutorials\/json-parsing-in-android\/#article","isPartOf":{"@id":"https:\/\/techvidvan.com\/tutorials\/json-parsing-in-android\/"},"author":{"name":"TechVidvan Team","@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/person\/e9c26e74dd3d87421f7ada9433b8cd22"},"headline":"JSON Parsing In Android","datePublished":"2021-09-24T03:30:22+00:00","dateModified":"2024-08-15T15:21:57+00:00","mainEntityOfPage":{"@id":"https:\/\/techvidvan.com\/tutorials\/json-parsing-in-android\/"},"wordCount":1292,"commentCount":0,"publisher":{"@id":"https:\/\/techvidvan.com\/tutorials\/#organization"},"image":{"@id":"https:\/\/techvidvan.com\/tutorials\/json-parsing-in-android\/#primaryimage"},"thumbnailUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2021\/09\/json-parsing-in-android.jpg","keywords":["Features of JSON","JSON DataTypes","JSON Parsing In Android"],"articleSection":["Android Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/techvidvan.com\/tutorials\/json-parsing-in-android\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/techvidvan.com\/tutorials\/json-parsing-in-android\/","url":"https:\/\/techvidvan.com\/tutorials\/json-parsing-in-android\/","name":"JSON Parsing In Android - TechVidvan","isPartOf":{"@id":"https:\/\/techvidvan.com\/tutorials\/#website"},"primaryImageOfPage":{"@id":"https:\/\/techvidvan.com\/tutorials\/json-parsing-in-android\/#primaryimage"},"image":{"@id":"https:\/\/techvidvan.com\/tutorials\/json-parsing-in-android\/#primaryimage"},"thumbnailUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2021\/09\/json-parsing-in-android.jpg","datePublished":"2021-09-24T03:30:22+00:00","dateModified":"2024-08-15T15:21:57+00:00","description":"Learn what is JSON Parsing in Android with implementation. See what is JSON, its features, data types, structure and why JSON over XML.","breadcrumb":{"@id":"https:\/\/techvidvan.com\/tutorials\/json-parsing-in-android\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/techvidvan.com\/tutorials\/json-parsing-in-android\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/techvidvan.com\/tutorials\/json-parsing-in-android\/#primaryimage","url":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2021\/09\/json-parsing-in-android.jpg","contentUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2021\/09\/json-parsing-in-android.jpg","width":1200,"height":628,"caption":"json parsing in android"},{"@type":"BreadcrumbList","@id":"https:\/\/techvidvan.com\/tutorials\/json-parsing-in-android\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/techvidvan.com\/tutorials\/"},{"@type":"ListItem","position":2,"name":"JSON Parsing In Android"}]},{"@type":"WebSite","@id":"https:\/\/techvidvan.com\/tutorials\/#website","url":"https:\/\/techvidvan.com\/tutorials\/","name":"TechVidvan Blogs","description":"","publisher":{"@id":"https:\/\/techvidvan.com\/tutorials\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/techvidvan.com\/tutorials\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/techvidvan.com\/tutorials\/#organization","name":"TechVidvan","url":"https:\/\/techvidvan.com\/tutorials\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/logo\/image\/","url":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2024\/03\/techvidvan-logo-200x50-1.webp","contentUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2024\/03\/techvidvan-logo-200x50-1.webp","width":200,"height":50,"caption":"TechVidvan"},"image":{"@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/TechVidvan\/","https:\/\/x.com\/vidvantech"]},{"@type":"Person","@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/person\/e9c26e74dd3d87421f7ada9433b8cd22","name":"TechVidvan Team","description":"The TechVidvan Team delivers practical, beginner-friendly tutorials on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. Our experts are here to help you upskill and excel in today\u2019s tech industry."}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/posts\/85018","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/comments?post=85018"}],"version-history":[{"count":2,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/posts\/85018\/revisions"}],"predecessor-version":[{"id":447629,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/posts\/85018\/revisions\/447629"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/media\/85068"}],"wp:attachment":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/media?parent=85018"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/categories?post=85018"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/tags?post=85018"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}