Android Studio is one of the best development tool to create Android application. But we know that this tool is too heavy for some machines, like mine. In order to develop an Android application, we need to use their SDK which is available to be download separately. So let's get started.
1. Prerequisite Tools
First, we need to download the latest SDK from Android official website and navigate to the
Command line tools only then download the file based on your OS, in this case I'm using Linux. Another tool we need to use is Gradle (optional), please download the latest Gradle file.
2. Manual Setup
Since we're not using Android studio bundle system, we need to setup the tools manually. I'm going to use
/home/username/bin/ for the installation directory. The installation directory would be like
/home/username/bin/android/gradle. Extract the SDK or
cmdlinetool and Gradle file inside our installation directory. The structure is supposed to be the following:
Before set our environment variable, try to run the
cmdline-tools/bin/sdkmanager script from terminal command by running
./sdkmanager --list you'll get a list of available packages.
3. Install Packages
We need to install such packages like
x means the version.
./sdkmanager "platforms;android-30" "system-images;android-30;google_apis;x86_64" "platform-tools"
In order to connect our real device to the application, we need to install an additional packages, please install the following packages:
sudo pacman -S libmtp android-tools android-udev (the package name for other Linux Distro might be different).
Now we create new entry in Path environment variable.
# Android SDK files
4. Testing and Run
We are ready to create new virtual device.
avdmanager create avd -n image_v29 -k "system-images;android-29;google_apis;x86_64"
avdmanager list avd
emulator directory and try to launch the virtual device by running the following command:
But if you want to develop your application from your device, you need to enable
developer option and enable
USB debugging, since we're already install the packages, we can easily plugged-in the phone to our machine and then allow the permission and we're done. Please refer to the internet, there are so many tutorial about it.
It is a little tricky but now we are done. We don't need to use Android studio to create and develop our application, with those tools, we can still run the application through AVD or even our Android phone.