如何确定开发应用程序的Android风格?

时间:2011-10-19 14:26:24

标签: android api android-2.2-froyo android-2.0-eclair

我的研究表明Android 2.2& 2.3拥有市场的腰部份额。但是在开发应用程序时,我应该保持应用程序2.1的API级别,还是使用2.2 +?

通常会考虑哪些因素?

2 个答案:

答案 0 :(得分:4)

我使用2.1(API 7)作为目标,使用1.6(API 4)作为最小版本。

这涵盖了目前使用的大部分Android设备。

如果我需要使用2.2或2.3中的某些(可选)功能,我将它与反射一起使用。

以下是示例:

    // 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
      }
    }

答案 1 :(得分:0)

我的回答很简单:从SDK4(Android 1.6)开始,早期版本缺少几个重要功能(最值得注意的是屏幕尺寸处理)并累积数量未修复的错误。然后检查您的应用是否需要更新的Android版本功能 - 例如云到设备通知或气压计支持。

尝试不在发布日期删除太多用户,Android平台统计信息将帮助您:http://developer.android.com/resources/dashboard/platform-versions.html