Android App Performance Tips
Lê Văn Giáp
Why ?Smooth
responsive
Why ?Keep battery
time
Coding tips Avoid Creating Unnecessary Objects Use Static Final For Constants Avoid Internal Getters/Setters Use Enhanced For Loop Syntax Avoid Using Floating-Point Create package Instead of private Inner
Classes
Read more at: http://developer.android.com/
Use Enhanced For Loop Syntax
UI tips Re-using layout with <include />
UI tips<merge/>
UI tips Loading views on demand <ViewStub/>
UI tipsSmooth scrolling ListView – (AsyncTask)
UI tips Smooth scrolling ListView – (ViewHolder)
…in getView(….)
UI tipsSmooth scrolling ListView
RecyclerView
RecyclerView.ViewHolderRecyclerView.Adapter
Instead of basic ListView
UI tips Smooth loading image
Lazy load
AsyncTask
File caching
UI tips Monitor, Tracking tool
Memory monitor
Allocatio tracker
Heap viewerSystrace
Advance tipsOptimizing Battery Life
Read more at developer.android.com
Reducing Network Battery DrainOptimizing for Doze and App Standby
Monitoring the Battery Level and Charging StateManipulating Broadcast Receivers On Demand