Download and install termux from here.
install ubuntu from here.
sudo apt update
sudo apt install openjdk-11-jdk -y # or openjdk-17-jdk
Install Termux-x11 from here.
download android studio linux tar from here.
Download android-sdk and cmdline-tools from here.
Also Download build-tools and platform-tools from here according to your devices arch
.
Now Create Android
directory in Ubuntu $HOME
directory
and extract android-studio,android-sdk into ubuntu $HOME/Android/
directory
and extract cmdline-tools, build-tools and platform-tools in $HOME/Android/android-sdk/
dir.
Now open terminal and edit .bashrc file .
nano ~/.bashrc
add these lines to .bashrc
export ANDROID_HOME=$HOME/Android/android-sdk
save it.
run this in terminal.
source ~/.bashrc
bash ~/Android/android-studio/bin/studio.sh
Cancel setup wizard and uncheck show agin setup wizard.
Now Android Studio setup is completed.
to fix aapt2 error go to this link.
If you encounter any error please first google.
Note:- Layout Manager Not Working. (Tested and Working:- NDK , ADB WI-FI)
to use NDK, download from here