Our current favourite book is Beginning Android Application Development (Wrox Programmer to Programmer) by Wei-Meng Lee.
This book is aimed at those who are already comfortable with programming, but want to quickly get up to speed with developing for Android.
Beginning Android Application Development:
- Explains what an activity is and reviews its lifecycle
- Zeroes in on how to customize activities by applying styles and themes
- Looks at the components of a screen, including LinearLayout, AbsoluteLayout, and RelativeLayout, among others
- Details ways to adapt to different screen sizes and adjust display orientation
- Reviews the variety of views such as TextView, ProgressBar, TimePicker, and more
- Covers SMS messaging and networking
- Walks you through how to create an Android Service and interact with it
- Pares down the most essential steps for publishing Android applications
All in all the book is a really good read, and will probably sit around as a reference once you have read through it.
The only downside is, as with all fast moving industries, the book is likely to become out of date fairly quickly.
The code below shows how to create a class that reads an XML preference definition, and turns it into a usable preferences screen. This functionality is built into Android, and whilst it does not cater for absolutely every case, for the majority of preferences, it should be a good starting point.
import android.os.Bundle;
import android.preference.PreferenceActivity;
public class Preferences extends PreferenceActivity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
addPreferencesFromResource(R.xml.preferences);
}
}Once you have this class, you will need to register it as an activity in AndroidManifest.xml
<activity android:name="Preferences"></activity>
is all that is required.
The next thing you need to do is to create an xml file under res/xml in the project. For the class above, it should be named preferences.xml, although if you change it in the java code above, you should use the same name for the actual file.
This actually permits having multiple xml preferences files, that can be called from different points in the application, whilst only having one class to handle both (or more cases).
The structure of the xml file is relatively straightforward, and I have provided a brief example below.
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"> <PreferenceCategory android:title="Category Name" android:summary="Brief summary of category"> <ListPreference android:key="settingName" android:title="Main text for option" android:summary="sub title for option" android:entries="@array/someArrayForDisplayInList" android:entryValues="@array/anotherArrayForActualValues" android:dialogTitle="Name of the dialog that pops up" /> <PreferenceScreen android:title="Main name of sub screen" android:summary="Summary of screen"> <CheckBoxPreference android:key="settingName" android:title="Main Title of Preference" android:summary="A brief summary of the option/setting" /> </PreferenceScreen> </PreferenceCategory> </PreferenceScreen>
There is much more to the xml format than that, but you can see an example of the xml that is available at http://developer.android.com/resources/samples/ApiDemos/res/xml/preferences.html
The only remaining thing to do is to insert the following code where you want to show the preferences
startActivity(new Intent(this, Preferences.class));
Hopefully this can help someone who wants to quickly add preferences/settings to an app they are writing.
Links
The main API page for preferences @ android.com
We recently released a version of QuickTodo that is supported by ads. This post is a summary of what we’ve learned from releasing an ad-supported version.
Firstly, a summary of the ad revenue and download stats. The app has been downloaded approximately 800 times, of these around 343 are still active installs (42%). The app was released just over a month ago, and has been updated several times during the last month.
The impressions figures show an increase in impressions each time the app was updated, which quickly dropped back down to the previous levels, indicating that people tend to play about with the app a lot during the first few days, but that usage settles down after that.
Ad revenue over the period is a little over $4.00, which is not high for the number of installs, in my opinion. This equates to around ten cents per day the app has been released. Clickthrough rates have been around the 0.3% mark, which doesn’t compare favourably with the figures that other developers have posted.
Ads are shown on the folder view, and the todo list view, but not on the todo editing view. This suggests to me that the users have been ignoring the ads that appear on those two views, in order to concentrate on actually using the app. That would not be unexpected, given the nature of the app.
Revenue figures seem to fluctuate quite wildly, with some days showing no ad revenue, and others showing a marked increase over the average, indicating that it is quite likely that the app is used periodically, but perhaps not on a daily basis.
On the whole, the summary is that ads on the Android platform are only of benefit when you have a large number of impressions that will smooth out the revenue, and provide sufficient income to make it actually worthwhile. The figures equate to one more sale of the paid version of the app per month. This would no doubt be different if the app had managed to get a larger number of downloads, which could be achieved by more aggressive marketing for the app.
As can be seen from the attached screenshot, the folders now show how many items are held within. This allows you to see at a glance, if there are any items in a folder, or whether the folder can be ignored.
Both the Ad-supported and paid-for versions have received this Christmas update.
As usual QuickTodo can be found on the Android Market.
The code below is an example of how to create a BroadcastReceiver class in Android that is notified when the system is booted. In addition to the code below, you’ll need to add the receiver to your AndroidManifest.xml file, as well as add the relevant permissions to the same file.
package <packageName>;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
public class BootHelper extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
if(Intent.ACTION_BOOT_COMPLETED.equals(intent.getAction())) {
// do your thing here
}
}
}You’ll need to make the following changes to your manifest file in order to allow the broadcasted intent to reach you.
<receiver android:name=".BootHelper"> <intent-filter> <action android:name="android.intent.action.BOOT_COMPLETED"></action> </intent-filter> </receiver>
The above code needs to be put inside the <application> tag.
Finally, you will need to add the permission to receive the BOOT_COMPLETED intent when it is fired. The code below needs to be put inside the <manifest> tag, but outside of the <application> tag.
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
Now when you launch the application on an emulator, or a real phone, it should execute the code in the onReceive method. As this runs on boot you should probably keep the amount of processing to a minimum, in order to not slow the system down.
Note that you should only use this if it is necessary for your Application to do some processing when the OS is booted. For example, this is used in QuickTodo to ensure that overdue items continue to be notified, even when the device is rebooted.

Download QuickTodo
An ad-supported version of QuickTodo is now available on Android Market.
To download, simply scan the barcode on the right.
QuickTodo is the easy way to manage your tasks.
Use due dates, priorities and repeating tasks to organise and keep on top of everything.
With drag and drop, you can quickly reorder your lists.
Features:
- Repeating Tasks
- Priorities
- Multiple Lists
- Drag and Drop
- Notifications
- Search
We are pleased to announce that QuickTodo 3.2 is now available on the Android Market.
Changelog for 3.2 is below.
v3.2
- Fixed bug with slow reordering using drag and drop
- Experimental features, including date picker, consolidated notifications and more.
- Small UI tweaks
A few screenshots are below
Please let us know in the comments below what features you would like to see added to QuickTodo.
Currently there is development work going on around improving the QuickTodo app.
There are three main threads of development:
1. Performance optimisation.
The code that handles the drag and drop is inefficient, and so needs to be refactored to handle larger data sets.
2. Notifications.
Notifications is getting an overhaul, to allow for summary notifications such as “3 items overdue”. The backend work to support the new notification system is underway.
3. Re-architecting the code to support multi-level lists.
This will allow the folder structure to be nested, allowing lists within lists. Currently the development is focused around getting the back end code in a state where this can be supported.
After this is complete, the UI will be revamped to allow folders to be created within folders.
Categories



