ChromeOS
已开始支持 Android
应用。 https://developer.android.com/topic/arc/optimizing
Android
应用程序在 ChromeOS
中运行时需要大量优化,这些优化仅适用于在 chrome 环境中运行的应用程序。
是否可以为 Android 和 chrome 使用相同的应用 APK 文件,还是应该有单独的 APK 文件?
是否可以在应用内以编程方式区分环境(Android 或 ChromeOS)?
- 基于触摸屏功能的可用性进行区分不再有效,因为某些 Chromebook 附带触摸屏并且可以用作平板电脑。
谢谢
最佳答案
是否可以为 Android 和 chrome 使用相同的应用 APK 文件,还是应该有单独的 APK 文件?
是的,如果您没有任何不可用的特殊功能,则可以为 Android
和 ChromeOS
使用相同的 apk
在 ChromeOS
上。无需创建单独的 APK。
You can use the Google Play Store to install Android apps on several Google Chromebooks. This document describes the Chromebooks, Chromeboxes, and Chromebases that can install Android apps, both currently and in upcoming releases of Chrome OS.
如果您的应用具有 ChromeOS
上不可用的任何功能,则该应用将不会在 ChromeOS
的 PlayStore 上可用,即 ChromeOS
> 您将无法在 PlayStore 上看到该应用。
App manifest compatibility for Chromebooks :
As you prepare your Android app to run on Chromebooks, you should consider the device features that your app uses. Chromebooks don't support all of the hardware and software features that are available on other devices running Android. If your app requires specific features that aren't supported on Chromebooks, it won't be available for installation on Chromebooks.
是否可以在应用内以编程方式区分环境(Android 或 ChromeOS)?
是的,可以使用以下代码检查应用是否在 ChromeOS 上运行:
context.getPackageManager().hasSystemFeature("org.chromium.arc.device_management");
关于android - 如何查找 android 应用程序是由 AndroidOS 还是 ChromeOS 的 android 容器启动的?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51489132/