Setup old android tablet for development

anlinux-fedora

Before Starting, it’s a good idea to install a Custom ROM for your old device just to get the best out of it. Head to XDA and search for your device. But why you might ask ?

  • The installed custom ROM would bring you newer Android version + new kernel version. (not always)
  • Root access (more control in general).

In my case, I am using SM-T585 which came with Android 8.1 and later on I upgraded to 9.

Make sure you have at least 4gb(more than enough) of free space to install all the required apps :

  • Termux : used as a terminal emulator.
  • AnLinux : to install a linux distro without root access.

Note : AnLinux is just an option for those who don’t want to navigate the github repo (easy mode).

Open AnLinux and choose your favourite distro, I recommend using fedora since it has the most up-to-date packages. Copy the install command and open termux and paste. When the installation is done you can start fedora by ./start-fedora.sh

anlinux-fedora

If you reached this point, you know what to do next :D, but I am going to continue as a reference for future me.

  1. Update the system : dnf upgrade.
  2. Install essential packages : dnf install wget git unzip gcc g++ python3 pip net-tools openssh psmisc rsync fuse-sshfs
  3. Install Workspace packages : dnf install nvim tmux zsh
  4. Change the default shell to zsh.
  5. Add aliases.
  6. Have fun hacking :D
  • Download this addon
  • Change the theme and font by hold pressing -> style -> choose color/ choose font

For me, I am using Source Code Pro font with Wild Cherry color.

Since I use vim, I always swap ESC with CAPS_LOCK, but on Android I couldn’t swap the physical keyboard button so I changed the CAPS_LOCK to act like ESC lol.

Here is how I did it:

  • Open the normal termux session.
  • Install vim or any text editor.
  • Mount the system to Write : mount -o remount,rw /system
  • Edit /system/usr/keylayout/Generic.kl and search for CAPS_LOCK and change it to ESCAPE
  • Mount the system to Read only : mount -o remount,ro /system

I have some aliases for easier navigation and nice overall experience.

bash

alias v="nvim"
alias install="dnf install"
alias neo="neofetch"
alias mkd="mkdir -p"
alias vc="nvim ~/.config/nvim/init.lua"
alias python="python3"

I am using SSH to connect to my main machine on the network : ssh none@192.168.1.6, and scp to upload/download content.

bash

# note the IP might change
# Downloads from the server
down () {
    scp -r none@192.168.1.6:$1 $2
}
# Uploads to the server
up () {
    scp -r $1 none@192.168.1.6:$2
}