How to start Android app development in Chrome OS – 1stOriginal

In Worldwide now new technology arrive every certain time so in Chrome OS, Chrome OS has Device like Chromebooks, Google Play Store supported in Chrome OS so Android Apps available for Chrome OS, here we know about how Android app designed for phones and tablet that you want in Chromebook. It is possible to develop for Chromebook using ADB, over the network same like regularly develop Android App.

Update your manifest file

A Chromebook is a laptop or tablet running the Linux-based Chrome OS as its operating system. The devices are basically used to perform a variety of steps using the Chrome browser, with many applications. As of Chrome OS version M53, all Android apps that don’t explicitly having the android hardware touch screen feature will also work on Chrome OS devices that support the android.hardware.fake tough feature. However, to ensure your app works on all Chromebooks, go your manifest file and adjust the settings so that the android.hardware.touchscreen

Input Compatibility

When we using an app on a Chromebook and find there are a keyboard and trackpad, many users have touchscreen, so you need to know the inputs, for test your app on Chrome OS, firstly you should make sure that you are not required touchscreen and multi-touch in your manifest, id user require a touchscreen, application will not available on some Chrome OS devices, if user application needs a real touch screen or multi-touch than restrict based on these, but think about how you could provide a great experience with either a simulated touch gesture from the OS. You can make sure your application will be available on all Chrome OS devices by not requiring a touchscreen and adding this to your manifest.

      <uses-feature android : name = “android.hardware.touchscreen”android: required = “false”/>

Here are some steps:

Turn on the Developer mode in Chrome – visit your model and follow instruction ( Backup your file )

  1. Install the crouton extension – Install the extension in Chrome Web.
  2. Create a Linux chroot with crouton – Download crouton on your Chromebook
  • Open the Chrome terminal ctrl + Alt +T
  • Enter the shell by using typing the shell
  • Run – sudo sh ~/Downloads/crouton -t Xfce,extension,xorg,xiwi
  1. Download Android Studio for Linux
  2. Setup Android Studio in your Chrome OS

Go terminal and type Ctrl + Alt + Tab and type shell

Run sudo startxfce4 and enter your sudo password.

After a log the XFCE desktop start and forth between XFCE and Chrome OS at any time using Ctrl + Alt + Shift + Back and Ctrl + Alt +Shift + Forward. To shut down the chroot and log out from KFCE.

Go to ~/Software/android-studio/bin, and open a terminal here (right click inside the folder, Open Terminal Here).

Run sh and go through the configuration of Android Studio (you can choose to install the SDK to an external storage like an SD card if you’re short on disk space). You don’t need to install any virtual device. Downloading and installation take some time. Then start a new empty project, so that we can access the main window. Once there, click on Tools > Create Command-line Launcher. The suggested location should be fine by default (/usr/local/bin/studio). Press OK and close Android Studio.

Go back to the chroot terminal (Ctrl+Alt+T works too), make sure python is installed, so that the shortcut that Android Studio has just created works: sudo apt install python You can try to run the studio. Android Studio should start inside the chroot. If you don’t use a QWERTY keyboard, and want another layout to be used with the standalone Android Studio window that we will create, you can create a ~/.xiwirc file, executed as xiwi startup: setxkbmap [layout] [variant] For instance, to use the Bépo variant of the French keyboard layout: setxkbmap fr bepo. Then You can now logout of XFCE

6. Launch Android Studio as Chrome window:-  Go back to the Chrome terminal (or fire it up again with Ctrl+Alt+Tab and typing shell). Run sudo enter-chroot xiwi studio: Android Studio should start on your Chrome OS desktop, after a bunch of logs (and probably some errors about the crouton extension). Leave it open.

Make the Chromebook show up as an ADB device:- Go terminal ( Ctrl  alt Tab the shell ) and run the command sudo crossystem dev_boot_signed_only=0 then sudo / usr / libexec/ debugd/helpers/dev_features_verification next sudo reboot for start use ctrl + D the open terminal ( control + alt + t the shell ) and run sudo /usr/libexec/debugd/helpers/dev_features_ssh

Now, enable ADB debugging from the Android setting of the Chromebook:-

  • Click the clock icon in the bottom-right area of the screen.
  • Click setting
  • In Android App Section, click the setting link in the line that reads manage your Android app in Setting.
  • Then go About device
  • Go Build number seven time to move into Developer mode
  • Click build number seven time to move into developer mode, click the arrow in the top-left area of the window to go back to the main setting screen
  • Click on new developer option item, activate ADB debugging and then click OK to Allow ADB debugging
  • Finally, we can go back to our Chrome terminal (Ctrl+Alt+T then shell) and run- adb connect localhost:22 (Using the default ssh port here).
  • A dialog should pop up asking if you would like to allow ADB to control the Android side, ticking the Always allow for this computer box is a good idea, and press OK.
  • You should get a confirmation that it worked: connected to localhost:22
  • If not, something must be wrong in your firewall settings, go back to this section.

7.  Run The App:- Start Android studio and then open the project you want click run button to choose your Chromebook and view the result if some cases Chromebook does not appear in the result list, open another chrome terminal (Ctrl+Alt+T then Shell) and restart the ADM connection.  Adb kill-server and adb connect localhost:22

Note:- If you open Android Studio Terminal, bash session from the Ubuntu chroot, then install and use developer tools as git (sudo apt install git).