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

Gettin’ On The (Message) Bus, Part One

The message bus is a tried-and-true model in application development. Whether it is the humble Win32 message loop or full-fledged publish/subscribe message-oriented middleware solution, software components have long been publishing messages that other components receive, either by explicitly ...

Read More

Handling Multiple Resource Sets, Part Two

In the last episode of “Building ‘Droids”, we covered how to handle a simple, one-criterion choice between two resource sets: whether we show English or Spanish strings. In that case, having two res/ subdirectories (res/values-en/ and res/values-es/), each with their own set ...

Read More

Handling Multiple Resource Sets, Part One

Welcome to the new “Building ‘Droids” section of AndroidGuys! This column looks at Android from the developer’s perspective, poking around dusty corners of the Android SDK, and showing how you can create interesting and effective Android applications. Today, we’ll talk about how to ...

Read More