Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Journey to Parsing JSON in Android - Lintasarta...
Search
Ahmad Arif Faizin
April 22, 2020
Programming
330
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Journey to Parsing JSON in Android - Lintasarta Developer Talk Online Series #6
1. Manual Parsing
2. Using GSON
3. Retrofit + GSON
Video :
https://youtu.be/hrfuFt9YUQI
Ahmad Arif Faizin
April 22, 2020
More Decks by Ahmad Arif Faizin
See All by Ahmad Arif Faizin
Mental Model untuk Memahami Orang Lain
arifaizin
0
170
The Secret Project Team Who First Launch Android OS - The Untold Story
arifaizin
0
120
The Journey to Keep Strive as a Tech Talent - The Untold Story
arifaizin
0
50
Focus Group Discussion (FGD) Penyempurnaan Kurikulum Program Studi Informatika
arifaizin
0
92
[Indocomtech Event] Intro to AI: Essential Basics and Practical Guide to Get You Started - Coding Camp 2025 powered by DBS Foundation
arifaizin
0
65
BDD 2024 - Automate Dependency Management in a Scalable Way with Gradle Version Catalog
arifaizin
0
200
Tips & Trik Menghabiskan Task dengan Automa
arifaizin
0
47
The Opportunity of a Digital World - Dicoding Career Fair 2023
arifaizin
0
150
Bringing Machine Learning in Android with MediaPipe - DroidJam 2023
arifaizin
2
800
Other Decks in Programming
See All in Programming
数百円から始めるRuby電子工作
tarosay
0
120
仕様書を書く前にハーネスを作る - Agent Native開発は「探索を速く、判定を固く」
gotalab555
3
1.3k
【SRE NEXT 2026 Lunch Session】一人目専任SREの立ち上げを加速する ― AIと進めたオンボーディングで2分を0.04秒にした話
pkshadeck
PRO
0
3.3k
AI時代に設計が 最大の生産性レバーになる 意図駆動開発とデータを消さない設計|Don't Delete Your Data or Your Intent — Design as the Deepest Lever in the AI Era
tomohisa
0
120
全PRの83%がAIレビューだけでマージできるようになった開発組織はその後どうなったか
athug
0
640
生成AI導入の「期待外れ」を乗り越える ー 開発フロー改革が目指す、真の組織変革
starfish719
0
2.8k
今さら聞けない .NET CLI
htkym
0
160
その節約、円になってますか?
isamumumu
0
570
そこに3びきプロダクトがいるじゃろう——生成AI時代における“価値が届かない理由”の構造
kosuket
0
340
言語を使う側から、作る側へ。 自作 Lisp で得た新たな気づき。
andpad
0
140
壊れたパーサから始める関数型設計と構成的なパーサ #fp_matsuri
raiga0310
2
420
PHPだって関数型したい 〜できること、できないこと〜 / fp-in-php
jsoizo
1
260
Featured
See All Featured
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
200
SEO for Brand Visibility & Recognition
aleyda
0
4.6k
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
190
Making the Leap to Tech Lead
cromwellryan
135
10k
Marketing to machines
jonoalderson
1
5.6k
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
480
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
280
Git: the NoSQL Database
bkeepers
PRO
432
67k
YesSQL, Process and Tooling at Scale
rocio
174
15k
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
200
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
410
More Than Pixels: Becoming A User Experience Designer
marktimemedia
3
470
Transcript
Journey to Parsing JSON in Android Ahmad Arif Faizin Academy
Content Writer Dicoding Indonesia 1
Identify your state 2 Cari requirement pada lowongan pekerjaan dan
pisahkan skill yang sudah dikuasai dan belum dikuasai
Essential Skill 3 Cek di www.dicoding.com/jobs
4 What is Web Services? Suatu layanan yang mengizinkan dua
aplikasi saling terhubung melalui jaringan, sehingga kita dapat mengambil dan mengirim data ke layanan tersebut dengan mudah.
Concept 5
What is JSON? 6 (Javascript Object Notation) merupakan format pertukaran
data yang ringan dan mudah dibaca (dibanding XML). Format ini dapat digunakan di hampir semua bahasa pemrograman.
Try access JSON 7 dicoding.id/cobajson
Whats? 8
9 dicoding.id/jsonformatter
After using JSON Formatter 10
Key-Value 11
JSONArray vs JSONObject 12
How to read JSON in Android?
3 Ways 14 3 2 Manual Parsing 1 Using GSON
Retrofit + GSON
Let’s start the journey… 15
1. Manual Parsing Change one-by-one 16
Basic concept 17
Get all data 18
Final Code Using LoopJ 19 dicoding.id/cobajson1
Final Code Using Volley 20
2. Parsing With GSON Faster way to convert into model
21
GSON library 22 Buka build.gradle(module: app) dan tambahkan kode berikut:
Data Class 23 Tambahkan annotation sesuai JSON
Using GSON 24
Diff 25
Want more? 26
Nested Class 27 Buat model untuk yang paling atas
Using GSON 28
Diff 29
Source code Gson 30 dicoding.id/cobajson2
3. Retrofit + GSON Converter The best way to convert
all responses 31
Retrofit library 32 Buka build.gradle(module: app) dan tambahkan kode berikut:
Setup Retrofit 33 Endpoint : https://reqres.in/api/users?page=1
Get Data with Retrofit 34 Karena data yang didapat sudah
di-parsing, maka tidak perlu fungsi parseJson lagi
Want more? 35
Service Locator Pattern 36 Supaya tidak mengulang-ulang kode, buat satu
class sebagai kode pusat.
Bonus! 37 Plugin RoboPojoGenerator Otomatis membuat class model dari data
json
None
None
Final code 40 dicoding.id/cobajson3
Finish? 41
42 dicoding.id/lpandroid
“Quotations are commonly printed as a means of inspiration and
to invoke philosophical thoughts from the reader. 43
Thanks! Any questions? You can find me at: • Google
: Ahmad Arif Faizin • IG : @arif_faizin • Medium : @arifaizin • Email :
[email protected]
44