views:

80

answers:

3

I've created a few applications that have been targetted against 2.2

I'm thinking to invest in a cheap handset to try these out (thus far only used emulator). The handset I want is running verion 2.1 of Android.

From a code point of a view, is there any major changes between 2.1 and 2.2 that could potentially cause me an issue?

I understand there would be issues if I was trying to deploy to a 1.x handset (such as People/ContractsContact etc) but I can't see anything to say a 2.2 app would fail on a 2.1 environment

(I could try to change emulator target, but curious to know from others with actual handsets)

Thanks

+1  A: 

You could just target your app to 2.1 if you don't need any of the new APIs provided with 2.2. That way you can be sure that it will run on 2.1 and 2.2. If you, on the other hand, need some of the new APIs it will not work correctly on 2.1.

You can se what's new in 2.2 here: http://developer.android.com/sdk/android-2.2.html

Juhani
+2  A: 

Here's the page that might be useful to you: http://developer.android.com/sdk/api_diff/8/changes.html

You can cross-check all your packages and methods used to the differences list.

Like Juhani said, if your app uses any of the new APIs, then that would mean a high possibility of your encountering problems.

Shane Oliver
A: 

For guaranteed compatibility, you should just set your target version to 2.1 and recompile it to see what fails. If you are using a 2.2-only API, this will show you what it is. Then, if you really want to use it, you can reset the target version to 2.2 and code up a fallback behavior for "method not found" in 2.1.

Outside of the documented API, the biggest difference for most developers comes for those using a common but unsupported interface. If you are trying to invoke the calendar, you'll find that it stops working because the old intent "com.android.calendar/com.android.calendar.LaunchActivity" has been replaced by "com.google.android.calendar/com.android.calendar.LaunchActivity". (This is for stock android. Various phone/hardware vendors have other alternate apps/intents, just to keep you on your toes.)

Of course, this is only a problem if you are using undocumented, unsupported interfaces, which you shouldn't be doing. However, this has probably been the number one source of "broken by FroYo" apps.

beekeeper