{"id":22819949,"url":"https://github.com/devdhera/guide-to-json-with-android","last_synced_at":"2026-04-19T14:34:01.369Z","repository":{"id":101417330,"uuid":"164282924","full_name":"DevDHera/Guide-to-JSON-with-Android","owner":"DevDHera","description":"JSON parsing demo using Android application","archived":false,"fork":false,"pushed_at":"2019-01-06T11:42:03.000Z","size":174,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-30T23:15:35.663Z","etag":null,"topics":["android","example","json","parsing"],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DevDHera.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-01-06T06:51:00.000Z","updated_at":"2019-01-22T01:45:50.000Z","dependencies_parsed_at":null,"dependency_job_id":"5f5f5973-62e7-43c0-8c5d-9e4700f5de43","html_url":"https://github.com/DevDHera/Guide-to-JSON-with-Android","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/DevDHera/Guide-to-JSON-with-Android","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DevDHera%2FGuide-to-JSON-with-Android","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DevDHera%2FGuide-to-JSON-with-Android/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DevDHera%2FGuide-to-JSON-with-Android/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DevDHera%2FGuide-to-JSON-with-Android/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DevDHera","download_url":"https://codeload.github.com/DevDHera/Guide-to-JSON-with-Android/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DevDHera%2FGuide-to-JSON-with-Android/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274903419,"owners_count":25371151,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-12T02:00:09.324Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","example","json","parsing"],"created_at":"2024-12-12T15:15:10.524Z","updated_at":"2026-04-19T14:34:01.317Z","avatar_url":"https://github.com/DevDHera.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://github.com/DevDHera/Guide-to-JSON-with-Android/blob/master/public/json-img.png\" alt=\"json_parsing\"\u003e\n\u003c/p\u003e\n\u003ch2 align=\"center\"\u003eJSON Parsing - Android Guide\u003c/h2\u003e\n\n\u003cp align=\"center\"\u003e\n\u003ca href=\"https://github.com/DevDHera/Guide-to-JSON-with-Android/blob/master/LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/github/license/DevDHera/Guide-to-JSON-with-Android.svg\" alt=\"License\"\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/DevDHera/Guide-to-JSON-with-Android/issues\"\u003e\u003cimg src=\"https://img.shields.io/github/issues/DevDHera/Guide-to-JSON-with-Android.svg\" alt=\"issues\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\n## Overview\n\nThis projects focus on providing a basis for dealing with `JSON` responses that get when using a `REST API`.\n\nProject showcase the JSON parsing using a simple list view based Android Application.\n\n\n## Content\n\nProject divided into three sections like below.\n\n* [JSON Parsing - Standard](#json-parsing---standard)\n* [JSON Parsing - Using Volly](#json-parsing---using-volly)\n* [JSON Parsing - Using Retrofit](#json-parsing---using-retrofit)\n\n#### JSON Parsing - Standard \n\nHere we use a separate `HttpHandler` class to modularize and organize our HttpUrlConnections.\n\n```java\npublic String makeServiceCall(String reqUrl) {\n    String response = null;\n\n    try {\n        URL url = new URL(reqUrl);\n        HttpsURLConnection conn = (HttpsURLConnection) url.openConnection();\n        conn.setRequestMethod(\"GET\");\n\n        InputStream in = new BufferedInputStream(conn.getInputStream());\n        response = convertStreamToString(in);\n\n    } catch (MalformedURLException e) {\n        e.printStackTrace();\n    } catch (IOException e) {\n        e.printStackTrace();\n    }\n\n    return response;\n}\n```\n\n**[Source](https://github.com/DevDHera/Guide-to-JSON-with-Android/tree/master/app)**\n\n#### JSON Parsing - Using Volly\n\nHere we use a separate `AppController` singleton class to initialize volly objects.\n\n```java\npublic static synchronized AppController getInstance() {\n        return mInstance;\n}\n\npublic RequestQueue getRequestQueue() {\n    if (mRequestQueue == null) {\n        mRequestQueue = Volley.newRequestQueue(getApplicationContext());\n    }\n\n    return mRequestQueue;\n}\n```  \n\n**[Source](https://github.com/DevDHera/Guide-to-JSON-with-Android/tree/master/jsonparsing-volly)**\n\n\n#### JSON Parsing - Using Retrofit\n\nOne of the favourite ways to deal with the Networks is to use the `Retrofit Library`.\n\nWe love :heart: Retrofit because its type-safe nature.\n\nFollowing is how we create a Retrofit instance.\n\n```java\npublic class ApiClient {\n    public static final String BASE_URL = \"https://api.androidhive.info/\";\n    private static Retrofit retrofit = null;\n\n    public static Retrofit getClient() {\n        if (retrofit==null) {\n            retrofit = new Retrofit.Builder()\n                    .baseUrl(BASE_URL)\n                    .addConverterFactory(GsonConverterFactory.create())\n                    .build();\n        }\n        return retrofit;\n    }\n}\n```\n\n**[Source](https://github.com/DevDHera/Guide-to-JSON-with-Android/tree/master/jsonparsing-retrofit)**\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevdhera%2Fguide-to-json-with-android","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevdhera%2Fguide-to-json-with-android","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevdhera%2Fguide-to-json-with-android/lists"}