Droid con

678 views
636 views

Published on

Some things I learnt while developing on the Android

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
678
On SlideShare
0
From Embeds
0
Number of Embeds
6
Actions
Shares
0
Downloads
3
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Droid con

  1. 1. Things I wish I knew Hard Earned Android Programming ExperiencesKashif
  2. 2. Directi• We do exciting work • Mobile • Desktop • Server • Internet scale• We have a fun CEO• We even have stall Join Directi
  3. 3. Talk.to Communication software ● Android, iPhone, BB ● Desktop, Web ● In person● All services ● FB, Gmail, Yahoo, MSN, etc...● All channels ● SMS ● VOIP ● Video ● Chat
  4. 4. Use Native1
  5. 5. Use Native● Webstuff and HTML5 sucks for mobile dev ● Not complete ● Not performant ● Lots of corner cases ● Typically poor code quality ● http://slidesha.re/g68sCY
  6. 6. Debugging ++ 2
  7. 7. Debugging ++● Use DDMS ● Memory Leaks ● Thread Leaks ● Dominator Graph – MAT not JHat ● TraceView startMethodTracing – 8 MB limit● Application Crash Report for Android (ACRA) ● http://code.google.com/p/acra/ ● Send yourself a crash report – automatically ● Easy, awesome, indispensible● Debug Logs – ACRA or logcat
  8. 8. Always remember Memory 3
  9. 9. Always remember Memory● Dont cache too much● Statics can screw with memory● Soft References● Garbage Collection (tool for analyzing rate)● Reuse – unlike OOP Compilers● Release on LowMemory you may not die
  10. 10. Services get collected 4
  11. 11. Services get collected● You dont need a service● Android kills you● Users kill you● Use C2DM and AlarmManager
  12. 12. Focus on the right devices 5
  13. 13. Focus on the right devices● Foolish feedback loop● Low End Devices● All screen sizes ● Relative Layouts● You dont have to support everything
  14. 14. Everything is customizable 6
  15. 15. Everything is customizable● ListItems,● Tabs,● Buttons,● Title Bars,● Edit Text,● Dropdowns,● Keyboards,● Checkbox,● DialogBox,● Radiobuttons,● Life...
  16. 16. The database is slow 7
  17. 17. The database is slow● Batch Reads ● Dont read single values● Batch Writes ● not really – but single compile ● DatabaseUtils.InsertHelper● UI Interaction underway – defer DB● Worry about schema migration
  18. 18. Networking eats battery 8
  19. 19. Networking eats battery● Raj VijayKumar at Qualcomm ● Android radio set to dormant after 10 seconds● Multiplex sockets● Prefer native TCP● Use Push
  20. 20. Monitoring etc... 9
  21. 21. Monitoring etc...● We used Google Analytics and that sucked● Flurry is cool ● SDK ● Other demographic data ● Events ● Customized for mobile at all levels● MonkeyRunner
  22. 22. Questions? kashifrazzaqui@ kashif.ra@directi.com

×