If you too are looking to create native mobile apps for Android without knowing Java using some framework like ReactNative, this brief tutorial might help you setup Android Studio on your computer running Ubuntu to get you up to speed with your actual application development.
The first thing that you need to do is download the From the Official Android Developers page, download the latest
.tar.gz file on your system
- Installing is as simple as unpacking the binaries of the zipped file, and storing it in an appropriate location for your applications, such as within
**/usr/local/**for your user profile, or
**/opt/**for shared users.
- If you're using a 64-bit version of Linux, you need to install some 32-bit libraries with the following command:
sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386 lib32z1 libbz2-1.0:i386
- Now, to launch Android Studio, open a terminal, navigate to the
**android-studio/bin/**directory, and simply execute:
- Once launched, select whether you want to import previous Android Studio settings or not, then click OK.
The Android Studio Setup Wizard guides you through the rest of the setup, which includes downloading Android SDK components that are required for development.
Configure VM acceleration on Linux
The Android Emulator can use hardware acceleration features to improve performance. Linux-based systems support VM acceleration through the KVM software package.
Running KVM requires specific user permissions. Make sure that you have sufficient permissions as specified in the KVM installation instructions. To use VM acceleration on Linux, your computer must also meet these requirements:
NOTE: For Intel processors, support for Virtualization Technology (VT-x), Intel EM64T (Intel 64) features, and Execute Disable (XD) Bit functionality is enabled. For AMD processors, Support for AMD Virtualization (AMD-V) is available
Check whether KVM is currently installed on Linux
- Check whether KVM is currently installed on Linux using the cpu-checker package containing the
kvm-okcommand. First, install the package.
An output of 1 or greater means that virtualization is supported. An output of 0 means that your CPU doesn't support hardware virtualization.
sudo apt-get install cpu-checker egrep -c '(vmx|svm)' /proc/cpuinfo
- Run the
INFO: /dev/kvm exists KVM acceleration can be used
If you get the following error, it means that you can still run virtual machines. Your virtual machine will be slower without the KVM extensions.
INFO: Your CPU does not support KVM extensions, KVM acceleration can NOT be used.
Install KVM on Linux
If KVM acceration can be used, use the following command to install KVM (Cosmic 18.10 or later):
sudo apt-get install qemu-kvm libvirt-daemon-system libvirt-clients bridge-utils
Now you can use VM acceleration for running your Android emulator. Finally, to launch Android studio, navigate to the android-studio/bin/ directory, and execute
That's it! If you have reached this point, you should have been able to successfully install and launch Android Studio on your Ubuntu 20.04 system. Now you are ready to begin your Android development on Ubuntu using some of the most popular native app development frameworks like ReactNative.
Stay tuned for the next part of this story to learn about just that! Until next time, Cheers 🍻