My research shows that Android 2.2 & 2.3 have the loin share of the market. But when developing an app should I keep the API level of the app 2.1 or go with 2.2+?

What factors are usually taken into consideration?

有帮助吗?

解决方案

I use 2.1 (API 7) as target, and 1.6 (API 4) as min version.

This covers most of the Android devices in use today.

If I need to use some (optional)functionality from 2.2 or 2.3 I use it with reflection.

Here is example:

    // try to override the transition animation
    if (VERSION.SDK_INT > android.os.Build.VERSION_CODES.DONUT) {
      try {
        Method method = getClass().getMethod("overridePendingTransition",
            new Class[]{int.class, int.class});
        method.invoke(this, 0, 0);
      } catch (Throwable e) {
        // can not override transition animation, so do nothing
      }
    }

其他提示

My answer is simple: start with SDK4 (Android 1.6), earlier versions lacks several important features (most notably screen sizes handling) and accumulates number unfixed bugs. Then check, if your app requires newer Android release features - like cloud-to-device notifications or barometer support.

Try not cutting out too much users at release date, Android Platform Stats will help you: http://developer.android.com/resources/dashboard/platform-versions.html

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top