android - 在同一项目中支持3.0及以下级别

标签 android android-layout google-play android-3.0-honeycomb android-fragments

  1. 我在 Android 上有一个 9 级应用程序,我想知道是否可以在同一项目中使用 11 级 (Android 3.0) 的新功能?
  2. 对于 3.0 平板电脑版本,我的布局将包含 fragment 。如何使用这些 fragment 并让 9 级版本成功构建并运行?
  3. 我可以为不同的 API 级别(在 res/layout 中)定义不同的布局吗?
  4. 如果我保留 2 个版本,一个用于平板电脑,另一个用于手机,我可以将其添加到具有相同软件包名称的 android-marketplace 吗?

最佳答案

I have a level 9 app on android, and I want to know if I can use new features from level 11 (Android 3.0) in the same project?

是的,按照 Willis 先生的建议,通过反射或条件类加载。 Here is a sample application演示了操作栏的这一点,这也是 API 级别 11 的新功能。

For 3.0 tablet version, my layouts will contain fragments. How do I use these fragments and allow the level 9 version to build and run successfully?

使用Android compatibility library .

Can I define different layouts for different API levels (in the res/layout)?

是的,通过-vNN资源集后缀(例如res/layout-v11)。但是,您应该尽量减少这种情况。

If I keep 2 versions, one for tablet other for phones, can I add that to the android-marketplace with the same package name?

没有。

关于android - 在同一项目中支持3.0及以下级别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5353233/

相关文章:

android - 应用程序和网页之间的实时通信

android - 将 Android 更新发布到市场 - 它们出现需要多长时间?

android - 更改完整的 : App displayName, Logo 、iOS 和 Android [2018]?

android - 除非您更新 Google Play 服务错误,否则此应用将无法运行

android - 深层链接到谷歌日历

java - 在 Firebase GenericTypeIndicator 中使用泛型类型时为 "Unknown type encountered"

android - 运行错误 'app' : Unknown error in Android studio 3. 1

android - 手机屏幕倾斜时应用程序注销

android - Canvas 中的圆圈占据整个父空间

android - 由于 TypedArray 中缺少属性,导致 AppCompatButton 类膨胀时出错