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
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
61
Potong 10 Jam Kerja Repetitif Per Minggu. Tanpa Coding.
arifaizin
0
15
Recap by AI: Mengembalikan Waktu Produktif Tim
arifaizin
0
11
Proposal Ramadhan Habit Challenge 2026
arifaizin
0
11
Memulai Karier Sebagai Data Scientist
arifaizin
0
15
Kunci Sukses Menjadi Full Stack Developer
arifaizin
0
14
Certification Exam Prep AI-102: Microsoft Azure AI Engineer Associate elevAIte 2025
arifaizin
0
9
Dicoding Ramadhan Challenge 2025
arifaizin
0
13
Mental Model untuk Memahami Orang Lain
arifaizin
0
170
Other Decks in Programming
See All in Programming
書籍「プロフェッショナルAI駆動開発」紹介スライド
juntaromatsumoto
0
480
ソフトウェアエンジニアにとっての生成AI - 特性を知って使い倒す / generative ai for software enginner
kishida
7
2.1k
Loosening the Reins: Go Generics Get More Flexible
kuro_kurorrr
0
300
Go 1.27 における memory allocation の高速化
andpad
0
310
実装をデザインガイドラインに追従させるための取り組み / 260731-dip-mosh-design-system
dachi023
0
7.7k
源内ハンズオン概要編
hideg
0
210
Cloudflare is Agents
chimame
0
180
Building a Meta Ray-Ban display app
akkeylab
0
180
言葉の格闘技のススメ~紙とペンと言葉から始める、キャリアの描き方~
progresscicada
2
170
VibeCodingからAgenticWorkflowへ
starfish719
0
830
Claude CodeとAgentCore Gatewayを繋ぐ際の認証認可 / Authentication and authorization when connecting Claude Code with AgentCore Gateway
har1101
2
380
わからない話を追いかけたら、プログラミング言語を作る側にいた
ydah
3
540
Featured
See All Featured
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
4.4k
Building a Scalable Design System with Sketch
lauravandoore
463
34k
Evolving SEO for Evolving Search Engines
ryanjones
0
260
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
210
The untapped power of vector embeddings
frankvandijk
2
1.8k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.5k
Un-Boring Meetings
codingconduct
0
390
The World Runs on Bad Software
bkeepers
PRO
72
12k
Reality Check: Gamification 10 Years Later
codingconduct
0
2.3k
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
2.2k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
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