GSON Tutorial Part 1 – SIMPLE (DE)SERIALIZATION – Android Studio Tutorial

///GSON Tutorial Part 1 – SIMPLE (DE)SERIALIZATION – Android Studio Tutorial

GSON Tutorial Part 1 – SIMPLE (DE)SERIALIZATION – Android Studio Tutorial

FavoriteLoadingAdd to favorites

In this video series we take a look at the GSON library, which is provided by Google and makes the process of turning Java objects into their JSON representation (serialization) and JSONs into Java objects (deserialization) very easy.

Java468x60

In part 1 we are going to create a simple Java class, create an object of it, turn it into a JSON and then turn that JSON back into the java object. We will also learn how to use the @SerializedName annotation to use different keys and variable names.

Watch the whole playlist:

Source code, dependencies, instructions etc:

____________________
❗ Subscribe to the channel:

? Find more tutorials and courses on my website:

? Hire me for your next project:

? Subscribe to the Coding in Flow newsletter:

? Donate to Coding in Flow with a message:

❓ Ask your programming questions in our chat:

? Follow Coding in Flow on other sites:
Facebook:
Instagram:
Twitter:
Github:

⌨️ My gear and tools:
Microphone:
Mouse:
Keyboard:
Desk:
Monitor:
Webcam:
Screen recorder:

(above links are affiliate links, which means that I earn a small commission if you buy through them with NO additional costs to you.)

source

By |2021-02-25T12:35:11+00:00February 25th, 2021|Java Video Tutorials|36 Comments

36 Comments

  1. ageerre February 25, 2021 at 12:35 pm - Reply

    Very nice explanation! Thank you for sharing your knowledge with us.

  2. Thank you so much, It's work for me. 🙂 🙂 🙂

  3. Go9spodin February 25, 2021 at 12:35 pm - Reply

    Extremely good tutorials, best ones I've found on Android App Development. Thank you a lot for putting your time into this.

  4. Waris Khan February 25, 2021 at 12:35 pm - Reply

    Brother i need to ask one question….. Why you have created (employees.json) file separately whereas you have created Stringjson again…. why do i have to write json code two times??? please give me guidance if i am wrong

  5. Sahil Shirodkar February 25, 2021 at 12:35 pm - Reply

    Can please any one help me how to convert the json data into geojson in android?

  6. Дмитрий Онищук February 25, 2021 at 12:35 pm - Reply

    Thx

  7. Ady Bangun February 25, 2021 at 12:35 pm - Reply

    Very nice totorial, thank you.

  8. Study Online February 25, 2021 at 12:35 pm - Reply

    Hello Florian, I have a doubt. Let's say we have a json object such as follwing:
    {
    field1:{ another json obj}
    field2:
    {
    field 3: {
    field4: {
    .
    .
    .
    .
    .
    //nested obj at level say 1 million : { some json obj}
    .
    .
    }
    }
    Now my app needs just this one json object which may be a plain json obj or an array of it.
    How to access just this one obj which is nested so deeeeeeeeep using RETROFIT and gson converter factory?

  9. Parikshit Raghav February 25, 2021 at 12:35 pm - Reply

    Thank u SIr u r a legend for us<3

  10. Amit Jayant February 25, 2021 at 12:35 pm - Reply

    This is awesome ?

  11. Дмитрий Онищук February 25, 2021 at 12:35 pm - Reply

    Thx

  12. Teo Prayoga Kartika February 25, 2021 at 12:35 pm - Reply

    Volley + gson = easy code

  13. Kevin Hoang February 25, 2021 at 12:35 pm - Reply

    WOw. I've been trying to do it the long way using Volley

  14. Ravi Sorathiya February 25, 2021 at 12:35 pm - Reply

    Cant wait for more retrofit tutorials!

  15. Fast App Development February 25, 2021 at 12:35 pm - Reply

    Amazing explanation. Just a quick question, Why not change variable names according to JSON if we are going to convert Employee object into JSON and vice versa alot? What is logic behind using @SerializedName?

  16. Abhirup Acharya February 25, 2021 at 12:35 pm - Reply

    right to the point.. Lovely explanation

  17. Mix up February 25, 2021 at 12:35 pm - Reply

    thanks for this tutorial….

  18. Kane Borreo February 25, 2021 at 12:35 pm - Reply

    this helps a lot

  19. Muhammad Safi Ullah February 25, 2021 at 12:35 pm - Reply

    Thanks!

  20. Paulo Andrade February 25, 2021 at 12:35 pm - Reply

    Thank you so much coding flow channel. That's why I insist on giving the credits for thi channel on my app. You're helping me a lot.

  21. Daniel G February 25, 2021 at 12:35 pm - Reply

    Nice one!. Clear example. It could be more instructive if we clearify the Serialize and Deserialize process. Of course, there is a lot of material in internet about it.

  22. MATEO FLOREZ JARAMILLO February 25, 2021 at 12:35 pm - Reply

    De que manera amplias las areas que quieres enfocar? grandioso!!

  23. RᴀɪɴDᴇᴠᴏᴜʀs February 25, 2021 at 12:35 pm - Reply

    35 secs in, did everything like in the video but even then the dependencies are giving me multiple errors xd wtf

  24. Dwi Eko Raharjo February 25, 2021 at 12:35 pm - Reply

    bagus gan terusin hehehe klu bs yg lbh kompleks mas masalahnya biar seru

  25. Sonj C February 25, 2021 at 12:35 pm - Reply

    Perfect, it helps a lot. Keep up the good work 🙂

  26. Cailey Ten February 25, 2021 at 12:35 pm - Reply

    How do I do this with an API and not retrofit?

  27. The everything Channel February 25, 2021 at 12:35 pm - Reply

    Love you man
    And the fact that you are providing this for free is amazing
    please never stop doing this !!!

  28. Vidyesh Churi February 25, 2021 at 12:35 pm - Reply
  29. GSP03 February 25, 2021 at 12:35 pm - Reply

    I love the tutorial. Finally a simple, easy to understand and straight to the point.

  30. Goral 90 February 25, 2021 at 12:35 pm - Reply

    How to write to create a .json-File and write data in there automatically?

  31. Farry February 25, 2021 at 12:35 pm - Reply

    i can't see json string in debugger , does this means that gson.tojson(employee) is not executed or something else ?

  32. Coda February 25, 2021 at 12:35 pm - Reply

    Amazing simple to follow tutorial. I needed to understand how to work with JSON and GSON since the project I am working on requires me to fetch data from a website via API key, this tutorial definitely lead me in the right direction

  33. Fatih Ersoy February 25, 2021 at 12:35 pm - Reply

    This tutorial series're amazing!

  34. Alwin Kulcsar February 25, 2021 at 12:35 pm - Reply

    Danke für die Tutorials, sehr verständlich und gut erklärt!

  35. Ziko Isaac February 25, 2021 at 12:35 pm - Reply

    very simple, very awesome. thanks <3

  36. Harvinder Singh February 25, 2021 at 12:35 pm - Reply

    how to check the value of json String while debugging in latest android studio 3:05

Leave A Comment

*