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
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
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
110
The Secret Project Team Who First Launch Android OS - The Untold Story
arifaizin
0
92
The Journey to Keep Strive as a Tech Talent - The Untold Story
arifaizin
0
25
Focus Group Discussion (FGD) Penyempurnaan Kurikulum Program Studi Informatika
arifaizin
0
75
[Indocomtech Event] Intro to AI: Essential Basics and Practical Guide to Get You Started - Coding Camp 2025 powered by DBS Foundation
arifaizin
0
34
BDD 2024 - Automate Dependency Management in a Scalable Way with Gradle Version Catalog
arifaizin
0
180
Tips & Trik Menghabiskan Task dengan Automa
arifaizin
0
33
The Opportunity of a Digital World - Dicoding Career Fair 2023
arifaizin
0
110
Bringing Machine Learning in Android with MediaPipe - DroidJam 2023
arifaizin
2
770
Other Decks in Programming
See All in Programming
LLM Observabilityによる 対話型音声AIアプリケーションの安定運用
gekko0114
2
440
AIエージェントのキホンから学ぶ「エージェンティックコーディング」実践入門
masahiro_nishimi
6
680
2026年 エンジニアリング自己学習法
yumechi
0
140
Package Management Learnings from Homebrew
mikemcquaid
0
230
AI によるインシデント初動調査の自動化を行う AI インシデントコマンダーを作った話
azukiazusa1
1
750
Honoを使ったリモートMCPサーバでAIツールとの連携を加速させる!
tosuri13
1
180
要求定義・仕様記述・設計・検証の手引き - 理論から学ぶ明確で統一された成果物定義
orgachem
PRO
1
240
CSC307 Lecture 07
javiergs
PRO
1
560
【卒業研究】会話ログ分析によるユーザーごとの関心に応じた話題提案手法
momok47
0
200
AI時代の認知負荷との向き合い方
optfit
0
170
AI時代のキャリアプラン「技術の引力」からの脱出と「問い」へのいざない / tech-gravity
minodriven
21
7.4k
Gemini for developers
meteatamel
0
100
Featured
See All Featured
A Modern Web Designer's Workflow
chriscoyier
698
190k
ラッコキーワード サービス紹介資料
rakko
1
2.3M
Become a Pro
speakerdeck
PRO
31
5.8k
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
89
Navigating Team Friction
lara
192
16k
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
120
Tell your own story through comics
letsgokoyo
1
810
Typedesign – Prime Four
hannesfritz
42
3k
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
130
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
1.8k
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
We Have a Design System, Now What?
morganepeng
54
8k
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