This app is a demo for the "Work with the OS, not against it" section of the "Building Good Android Apps" talk at BJUG#9.
The purpose of this app is to demonstrate in a simple way how you can use features that the Android OS provides you with in order to create a better user experience. It does this by showing a simple ListView, allowing you to switch between four ListAdapters, each one having 10,000 items:
BadAdapteris what would be your first attempt at writing a list adpater. It's bad because it creates aViewobject (by inflating a layout file) for every list item, not taking advantage of the providedconvertView.GoodAdapteruses theconvertViewobject, thus greatly reducing the number of objects created by the adapter. This sensibly improves the performance of the app.AwesomeAdapterimplements a trick using thesetTag()andgetTag()methods present on theViewobject so that it can greatly reduce the number of calls tofindViewById(), which is pretty expensive.TwoToneAdaptershows that you don't need to throw these optimizations away when you're doing something more complicated, like having multiple view types in your adapter. All you need to do is implement a couple extra methods so that Android knows what your intentions are.
If you're feeling adventurous, playing with the code is pretty straightforward. Install the Android SDK (if you haven't done so already) and it should be a simple matter of File > Import > General > Existing Projects into Workspace.