Diagnosing Layout Problems

Yesterday, a post came over the transom on the [android-developers] Google Group, citing a problem in getting a RelativeLayout to work properly as a row in a ListView. Since I screwed up my initial response to that post, I figured I’d document and write up a blow-by-blow account of the ...

Read More

Fancy ListViews Redux: 0.9 SDK and RatingBar

You may remember way back when (e.g., July 2008) when Building ‘Droids featured a six-post series on creating fancy ListView implementations, culminating in a CheckListView widget that could be used as a drop-in replacement for ListView. They’re ba-ack! Specifically, today, ...

Read More

0.9 SDK Tips #1: The Hidden Changes

This is the first in a series of blog posts to help those of you with M5 applications make the jump to the 0.9 SDK. Also, if you see a tutorial dated before mid-August, that tutorial is from M5, and so these blog posts may be useful to help you translate the tutorials to the... Read More

Fun with Fonts

Inevitably, you’ll get the question “hey, can we change this font?” when doing application development. The answer depends on what fonts come with the platform, whether you can add other fonts, and how to apply them to the widget or whatever needs the font change. Android is ...

Read More

Flipping Your Views

Let’s face it: phones are small. Even if you have a phone with excellent screen resolution, the physical screen size is still rarely over 3″x5″, since most people want phones that can fit in a pocket, purse, pouch, or poncho. This means your Android activities can only display ...

Read More

Adding Tabs Dynamically

The TabWidget in Android is set up to allow you to easily define tabs at compile time. However, sometimes, you want to add tabs to your activity during runtime. For example, imagine an email client where individual emails get opened in their own tab, for easy toggling between messages. In this ...

Read More

Scripting Your Android Device

One of the issues that arose when Apple released the iPhone SDK earlier this year was the restriction on language interpreters: No interpreted code may be downloaded and used in an Application except for code that is interpreted and run by Apple’s Published APIs and builtin ...

Read More

Fancy ListViews, Part Six: Custom Widget

In this, the last and longest of our Fancy ListView posts, we’ll cover what it takes to wrap up the logic from the ChecklistDemo from a previous post and turn it into a reusable CheckListView that can serve as a drop-in replacement for ListView. Before I go much further, though, please ...

Read More

Fancy ListViews, Part Five

In one of our earlier posts in this Fancy ListViews series, Michal asked “could you make also a short tutorial on changing the background image and text color of the selection in ListView?” Of course, we at AndroidGuys love fan mail! So, let’s talk about changing the way ...

Read More

Fancy ListViews, Part Four

In our last episode, we took a closer look at the ViewHolder/ViewWrapper pattern for making ListViews that much more efficient to render. Today, we switch gears, and take a look at having interactive elements in ListView rows. Specifically, we’ll look at a crude implementation of a ...

Read More

Fancy ListViews, Part Three

In our last episode, we saw how we could save processing time — and, hence, battery life — by recycling existing row views in our fancy lists, simply by checking and reusing the convertView parameter passed into our getView(). In his comment to this series’ initial post, ...

Read More

Fancy ListViews, Part Two

In our last episode, we saw how to create Android ListViews that contain more than just a simple list of strings. In particular, we saw the ultimate form of customization: subclassing an Adapter class, overriding getView(), and returning our own View for each row, perhaps based on our own ...

Read More

Fancy ListViews, Part One

The classic Android ListView is a plain list of text — solid but uninspiring. This is the first in a series of posts where we will see how to create a ListView with a bit more pizazz. Today, in particular, we will see two techniques for creating a ListView whose rows contain icons, in ...

Read More

Inflation is a Good Thing

Before diving into the topic of creating fancy lists in Android, we need to take a short detour into some background material. If you have written activities for Android, you are used to calling setContentView() with the resource ID of some XML layout you specified. Let’s take a peek at ...

Read More

Gettin’ On The (Message) Bus, Part Two

In our last episode, we discussed how the Android Intent systems functions, in effect, like a message bus, and how one can set up an IntentReceiver to serve as a consumer of bus messages. Today, let’s complete the picture, creating both a message consumer and producer, as two separate ...

Read More