Setting Up A Development Environment On Android

Setting Up A Development Environment On Android

Setting up a development environment on an Android phone involves installing the necessary tools and applications to write, test, and debug code directly on the mobile device. This can be particularly useful for developers who need to work on the go or who want to leverage the power of their smartphones for coding.

  1. Installing Requirements
    1. Install the Package Manager
    2. Install the Keyboard
    3. Syncing Across Devices
    4. Install Termux
  2. Setting Up Development Environment
    1. Install the tools
      1. Configuring motd

I am using a handy and fast Huawei Y9 2019 Prime. I can’t root it because of Huawei’s weird policy for unlocking their smartphones’ bootloaders. Fortunately, I don’t really need any special privilege to set up development environment for the purpose of learning to code. That’s thanks to Termux.

Installing Requirements

Install the Package Manager

F-Droid is the one-stop package manager for Android. Download F-Droid.

Through F-Droid, download the terminal emulator Termux.

Termux Download from the F-Droid repository. F-Droid repository. Download it. Download it now.

Install the Keyboard

Most virtual keyboards that come with Android (these also include Microsoft Swiftkey) are fine as Termux supplies the useful keys like <Esc>, <Tab>, and arrow keys independently anyway. But I use some applications that require the <Esc> key, like the Obsidian, so I soared the oceans and swam the skies to find an Android keyboard that sports the needed key. And alas at last, there exists a God-smiling keyboard that is so glorious I can’t be sure if it’s okay not to mention it here. Install it. You need to install it.

Unexpected Keyboard. It provides keys everyone should expect from anything that deems to be called a ‘keyboard’:

  • <Esc> key
  • <Ctrl> key
  • easy and quick access to punctuations and enclosing symbols
  • and so much more convenience only experienced by royalties in fantasy books. Install it. You need to install it now.

Really. All the keys I expect on a keyboard. It’s ironic the app is called ‘Unexpected’. There must be some funny thoughts somewhere in there.

Syncing Across Devices

Syncthing. It’s more versatile than any syncing applications I tried (which are just a few: iCloud, Google Drive, Microsoft OneDrive). I use it (I mean the Syncthing now, not those proprietary services) to sync files across devices (a Linux machine, an Huawei smartphone, iPhone 6s, and iPad). Install it. Install it now.

Install Termux

And now, the actuall cake. Termux is proof that there is paradise on Earth. Look at iOS and/or iPadOS, so beautiful but barren.

Even without root, Termux is so much fun and powerful to use. I can install all the tools I need:

Setting Up Development Environment

Install the tools

Install the tools:

apt install git openssh gcc vim neofetch

Setting up git, vim, and ssh are the same steps as in my Linux machine.

So is oh-my-bash for pretty terminal look:

bash -c "$(curl -fsSL https://raw.githubusercontent.com/ohmybash/oh-my-bash/master/tools/install.sh)"

Configuring motd

Modifying motd (message of the day) in Termux is straightforward but I’ll still write it here ‘cause that’s what this notebook is for: no memorization. Just create a motd.sh file inside the .termux directory.

cd ~/.termux
vim motd.sh

You can write your commands inside this file. I’m not sure if chmod is necessary because there’s no sudo but I still did it anyway.

chmod motd.sh 

© 2024. knznsmn. All rights reserved.