$30 off During Our Annual Pro Sale. View Details »
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
0
310
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
Tweet
Share
More Decks by Ahmad Arif Faizin
See All by Ahmad Arif Faizin
Mental Model untuk Memahami Orang Lain
arifaizin
0
79
The Secret Project Team Who First Launch Android OS - The Untold Story
arifaizin
0
78
The Journey to Keep Strive as a Tech Talent - The Untold Story
arifaizin
0
15
Focus Group Discussion (FGD) Penyempurnaan Kurikulum Program Studi Informatika
arifaizin
0
62
[Indocomtech Event] Intro to AI: Essential Basics and Practical Guide to Get You Started - Coding Camp 2025 powered by DBS Foundation
arifaizin
0
21
BDD 2024 - Automate Dependency Management in a Scalable Way with Gradle Version Catalog
arifaizin
0
160
Tips & Trik Menghabiskan Task dengan Automa
arifaizin
0
27
The Opportunity of a Digital World - Dicoding Career Fair 2023
arifaizin
0
100
Bringing Machine Learning in Android with MediaPipe - DroidJam 2023
arifaizin
2
750
Other Decks in Programming
See All in Programming
S3 VectorsとStrands Agentsを利用したAgentic RAGシステムの構築
tosuri13
4
250
Microservices rules: What good looks like
cer
PRO
0
440
AIコーディングエージェント(Gemini)
kondai24
0
110
配送計画の均等化機能を提供する取り組みについて(⽩⾦鉱業 Meetup Vol.21@六本⽊(数理最適化編))
izu_nori
0
120
[SF Ruby Conf 2025] Rails X
palkan
0
410
TypeScript 5.9 で使えるようになった import defer でパフォーマンス最適化を実現する
bicstone
1
960
堅牢なフロントエンドテスト基盤を構築するために行った取り組み
shogo4131
4
1.9k
UIデザインに役立つ 2025年の最新CSS / The Latest CSS for UI Design 2025
clockmaker
16
6.4k
Reactive Thinking with Signals and the new Resource API
manfredsteyer
PRO
0
160
Herb to ReActionView: A New Foundation for the View Layer @ San Francisco Ruby Conference 2025
marcoroth
0
240
Building AI with AI
inesmontani
PRO
1
470
Google Antigravity and Vibe Coding: Agentic Development Guide
mickey_kubo
2
130
Featured
See All Featured
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
22k
Build your cross-platform service in a week with App Engine
jlugia
234
18k
The World Runs on Bad Software
bkeepers
PRO
72
12k
Code Reviewing Like a Champion
maltzj
527
40k
Music & Morning Musume
bryan
46
7k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
249
1.3M
Balancing Empowerment & Direction
lara
5
780
Building a Scalable Design System with Sketch
lauravandoore
463
34k
Bootstrapping a Software Product
garrettdimon
PRO
307
110k
Speed Design
sergeychernyshev
33
1.3k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.3k
Designing for humans not robots
tammielis
254
26k
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