Category Archives: android tutorials

Tutorials that have to do with the Android operating system powering your favourite smartphone or tablet.

June 3, 2011

Proper layout gravity for the Gallery widget

The gallery widget in Android is the closest match you can find for an horizontal ListView. However, this widget does not support properly the gravity attribute to specify whether we would like the first selected item to be centered (as in the default behaviour) or aligned to the left (currently not possible). The short code snippet below allows just to do that.

January 20, 2011

Sharing code between “full” and “lite” versions of an Android application

When designing an application for Android or any other device, we often come up with the desire to release a commercial version built on top of the free version. This is our take on how one could setup his projects to share common code between a full and a lite version of the same application.

October 29, 2010

Custom ListView with ability to check items

Android’s ListView is a useful component that can allow the user to check items natively. Two SDK samples (List 10 and List 11) show you how to accomplish this using simple CheckedTextView widgets to represent the rows. However, when you want to represent the rows using a custom layout, you’ll need some time to figure out why you items do not get checked.Well, by the end of this tutorial you should know how to do it.