Scott Main | 7736f96 | 2011-12-15 15:40:25 -0800 | [diff] [blame] | 1 | page.title=Improving Layout Performance |
Joe Fernandez | 33baa5a | 2013-11-14 11:41:19 -0800 | [diff] [blame] | 2 | page.tags=include,merge,viewstub,listview |
Scott Main | 569ed22 | 2011-12-02 13:49:44 -0800 | [diff] [blame] | 3 | |
| 4 | trainingnavtop=true |
| 5 | startpage=true |
| 6 | next.title=Optimizing Layout |
| 7 | next.link=optimizing-layout.html |
| 8 | |
| 9 | @jd:body |
| 10 | |
| 11 | <div id="tb-wrapper"> |
| 12 | <div id="tb"> |
| 13 | |
| 14 | <!-- Required platform, tools, add-ons, devices, knowledge, etc. --> |
| 15 | <h2>Dependencies and prerequisites</h2> |
| 16 | <ul> |
| 17 | <li>Android 1.5 (API Level 3) or higher</li> |
| 18 | </ul> |
| 19 | |
| 20 | <!-- related docs (NOT javadocs) --> |
| 21 | <h2>You should also read</h2> |
| 22 | <ul> |
| 23 | <li><a href="{@docRoot}guide/topics/ui/declaring-layout.html">XML Layouts</a></li> |
| 24 | </ul> |
| 25 | |
| 26 | </div> |
| 27 | </div> |
| 28 | |
Scott Main | 64fedb7 | 2013-11-12 09:12:38 -0800 | [diff] [blame] | 29 | <a class="notice-developers-video wide" href="http://www.youtube.com/watch?v=-FUw8HMbmBQ"> |
| 30 | <div> |
| 31 | <h3>Video</h3> |
| 32 | <p>DevBytes: Optimising Layouts with Hierarchy Viewer</p> |
| 33 | </div> |
| 34 | </a> |
| 35 | |
Scott Main | 569ed22 | 2011-12-02 13:49:44 -0800 | [diff] [blame] | 36 | |
| 37 | |
| 38 | <p>Layouts are a key part of Android applications that directly affect the user experience. If |
| 39 | implemented poorly, your layout can lead to a memory hungry application with slow UIs. The Android |
| 40 | SDK includes tools to help you identify problems in your layout performance, which when combined the |
| 41 | lessons here, you will be able to implement smooth scrolling interfaces with a minimum memory |
| 42 | footprint.</p> |
| 43 | |
| 44 | |
| 45 | |
| 46 | <h2>Lessons</h2> |
| 47 | |
| 48 | <dl> |
| 49 | <dt><b><a href="optimizing-layout.html">Optimizing Layout Hierarchies</a></b></dt> |
| 50 | <dd>In the same way a complex web page can slow down load time, your layout hierarchy |
| 51 | if too complex can also cause performance problems. This lesson shows how you can use SDK tools |
| 52 | to inspect your layout and discover performance bottlenecks.</dd> |
| 53 | <dt><b><a href="reusing-layouts.html">Re-using Layouts with <include/></a></b></dt> |
| 54 | <dd>If your application UI repeats certain layout constructs in multiple places, this lesson |
| 55 | shows you how to create efficient, re-usable layout constructs, then include them in the appropriate |
| 56 | UI layouts.</dd> |
| 57 | <dt><b><a href="loading-ondemand.html">Loading Views On Demand</a></b></dt> |
| 58 | <dd>Beyond simply including one layout component within another layout, you might want to |
| 59 | make the included layout visible only when it's needed, sometime after the activity is running. |
| 60 | This lesson shows how you can improve your layout's initialization performance by loading |
| 61 | portions of your layout on demand.</dd> |
| 62 | <dt><b><a href="smooth-scrolling.html">Making ListView Scrolling Smooth</a></b></dt> |
| 63 | <dd>If you've built an instance of {@link android.widget.ListView} that contains complex or |
| 64 | data-heavy content in each list item, the scroll performance of the list might suffer. This |
| 65 | lesson provides some tips about how you can make your scrolling performance more smooth.</dd> |
Joe Fernandez | 33baa5a | 2013-11-14 11:41:19 -0800 | [diff] [blame] | 66 | </dl> |