Start building apps for Chrome OS




Chrome OS devices, such as Chromebooks, now support the Google Play Store and Android apps. This article assumes you have an existing Android app designed for phones or tablets that you want to optimize for Chromebooks. To learn the basics of building Android apps, see Build your first app.

Update your app's manifest file
To get started, update your manifest file to account for some key hardware and software differences between Chromebooks and other devices running Android.

As of Chrome OS version M53, all Android apps that don't explicitly require the android.hardware.touchscreen feature will also work on Chrome OS devices that support the android.hardware.faketouch feature. However, to ensure your app works on all Chromebooks, go to your manifest file and adjust the settings so that the android.hardware.touchscreen feature is not required, as shown in the following example. Removing the requirement for touch input means you should also review your app's support for mouse and keyboard interactions.

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
          ... >
    <!-- Some Chromebooks don't support touch. Although not essential,
         it's a good idea to explicitly include this declaration. -->
    <uses-feature android:name="android.hardware.touchscreen"
                  android:required="false" />
</manifest>

Different hardware devices come equipped with different sets of sensors. Although Android handheld devices often have GPS and accelerometers, these sensors are not guaranteed to be available in every Chromebook. However, there are cases where the functionality of a sensor is provided in another way. For example, Chromebooks may not have GPS sensors, but they still provide location data based on Wi-Fi connections. See the Sensors overview document for an overview of all of the sensors that the Android platform supports. If you want your app to run on Chromebooks regardless of sensor availability, you should update your manifest file so that none of the sensors are required.

Note: If you don't require a particular sensor for your app but still use measurements from the sensor when it's available, make sure you dynamically check for the sensor's availability before trying to gather information from it in your app.
Some software features are unsupported on Chromebooks. For example, apps that provide custom IMEs, app widgets, live wallpapers, and app launchers aren't supported and won't be available for installation on Chromebooks. For a complete list of software features that aren't currently supported on Chromebooks, see incompatible software features.

0 comments:

Post a Comment

 
Top
Top