Grokking Android

Getting Down to the Nitty Gritty of Android Development

Archive for the “Android” category:

Adding ActionViews to Your ActionBar

By

As you have seen in the previous tutorials about ActionBarSherlock and the ActionBar, you can add action items easily and they show up either in the ActionBar itself or in the overflow menu. But so far all you could add were normal action items. And those consisted either of icons, of text or of a […]  Continue Reading  “Adding ActionViews to Your ActionBar”

Adding ActionBar Items From Within Your Fragments

By

This tutorial shows you how to add action items to the ActionBar from within your Fragments and how to disable or enable action items depending on the state of your fragment. All code works with the stock Android ActionBar object as well as with ActionBarSherlock. Why do you want to add action items? In a […]  Continue Reading  “Adding ActionBar Items From Within Your Fragments”

ActionBarSherlock: Up Navigation

By

In this tutorial I am going to cover some initial thoughts on navigation. The ActionBar allows multiple navigation modes. In this post I state which navigation modes exist, how to get to the ActionBar object in the first place and how to deal with the so-called up navigation. Less code than in the previous parts […]  Continue Reading  “ActionBarSherlock: Up Navigation”

Adding ActionBarSherlock to Your Project

By

In my last post I had a look at how to set up a Fragment project that uses a master detail view. This week I am going to show you the necessary steps to make this project use the ActionBarSherlock library. ActionBarSherlock is a library by Jake Wharton, that enables you to use action bars […]  Continue Reading  “Adding ActionBarSherlock to Your Project”

Getting Started With Fragments and the Support Library

By

Fragments are modular building blocks for creating a responsive Android UI. They help you to target different devices and screen sizes while at the same time avoiding code duplication. This post starts with the Android Developers Tools generating a project for you. I then explain some of the generated code and will show you how […]  Continue Reading  “Getting Started With Fragments and the Support Library”

Android: How to Use Two Data Sources in ListViews?

By

Sometimes in our apps we have the need to link to data of other sources. You have a database of your own for your app, but some records also point to the MediaStore content provider to calendar entries or to contacts. For all detail pages this is not much of a problem. You get the […]  Continue Reading  “Android: How to Use Two Data Sources in ListViews?”

Use Android’s ContentObserver in Your Code to Listen to Data Changes

By

When you are using a content provider as a client, chances are that you want to know whenever the data changes. That’s what Android’s class ContentObserver is for. To use the ContentObserver you have to take two steps: Implement a subclass of ContentObserver Register your content observer to listen for changes Implement a subclass of […]  Continue Reading  “Use Android’s ContentObserver in Your Code to Listen to Data Changes”

What You Need to Know About the Intents of Android’s Calendar App

By

When your app needs to access calendar data you have to choose whether to use the CalendarContract content provider or whether to use Intents to start specific Activities of the Calendar app. This post covers the intents offered by the official Calendar app. While with using Intents your possibilities are limited compared to those of […]  Continue Reading  “What You Need to Know About the Intents of Android’s Calendar App”

Half a Year of Blogging About Android Development

By

Exactly six months ago I published my “Hello World” post. And one week later my first post with serious content followed: Android: Checking Connectivity. Over the last half year I have continuously blogged and there were only two weeks in which I didn’t publish any posts. According my general feeling my blog progresses nicely. And […]  Continue Reading  “Half a Year of Blogging About Android Development”

iCal’s Recurrence Rule and Duration Formats

By

If you create repeating events in Android using the CalendarContract content provider, the fields for recurrence rules (RRULE) and durations (DURATION) follow the iCal format (RFC 5545). Here I cover the basics of these formats to create valid field values. This post is somewhat of an oddity on this blog as most of its content […]  Continue Reading  “iCal’s Recurrence Rule and Duration Formats”