简体   繁体   English

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

[英]How do decide which flavor of Android to develop an app for?

My research shows that Android 2.2 & 2.3 have the loin share of the market. 我的研究表明,Android 2.2和2.3在市场上占有一席之地。 But when developing an app should I keep the API level of the app 2.1 or go with 2.2+? 但是,在开发应用程序时,我应该保留应用程序2.1的API级别还是使用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. 我使用2.1(API 7)作为目标,并使用1.6(API 4)作为最小版本。

This covers most of the Android devices in use today. 这涵盖了当今使用的大多数Android设备。

If I need to use some (optional)functionality from 2.2 or 2.3 I use it with reflection. 如果我需要使用2.2或2.3中的某些(可选)功能,则可以将其用于反射。

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. 我的答案很简单:从SDK4(Android 1.6)开始,较早的版本缺少一些重要功能(最值得注意的是屏幕尺寸处理)并累积了许多未修复的错误。 Then check, if your app requires newer Android release features - like cloud-to-device notifications or barometer support. 然后,检查您的应用是否需要较新的Android版本功能-例如从云到设备的通知或晴雨表支持。

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 尽量不要在发布日期吸引过多用户,Android平台统计信息将为您提供帮助: http : //developer.android.com/resources/dashboard/platform-versions.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM