Surprisingly this can be easier than you think! Read on to find out how.
![]() | ![]() |
| Before | After |
The easy way:
If you're lucky, it can be as easy as changing one line, and rebuilding with the latest sdk.
Provided you don't have too much custom styling applied, try adding the following to your AndroidManifest.xml:
Provided you don't have too much custom styling applied, try adding the following to your AndroidManifest.xml:
<uses-sdk
android:targetsdkversion="15">
</uses-sdk>
If you leave the minSdkVersion as is, it should still work as always on pre ICS devices, but automatically apply 'Holo' theme on devices running 4.0.
If you're unlucky / things to watch out for:
Getting a successful build after the above change is the ideal scenario. If you're unlucky, your app may require a little more work to port.
As an example, I've recently ported the open source market app 'Kitchen Timer'. This presented two problems:
1. The NumberPickers:
The current version of Kitchen Timer uses NumberPicker widgets, which were not officially available pre-ICS. These are now available since api 11, but in order to get these to update their style, I had to swap out each use of the custom NumberPicker instances and replace them with android.widget.NumberPicker, as well as update a couple of api calls.
An unfortunate effect of a change like this is that the app is now no longer compatible with pre-ICS.
2. The ActionBar
As I've quickly found out, there are no option menus in ICS, which have been since replaced by either a items on an ActionBar, or an overflow button on the button bar for backwards compatibility reasons.
This is fine, except that the ActionBar can take up layout space that your original design may not have accounted for.
I ended up removing two buttons from the Kitchen Timer to allow all three timers to be controlled with one button.
Summary:
That's about it, if you're lucky, just increasing your targetSdkVersion and rebuilding with the latest sdk will be enough to instantly modernise your app.
Hopefully by having read the above you can save time by jumping over some of the more common pitfalls associated with this process.
Extra Reading:
You can also look at taking ports further with some of Jake Wharton's fantastic backwards compatible libraries such as ActionBarSherlock, and ViewPagerIndicator.
Updated KitchenTimer source: https://github.com/brk3/kitchentimer
Market Link: https://market.android.com/details?id=com.bourke.kitchentimer
If you're unlucky / things to watch out for:
Getting a successful build after the above change is the ideal scenario. If you're unlucky, your app may require a little more work to port.
As an example, I've recently ported the open source market app 'Kitchen Timer'. This presented two problems:
1. The NumberPickers:
The current version of Kitchen Timer uses NumberPicker widgets, which were not officially available pre-ICS. These are now available since api 11, but in order to get these to update their style, I had to swap out each use of the custom NumberPicker instances and replace them with android.widget.NumberPicker, as well as update a couple of api calls.
An unfortunate effect of a change like this is that the app is now no longer compatible with pre-ICS.
2. The ActionBar
As I've quickly found out, there are no option menus in ICS, which have been since replaced by either a items on an ActionBar, or an overflow button on the button bar for backwards compatibility reasons.
This is fine, except that the ActionBar can take up layout space that your original design may not have accounted for.
I ended up removing two buttons from the Kitchen Timer to allow all three timers to be controlled with one button.
Summary:
That's about it, if you're lucky, just increasing your targetSdkVersion and rebuilding with the latest sdk will be enough to instantly modernise your app.
Hopefully by having read the above you can save time by jumping over some of the more common pitfalls associated with this process.
Extra Reading:
You can also look at taking ports further with some of Jake Wharton's fantastic backwards compatible libraries such as ActionBarSherlock, and ViewPagerIndicator.
Updated KitchenTimer source: https://github.com/brk3/kitchentimer
Market Link: https://market.android.com/details?id=com.bourke.kitchentimer

