开发者

Android 2.1 vs 2.2

开发者 https://www.devze.com 2023-03-29 00:40 出处:网络
I have been developing for Android 2.2+ for the majority of the year. But when I look at the \"List of Android Devices\" on wikipedia, I see a substantial number of Android 2.1 devices. A lot of these

I have been developing for Android 2.2+ for the majority of the year. But when I look at the "List of Android Devices" on wikipedia, I see a substantial number of Android 2.1 devices. A lot of these may have never received OTA updates and some were released not that long ago. I've seen the readily available statistics about Android 2.2 being the most widely used, but I can't help feel like I'm cutting a big audience out.

I've seen a few differences between 2.1 and 2.2 (like with TabWidgets) but if I just dropped my SDK down to 2.1 what differences should I be aware of?

Is this even less relevant now, thoughts and experience welcome, or li开发者_如何学JAVAnks to informative sources


As always, it depends on the specific features of your application. I don't want to talk you out of supporting 2.1. I'm certainly not an expert. But you have to weight how much work it is to make your application available to the last 20% percent of the market.

Although I like the idea of maintaining a lot of backward compatibility, I think it makes sense to support the "current and future market" more than spending a lot of effort to support older devices. Of course, if your application works well with older API levels that's great and you should obviously set it as such. Who knows, maybe adding support for 2.1 will take you less time than it took me to type this. :)

You can see up-to-date stats directly on the Android Platform Versions website.

I think the more interesting graph is the 2nd one that shows "number of Android devices that accessed Android Market" recently. (current one inlined here). So if you support 2.2 it looks like you're supporting over 75% of the market (and that number is only going to grow).

Android 2.1 vs 2.2

One other thing to watch out for is performance. In addition to features the pre-8 API doesn't support, older devices sometimes just don't have the performance of the newer ones. (Not always the case since there are dozens of devices.) One test device I used didn't support Live Wallpapers, not because of the API, but because the device just didn't have enough horsepower.


I'd definitely target 2.1 to get the largest audience. The changes you have to be aware of are not huge, but can definitely stick you if you don't catch them.

A couple of things:

  • showDialog(int) can't take a Bundle as an argument in 2.l. The 2.2 call is: showDialog(int, Bundle)
  • You use a different function to access the SD card (also note that the SD card paths are different in 2.1 and 2.2)

I suggest using the android dev's reference pages feature of filtering by version. It'll make coding for 2.1 much easier.


http://developer.android.com/sdk/android-2.2.html

Personally I think you should just use the lowest you can support without damaging your functionality, features or UX.

0

精彩评论

暂无评论...
验证码 换一张
取 消