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
Developing for Android
Search
Realm
November 30, 2015
Programming
2
19k
Developing for Android
Presented by Chet Haase and Romain Guy at Bay Area Android Developer Group on November 30, 2015
Realm
November 30, 2015
Tweet
Share
More Decks by Realm
See All by Realm
WWDC 2017 Review
realm
0
2.1k
Xcode shortcuts
realm
0
4.7k
Self Branding with GitHub
realm
0
4.3k
Realm Mobile Platform overview and demo
realm
0
2k
Realm advanced topics and demo
realm
0
2k
Realm introduction Seoul meetup 10
realm
0
2.1k
Stuart Hall: How I got 2.3 Million App Downloads
realm
0
1.9k
James Majors: What the Swiftly Func?
realm
1
4.2k
Simina Pasat: Continuous everything for iOS apps
realm
0
610
Other Decks in Programming
See All in Programming
Grafana Loki によるサーバログのコスト削減
mot_techtalk
1
120
SwiftUIで単方向アーキテクチャを導入して得られた成果
takuyaosawa
0
270
Ruby on cygwin 2025-02
fd0
0
140
GoとPHPのインターフェイスの違い
shimabox
2
170
Multi Step Form, Decentralized Autonomous Organization
pumpkiinbell
1
720
Amazon Q Developer Proで効率化するAPI開発入門
seike460
PRO
0
110
Amazon ECS とマイクロサービスから考えるシステム構成
hiyanger
2
520
Formの複雑さに立ち向かう
bmthd
1
810
知られざるDMMデータエンジニアの生態 〜かつてツチノコと呼ばれし者〜
takaha4k
4
1.3k
GAEログのコスト削減
mot_techtalk
0
120
『GO』アプリ バックエンドサーバのコスト削減
mot_techtalk
0
140
苦しいTiDBへの移行を乗り越えて快適な運用を目指す
leveragestech
0
340
Featured
See All Featured
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
3
320
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.3k
How STYLIGHT went responsive
nonsquared
98
5.4k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
99
18k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
7
630
Embracing the Ebb and Flow
colly
84
4.6k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
12
960
Product Roadmaps are Hard
iamctodd
PRO
50
11k
A Modern Web Designer's Workflow
chriscoyier
693
190k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
29
1k
Being A Developer After 40
akosma
89
590k
Fashionably flexible responsive web design (full day workshop)
malarkey
406
66k
Transcript
Romain Guy Chet Haase Developing for Android +RomainGuy, @romainguy +ChetHaase,
@chethaase Development for Developers by Developers Managers
Developing for Android medium.com @chethaase
Why is Mobile Development So Difficult?
• Limited • Shared Memory
• Slower than desktop & server • Throttled CPU Much
• [See previous slide] • Texture uploads are expensive •
Fill rate vs. density GPU
• Larger application heaps lead to • More task thrashing
• Slower allocations • Slower collections • More garbage collector activity Memory == Performance
Allocate Enumerate Mark Collect
Allocate Enumerate Mark Collect Pause Pause Dalvik
Allocate Enumerate Mark Collect Pause ART
Slot Available Slot Freed
Slot Available Oh Noze! Slot Freed Pause GC_FOR_ALLOC
ART
• Your device is faster than your users’ • And
has more memory • Moore’s Law does not always apply Low-End Devices
• You have 16ms per frame • To do everything
• Consistency is good Smooth Frame Rate
• Dalvik vs. ART • Language != runtime != hardware
Runtime
Language != Platform Java programming language Runtime Hardware
Server-Land Moving, compacting collector CPU: Memory: very very fast Basically
∞ Java programming language Server runtime Server
Android No compaction Idle compaction CPU: wayyyy slower Memory: 512MB
- 2GB Java programming language ART Mobile Dalvik
• Android is single-threaded UI system • (mostly) • Eliminate
unnecessary work on UI thread UI Thread
• Storage performance varies • Storage size varies • So
apk size matters Storage
• Your network is faster than your users’ • And
maybe cheaper, too Network
• Every Device is a Village • Tragedy of the
Commons And Finally
Language & libraries
• Don’t use serialization • Use Android data structures •
Be mindful of XML and JSON usage • Avoid JNI • Primitives vs boxed primitives • Avoid reflection • Be careful with finalizers Know Your Language
Networking
• Don’t over-sync • Allow delayed downloading • Google Cloud
Messaging • GCM Network Manager (Job Scheduler) • Don’t poll • Only sync what you need to Syncing
• Don’t assume anything about the network • Develop for
low-end networks • And test for them, too Network quality
• Design back-end APIs for mobile usage patterns • Minimize
and compress data Data & protocols
Storage
• Don’t hard-code file paths • Persist relative paths only
• Use storage cache for temp files • Avoid SQLite for simple needs • Avoid using too many databases • Let user choose content storage location Random stuff about storage
Romain Guy Chet Haase Developing for Android +RomainGuy, @romainguy +ChetHaase,
@chethaase Development for Developers by Developers Q & A