Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Developing for Android

Realm
November 30, 2015

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

More Decks by Realm

Other Decks in Programming

Transcript

  1. Romain Guy Chet Haase Developing for Android +RomainGuy, @romainguy +ChetHaase,

    @chethaase Development for Developers by Developers Managers
  2. • Larger application heaps lead to • More task thrashing

    • Slower allocations • Slower collections • More garbage collector activity Memory == Performance
  3. ART

  4. • Your device is faster than your users’ • And

    has more memory • Moore’s Law does not always apply Low-End Devices
  5. • You have 16ms per frame • To do everything

    • Consistency is good Smooth Frame Rate
  6. Server-Land Moving, compacting collector CPU: Memory: very very fast Basically

    ∞ Java programming language Server runtime Server
  7. Android No compaction Idle compaction CPU: wayyyy slower Memory: 512MB

    - 2GB Java programming language ART Mobile Dalvik
  8. • 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
  9. • 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
  10. • Don’t assume anything about the network • Develop for

    low-end networks • And test for them, too Network quality
  11. • 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
  12. Romain Guy Chet Haase Developing for Android +RomainGuy, @romainguy +ChetHaase,

    @chethaase Development for Developers by Developers Q & A