DEV Community

Brix Mavu
Brix Mavu

Posted on

Setup Android Phone for Web Dev

Install Termux and Nodejs package

For the purpose of this demonstration go to fdroid and download Termux. Scroll to the bottom of the page and get latest Termux APK.

Open termux and run

$ pkg update && pkg upgrade

Install nodejs

$ pkg install nodejs

Install Acode editor

From Fdroid download Acode

Acode is able to read the internal and external memory of the phone.

Start building your project

Open Termux app and type

$ termux-setup-storage

If you type ls

$ ls
storage
$
Enter fullscreen mode Exit fullscreen mode

You will see a permalink for folders called storage

Navigate into the internal storage and create folder

$ cd storage/shared

Create project folder

$ mkdir project

Enter the folder

$ cd project

Create your files

$ touch index.html style.css

If you check inside internal storage using files app you will see created folder called project

Use Acode for your first html project

Navigate to your project folder

Open index.html

Type html

Image description

Click html5 snippet

Add viewport meta

<meta name="viewport" content="width=device-width, initial-scale=1">

Link html and css

Image description
Navigate to <body> tag and paste

<h1>My First Heading</h1>
<p>My first paragraph.</p>
Enter fullscreen mode Exit fullscreen mode

Go to style.css and paste

h1{
color: red;
}

p{
color: blue;
}
Enter fullscreen mode Exit fullscreen mode

Installing http-server

To see our first project we need http-server

Open termux navigate to project folder and type

$ cd storage/shared/project

$ npx http-server

copy the given address for localhost I got

http://127.0.0.1:8080

Paste inside chrome url bar

Image description

Top comments (0)