249 Android JSON Parsing Tutorial With Volley |

249 Android JSON Parsing Tutorial With Volley |



Launch Your First Android app with our TOP course at 82% OFF (24 hrs ONLY) HERE https://goo.gl/7veBXc
“Learn How To Design + Code A Complete App From Scratch To Playstore”
➨ https://www.youtube.com/watch?v=aWGGZCOHZ1k
-~-~~-~~~-~~-~-

This Android JSON Parsing Tutorial video talks about how to parse the JSONObject received in the onResponse method using volley library. Use the has method to check if key exists, Use the getInt, getLong, getString, getJSONObject and getJSONArray methods to extract specific data from a JSONObject, dont forget to catch JSONException if the key-value pair is not found, use a simpledateformat with yyyy-MM-dd format to convert string to date object in java.

OUR WEBSITE
http://slidenerd.com

How to LEARN ANDROID from slidenerd?
Follow this-
1 https://www.youtube.com/playlist?list=PLonJJ3BVjZW6hYgvtkaWvwAVvOFB7fkLa
2 https://www.youtube.com/playlist?list=PLonJJ3BVjZW4lMlpHgL7UNQSGMERcDzHo
3 https://www.youtube.com/playlist?list=PLonJJ3BVjZW5JdoFT0Rlt3ry5Mjp7s8cT
4 https://www.youtube.com/playlist?list=PLonJJ3BVjZW6hmkEaYIvLLm5IEGM0kpwU
5 https://www.youtube.com/playlist?list=PLonJJ3BVjZW6CtAMbJz1XD8ELUs1KXaTD

How to learn JAVA from slidenerd?
Follow this-
1 https://www.youtube.com/playlist?list=PLonJJ3BVjZW7LFiBUpg5jo7CmzfVktV-o
2 https://www.youtube.com/playlist?list=PLonJJ3BVjZW6_q8gh7XoLUIhRIyBcYJLP

How to LEARN JAVASCRIPT from slidenerd?
Follow this-
1 https://www.youtube.com/playlist?list=PLonJJ3BVjZW7khFksz6Xb14lykip4DKNX

How to LEARN PYTHON from slidenerd?
Follow this-
1 https://www.youtube.com/playlist?list=PLonJJ3BVjZW6E0SaALGX_ffPPO477LYRq

OUR SOCIAL LINKS
https://www.facebook.com/groups/AndroidProgramming/
Follow us on
http://google.com/+slidenerd
http://facebook.com/slidenerd
https://twitter.com/slidenerdtech
http://pinterest.com/slidenerd

WHERE TO GET CODE?
http://github.com/slidenerd

source

32 comments

  1. Great video!
    Two questions:
    I don't use tabs because i really hate them. For now I'm using the ViewPager because you use it in your video, but shouldn't I use another View? Because at the moment I can slide through my fragments (what I dont want to happen!).

    If i want to change the Fragment by clicking the items in the NavigationDrawer, what would i need? (kind of method in Main to change the Fragment from the outside, but i cant make all public just because i want to use one method from the NavigationDrawer)

  2.  i humbly recommend you make a separete video on how to use android parallaxHeaderViewPager library so that can we can   give the app a more beautifull  look like on used in Google play Newsstand app

  3. Thanks for uploading all these video tutorials. I have a question regarding JSON parsing. I am retrieving a JSON string from a remote database which has ratings values. I am able to fetch it on a text view but when i try to update the rating bar it gives me a null pointer exception error. And after debugging it shows me error at ratingbar.setRating(); method. I would appreciate your feedback on this error.

  4. Hey, i am a complete fan of your tutorials. I require a help from your end. How to use Request.Method.Post using Volley. I basically need to authenticate a form by sending post request to the server.

  5. private void parseJsonFeed(JSONObject response) {
            Gson gson = new Gson();
            MovieResponse mresponse = gson.fromJson(response.toString(), MovieResponse.class);
            try {
                feedItems = mresponse.getMovies();
              
            } catch (Exception ex)
            {
                    
            }

        }
    sir this can be simply parse with the help of gson.

  6. "error": "Account Inactive"
    i have encountered to gain new api bt all are showing the same error, objected to rotten tomatto bt no result is coming. How can i get rid of it? Another thing is, if the key or account gets inactive as i wasn't log in for 2days, then wont it make any disturbance while user is using this, wont the app stop the supply of data .? plz do rply , plz

  7. Hey slidenerd, great tutorial, much appreciated. i just have an error about the JsonObjectRequest in the sendJsonRequest method. the error states:

    Error:(104, 38) error: reference to JsonObjectRequest is ambiguous
    both constructor JsonObjectRequest(int,String,String,Listener<JSONObject>,ErrorListener) in JsonObjectRequest and constructor JsonObjectRequest(int,String,JSONObject,Listener<JSONObject>,ErrorListener) in JsonObjectRequest match

    any help would be greatly appreciated. thanks 

  8. Thanks wont be enough for what you have done or doing sir. Now i wanna know , how can i make my rotten tomato account active all the time so that user can get recent information anytime. Please sir, help me 🙁

  9. i have follow this chapter of video form the first to now and i have never see MaterialTabHost, tabHost, and viewPager before.
    where i can find the tutorial video of using it ?

  10. I love your tutorials. I have a quick question though. I'm trying to implement this for a different API whose response is JSON in the same way as Rotten Tomatoes. But I seem to be unable to load the first JSONArray as a toast for parsing just one item. I get nothing, no toast notification.

    Does parseJSONResponse need to be called somehwere? Since it is a function. How exactly does the function get its parameter Response? Coz I'm trying to understand why I get 0 responses

  11. +slidenerd I am facing a problem, can you please help me out.
    First of all Toast Message is not getting displayed (which display the details taken from Rotton Tomatoes API)

    When I run the app on Genymotion its showing error an error LogCat like:
    -eglSurfaceAttrib not implemented
    -Failed to set EGL_SWAP_BEHAVIOR on surface 0xa486a700, error=EGL_SUCCESS
    -Skipped 73 frames!  The application may be doing too much work on its main thread.

    And When I run the app on Actual device MOTO G 2nd Gen , its shows error in logCat like:
    – BasicNetwork.logSlowRequests
    – Request.finish: 4574 ms

  12. Hey Slidenerd, the tutorials you do are great! However, the JSON file I'm using is structured a little differently, so I am having some problems. It's more like:

    { "items": [ ["some name1", some number1, "some type1", "some location1"], ["some name2", some number2, "some type2", "some location2"], ["some name3", some number3, "some type3", "some location3"] …] }

    This is what I've got so far:

    StringBuilder data=new StringBuilder();
    JSONArray arrayItems = response.getJSONArray(EndpointVenues.KEY_ITEMS);
    for (int i=0;i<arrayItems.length(); i++){
    JSONArray arrayListings = arrayItems.getJSONArray(i);
    for (int j=0;j<arrayListings.length(); j++){
    String name = getString(0);
    Double number = getDouble(1);
    String type = getString(2);}
    }

    I know I need to have an subarray within the array "Items", but I want to be able to access the data within the subarray by their position on the list (e.g. 0 will give me name, 1 will give me number, 2 will give me type, 3 will give me location). I'm not exactly sure what code to put in after declaring the subarray. Any help would be vastly helpful!

  13. thinks bro for your amazing videos
    In my case I am trayin to cunsume an api that return an object without name like that : [{"idMembre":1,"nomMembre":"Hassen"},{"idMembre":2,"nomMembre":"Hassen"},{"idMembre":3,"nomMembre":"Hassen"},{"idMembre":4,"nomMembre":"Hassen"},{"idMembre":8,"nomMembre":"Dakhl"},{"idMembre":13,"nomMembre":"CCCCCCCCCCCCC"},{"idMembre":14,"nomMembre":"jjjjjjjjj"},{"idMembre":15,"nomMembre":"uuuuuuuuuuuu"}] what i have to do ;it runs perfectky but it deosn't display anything please any help

  14. At 1:35, why do we create an interface to store all the variables? Could we just have stored them in a class? Why store them in an interface or a nested interface at that?

Comments are closed.