Top Banner
Android App Performance Tips Lê Văn Giáp
15

Android App Performance Tips

Feb 10, 2017

Download

Mobile

Giap Le Van
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Android App Performance Tips

Android App Performance Tips

Lê Văn Giáp

Page 2: Android App Performance Tips

Why ?Smooth

responsive

Page 3: Android App Performance Tips

Why ?Keep battery

time

Page 4: Android App Performance Tips

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/

Page 5: Android App Performance Tips

Use Enhanced For Loop Syntax

Page 6: Android App Performance Tips

UI tips Re-using layout with <include />

Page 7: Android App Performance Tips

UI tips<merge/>

Page 8: Android App Performance Tips

UI tips Loading views on demand <ViewStub/>

Page 9: Android App Performance Tips

UI tipsSmooth scrolling ListView – (AsyncTask)

Page 10: Android App Performance Tips

UI tips Smooth scrolling ListView – (ViewHolder)

…in getView(….)

Page 11: Android App Performance Tips

UI tipsSmooth scrolling ListView

RecyclerView

RecyclerView.ViewHolderRecyclerView.Adapter

Instead of basic ListView

Page 12: Android App Performance Tips

UI tips Smooth loading image

Lazy load

AsyncTask

File caching

Page 13: Android App Performance Tips

UI tips Monitor, Tracking tool

Memory monitor

Allocatio tracker

Heap viewerSystrace