4

ChromeOS has started supporting Android apps. https://developer.android.com/topic/arc/optimizing

Android apps when running within ChromeOS requires a bunch of optimizations and these optimizations apply only to the app when running in chrome environment.

  • Is it possible to use the same app APK file for both Android and chrome or should have separate APK files?

  • Is it possible to differentiate the environment (Android or ChromeOS) programmatically within the app?

    • Differentiating based on the availability of touchscreen feature is not valid anymore since some Chromebooks ships with touchscreens and can be used as a tablet.

Thanks

Vikasdeep Singh
  • 20,983
  • 15
  • 78
  • 104
Akh
  • 5,961
  • 14
  • 53
  • 82

1 Answers1

4

Is it possible to use the same app APK file for both Android and chrome or should have separate APK files?

Yes, it is possible to use same apk for Android and ChromeOS if you don't have any special feature which is not available on ChromeOS. No need to create separate APK.

Device Support:

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.

If your app will have any feature which is not available on ChromeOS then that app will not be available on PlayStore for ChromeOS i.e. from ChromeOS you will not be able to see that app on 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.

Is it possible to differentiate the environment (Android or ChromeOS) programmatically within the app?

Yes it is possible to check if app is running on ChromeOS using below code:

context.getPackageManager().hasSystemFeature("org.chromium.arc.device_management");
Vikasdeep Singh
  • 20,983
  • 15
  • 78
  • 104
  • "context.getPackageManager().hasSystemFeature("org.chromium.arc.device_management");" is the official way to check? Or an hack which might not work reliably down the lane? – Akh Jul 25 '18 at 19:06
  • @AKh as of now this is official way to check. – Vikasdeep Singh Jul 26 '18 at 00:48
  • Is @VicJordan this ("org.chromium.arc.device_management") the only package we need to check to make sure we are running on ChromeOS or is there any additional packages that requires a check? – Akh Aug 14 '18 at 00:06
  • 1
    @AKh this is the only package enough to check. No need of any additional check – Vikasdeep Singh Aug 14 '18 at 00:09