Preliminary Thoughts on the Android 2.3 SDK
OK, I haven’t even downloaded it yet, but working off of the new docs, here are some early things for Android developers to chew on.
OMG OMG OMG-Level Stuff
In any Android release, one of the first things you should
head to is the API differences
report, specifically the
items that were removed. These point out places where your
code will fail to compile (or crash with a VerifyError
at
runtime). Android 2.3 has more than I expected here, though
they all seem to be in dalvik.system
and Apache Harmony
classes. Also, setPersistent()
on Activity
was deprecated,
but I suspect relatively few apps tried using it.
You also should seriously consider firing up an xlargeScreens
emulator, give it a whirl, and then adjust your
<supports-screens>
element to suit. Al Sutton believes that
lacking this will mean your app will not work (or will be
filtered out) for larger Android notebooks (e.g., 10”).
Anyone using alternative means for accessing the front-facing camera (e.g., SDK add-on for HTC EVO 4G) should start gearing up to use the official Android 2.3 support. It remains to be seen if the alternative means will be supported on those devices if/when they get upgraded to 2.3. Similarly, it remains to be seen if the Galaxy S alternative approach will work on the Nexus S, which ships with Android 2.3 out of the box.
Outside of these, nothing leaps out at me that will cause immediate problems for existing code bases. Of course, there are usually a few more hiccups lurking about that will come to light in the coming weeks.
Low-Hanging Fruit
If you have rolled your own large-file download support, take
a look at the new DownloadManager
system service and see if
you can dump a whole hunk of icky-to-maintain code as part of
it.
StrictMode
seems interesting for helping to identify slow
operations that you are performing on the main application
thread.
Potential Issues
While the SIP supports seems interesting, note that it is
“available on devices at the discretion of the manufacturer
and associated carrier”. Which means certain morons will
leverage this flexibility. The good news is that there is
a <uses-feature>
element you can use to help keep your apps
away from SIP-impaired devices.
Curiosities
The java.sql
package got seriously overhauled. I do not
know if this is merely a side-effect of adopting some newer
Harmony code, or if this is an indication of where Google
would like database development to go.
There is a new WorkSource
concept that somehow ties
into locations, wake locks, and battery reporting. I haven’t
worked through all the dirty details just yet.
PackageManager
has a getActivityLogo()
method, independent
of the getActivityIcon()
method. This, of course, begs
the question: what exactly is an activity logo? I do not see
a new attribute for a logo for either <application>
or
<activity>
in the manifest. I seriously hope this is not
somehow tied to the Android Market exclusively.
The NDK got all sorts of new toys, plus Android 2.3 got other features with an eye towards gaming (e.g., concurrent GC). A Playstation phone with Android 2.3 is rumored. Coincidence? I think not.
So, When Are the Books Getting Updated?
I’m guessing this will be a relatively popular question, given that you’re reading my blog. :-)
Updating the books for a new Android release involves three major steps:
- Making sure all the sample code still runs (and, in the case of these updates, sprucing all of them up to run nicely on tablets)
- Adding in some key new material, particularly where the new release extended areas already covered in the books
- Errata fixes and other general improvements
In the case of The Busy Coder’s Guide to Android Development,
I am expecting to add coverage of DownloadManager
, StrictMode
,
extra-large screens, new location options, and some other
miscellany. I am also planning on blowing up all the
introductory material (pretty much everything before the
Now
sample project) and rewriting most of it.
The Busy Coder’s Guide to Advanced Android Development will get updates for the new sensors and front-facing camera stuff. I may fast-track coverage of the new SIP APIs, simply because I’d really love to see one or more killer SIP apps to help raise the ante in this space.
Android Programming Tutorials mostly should just need testing on 2.3, plus perhaps adjustments to make the apps more tablet-friendly. Android Beyond Java will need some updates in the NDK chapters.
That’s going to take a couple of months, as I have some other stuff that I am working on besides the books. With a pinch o’ luck, I will get The Busy Coder’s Guide to Android Development updates out before year’s end, with the balance showing up in January sometime.