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
1.9k
Xcode shortcuts
realm
0
4.6k
Self Branding with GitHub
realm
0
4.2k
Realm Mobile Platform overview and demo
realm
0
1.9k
Realm advanced topics and demo
realm
0
1.9k
Realm introduction Seoul meetup 10
realm
0
2k
Stuart Hall: How I got 2.3 Million App Downloads
realm
0
1.7k
James Majors: What the Swiftly Func?
realm
1
4.1k
Simina Pasat: Continuous everything for iOS apps
realm
0
560
Other Decks in Programming
See All in Programming
Ruby Function Composition
bkuhlmann
1
330
GitHub Actionsで泣かないためにやっておきたい設定 / Recommended GHA settings to avoid crying
pinkumohikan
3
490
Front-end application development, Symfony-style(s)
dunglas
2
1.9k
二郎系ラーメンのコールで学ぶ AST 解析
memory1994
PRO
7
1.6k
Changed Rules: Architectures with Lightweight Stores
manfredsteyer
PRO
0
230
Doctrine ORMでValue Objectを扱う方法4選 #phpstudy / 4 ways to handle Value Objects with Doctrine ORM
77web
4
110
SwiftUI Performance 不要なViewの再描画と更新を抑える
bigamitiongit
1
160
Elm 0.19.0 Changes
bkuhlmann
0
480
Rubyでたのしむクリエイティブコーディング/Enjoy Creative coding with Ruby
chobishiba
1
160
코틀린으로 멀티플랫폼 만들기
pangmoo
0
120
単体テストを書かない技術 #phpcon_odawara
o0h
PRO
25
7.8k
1인 개발자로 행복하게 살기 - GDG 송도 헬로월드 2024
benjaminkim
1
5.6k
Featured
See All Featured
Bash Introduction
62gerente
604
210k
4 Signs Your Business is Dying
shpigford
175
21k
GraphQLとの向き合い方2022年版
quramy
31
12k
Agile that works and the tools we love
rasmusluckow
324
20k
Code Reviewing Like a Champion
maltzj
513
39k
Typedesign – Prime Four
hannesfritz
36
2.1k
Large-scale JavaScript Application Architecture
addyosmani
503
110k
Building Adaptive Systems
keathley
30
1.8k
What's in a price? How to price your products and services
michaelherold
237
11k
Bootstrapping a Software Product
garrettdimon
PRO
301
110k
How GitHub Uses GitHub to Build GitHub
holman
468
290k
Fontdeck: Realign not Redesign
paulrobertlloyd
76
4.9k
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