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
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
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.2k
Xcode shortcuts
realm
0
4.7k
Self Branding with GitHub
realm
0
4.3k
Realm Mobile Platform overview and demo
realm
0
2.1k
Realm advanced topics and demo
realm
0
2k
Realm introduction Seoul meetup 10
realm
0
2.2k
Stuart Hall: How I got 2.3 Million App Downloads
realm
0
2k
James Majors: What the Swiftly Func?
realm
1
4.3k
Simina Pasat: Continuous everything for iOS apps
realm
0
650
Other Decks in Programming
See All in Programming
守る「だけ」の優しいEMを抜けて、 事業とチームを両方見る視点を身につけた話
maroon8021
3
1.1k
エラーログのマスキングの仕組みづくりに役立ったASTの話
kumoichi
0
260
Redox OS でのネームスペース管理と chroot の実現
isanethen
0
280
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
790
Goの型安全性で実現する複数プロダクトの権限管理
ishikawa_pro
2
490
API Platformを活用したPHPによる本格的なWeb API開発 / api-platform-book-intro
ttskch
1
150
SourceGeneratorのマーカー属性問題について
htkym
0
200
ふつうのRubyist、ちいさなデバイス、大きな一年 / Ordinary Rubyists, Tiny Devices, Big Year
chobishiba
1
480
技術検証結果の整理と解析をAIに任せよう!
keisukeikeda
0
130
[SF Ruby Feb'26] The Silicon Heel
palkan
0
120
Understanding Apache Lucene - More than just full-text search
spinscale
0
130
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
710
Featured
See All Featured
Fashionably flexible responsive web design (full day workshop)
malarkey
408
66k
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
0
230
Tell your own story through comics
letsgokoyo
1
850
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
0
210
It's Worth the Effort
3n
188
29k
Into the Great Unknown - MozCon
thekraken
40
2.3k
Tips & Tricks on How to Get Your First Job In Tech
honzajavorek
0
460
The agentic SEO stack - context over prompts
schlessera
0
700
Navigating Weather and Climate Data
rabernat
0
140
Abbi's Birthday
coloredviolet
2
5.5k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
231
22k
Building AI with AI
inesmontani
PRO
1
800
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