Sunday, May 2, 2010

Regular update, May 1st

Videos watched & notes taken + reading materials

Androidology - Architecture Overview [ link ]

Decompose the app into application building blocks, which include
  • Activities
  • BroadcastReceivers (triggered by any event)
  • Services
  • ContentProviders
Androidology - Application Lifecycle [ link ]
Androidology - APIs [ link ]

Google I/O 2009 - ...Make your Android UI Fast and Efficient [ link ] (good one!)
  • reuse views with Recycler for higher fps
  • prescale bitmaps with
    image = Bitmap.createPrescaledBitmap(image, view.getWidth(), view.getHeight(), true);
  • remove backgrounds from views, which fill parents full width and height (eg if you have a map, you don't see the background, which is still rendered) [00:17:23]
  • invalidate() to redraw a view is inefficient, use invalidate(rect) or invalidate(left, top, right, bottom)
  • fewer (views) is better ;) (try to get rid of views that have only one child, too: HierarchyViewer)
  • use compound drawables (eg TextView instead of ImageView+TextView)
  • use ViewStub to inflate part of the UI on demand (eg for part of the UI that for majority of the time is invisible) [00:35:20]
  • use merge tag to reuse UI hierarchy elements
  • RelativeLayout instead of embedding linear layouts; hard to use, but it pays off
  • use custom views, custom layouts instead of overusing numerous views
  • garbage collection kicks in for 100~500ms, stops threads (so allocate little memory, or even none :d)
  • do not allocate memory in those time-critical points:

  • SoftReferences != WeakReferences [00:51:17]
  • soft references are good for caching objects
  • weak references help avoid mem leaks
  • pool of objects (frameworks/base/core/java/android/util, find
Resources: (includes examples of relative layouts) (about good quality UI) (about good quality UI)

Google I/O 2009 -...Interaction & Visual Design with Android [ link ]

  • ongoing notification (eg for downloading a file) vs event notification
  • uninvasive notification - Toast ;D
  • use Marquee to animate strings (eg for long filenames) [00:38:10]
  • built-in scalable pixel units typography [00:38:38] for font scaling (eg on the files list)

Reading materials

No comments:

Post a Comment