20. 3 Main Things
- Who is your user
- Where he use it
- When he use
Don’t be selfish, be part of ecosystem
21. One design to rule them all
- Design for multiple screens first
- Same user experience across all device
- Don’t be afraid to
change
22. GAPPS - gmail, calendar,
google maps etc...
http://www.pttrns.com/
http://androidniceties.tumblr.com/
https://developer.android.com/design/patterns/index.html
https://developer.android.com/design/material/index.html
Follow the path, Luke
38. Don't do work that you don't
need to do.
Don't allocate memory if you can
avoid it.
39. OutOfMemory - Bitmap memory usage
Image 1080X1920pixels, 124KB .png compressed
Bitmap size = Width * Height * depth(4 bytes) = 8 MB!!!!
Reduce the size before loading it to the memory.
40.
41. OutOfMemory - Garbage collector
A large number of small allocations can also cause heap
fragmentation
10,000 references waiting to be collected by GC
42. OutOfMemory - Garbage collector
“To improve is to change; to be perfect is to change often.” – Winston Churchill
43. OutOfMemory - Garbage collector
Reuse of the same object
No short term temporary object for String
46. Memory overhead - Autoboxing
Object with just one int take 16 bytes at minimum
Object overhead (8 bytes ) + Overhead of dlmalloc(8 bytes) + data (n
bytes) = >16 bytes
47. Primitive Type vs Object
Integer (16 bytes) vs int(4 bytes)
Boolean(16 bytes) vs boolean(4 bytes)
or
bit-field(1 bit) //even better!
51. - Release memory when your activity no longer visible
- Don’t hold direct references. Use WeakReference
- Use inner static classes
- Stop all your handlers, threads in onStop callback
Memory Leak
57. Last words...
“An amazing journey starts outside of your comfort zone” - Liat Aaronson
2013 - Establishing Android Academy
2014 - Closing startup and joining Gett
2015 - Helping and Lecturing over the world