Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Journey to Parsing JSON in Android - Lintasarta...
Search
Ahmad Arif Faizin
April 22, 2020
Programming
340
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
Designing User-Friendly Interfaces: Bridging UI/UX and Basic Programming
arifaizin
0
71
Potong 10 Jam Kerja Repetitif Per Minggu. Tanpa Coding.
arifaizin
0
21
Recap by AI: Mengembalikan Waktu Produktif Tim
arifaizin
0
21
Proposal Ramadhan Habit Challenge 2026
arifaizin
0
16
Memulai Karier Sebagai Data Scientist
arifaizin
0
22
Kunci Sukses Menjadi Full Stack Developer
arifaizin
0
22
Certification Exam Prep AI-102: Microsoft Azure AI Engineer Associate elevAIte 2025
arifaizin
0
17
Dicoding Ramadhan Challenge 2025
arifaizin
0
20
Mental Model untuk Memahami Orang Lain
arifaizin
0
180
Other Decks in Programming
See All in Programming
CodeRabbitの効果検証と過ごしてみた3ヶ月
armondando
0
220
機械に任せるテスト、人が見るテスト ⽣成AIで引き直した、運⽤保守フェーズの線引き
dske104
0
180
Everything will be SERVERLESS — 信じて運用した10年の経験値 / Everything Will be Serverless — Lessons Learned from 10 Years of Operational Experience
seike460
PRO
1
960
個人開発者よ、Honoを使え(おじさんver)
tanahiro2010
2
240
AI主導のプログラミング学習アプリを作ってみた
econanringo
0
150
Workers Cache を知る
syumai
0
350
[2026-09-26]空論ジェネリックプロセス~テスト資産とAIで紡ぐ、再現可能なパフォーマンスチューニングの話~
tosite
0
260
AI が書く Go コードの品質を劇的に向上させる Linter: “declscope”
mpyw
0
490
パスワード再設定メールのURLについて知っておこう
uyuki234
0
120
AWS CDKのカスタムリソースでContinuum(旧Security Agent)を実装した話 | Implementing Continuum (formerly Security Agent) via AWS CDK Custom Resource
akihisaikeda
2
150
re:Inventに行く前に知っておきたい現地参加のノウハウ
nokomoro3
0
400
見えないものを探る要求要件定義に必要な基本的思考 / invisible-requirement-thinking
minodriven
15
8.2k
Featured
See All Featured
The Illustrated Children's Guide to Kubernetes
chrisshort
51
53k
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
210
30 Presentation Tips
portentint
PRO
1
430
Mobile First: as difficult as doing things right
swwweet
225
10k
Product Roadmaps are Hard
iamctodd
55
13k
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
2
530
Balancing Empowerment & Direction
lara
6
1.3k
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
590
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
300
For a Future-Friendly Web
brad_frost
184
10k
Design in an AI World
tapps
1
350
A better future with KSS
kneath
240
18k
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