Home / Blog / How to Edit NextJS APP on Android

How to Edit NextJS APP on Android

How to Edit NextJS APP on Android

To edit the next app on Android, you can download Termux from the Play Store. Now you can use the inbuilt nano editor to edit your next app and another method is to push code into GitHub and then edit.

Let me walk you through how you can edit your next app on Android while using Termux.

 

Editing the next app While Using Nano Editor

There are no code editors that support the latest ES6 module on Android, so you can also use the built-in nano editor on Termux to edit the next app. Now, let's first dive into the step.

First, go to the Play Store, type Termux in the search bar and download it. After downloading open the app and write this command for Termux storage permission,

termux-setup-strorage

Allow the storage permission and now you need to run this command to update the package.

pkg update && upgrade

After updating the package, you need to install Nodejs while running commands.

pkg install nodejs
 

Creating NextJS APP with Termux Terminal

To create the next js app on Android you can run this command,

 npx create-next-app@latest 

It will give you options to choose from. You must reject the Turbo Pack since Termux doesn't support the latest future. If you have selected the turbo pack, you can disable it by modifying the package.json file.

 What is your project named?  my-app
 Would you like to use TypeScript?  No / Yes 
 Would you like to use ESLint?  No / Yes 
 Would you like to use Tailwind CSS?  No / Yes 
 Would you like your code inside a `src/` directory?  No / Yes 
 Would you like to use App Router? (recommended)  No / Yes 
 Would you like to use Turbopack for `next dev`?  No / Yes 
 Would you like to customize the import alias (`@/*` by default)?  No / Yes

After creating the next js app while using the Termux terminal. Now get access to the project while running this command,

cd my-app

Now you can edit any of the individual files while running this command.

nano package.json

That's how you can edit your next app on Android while using the inbuilt Nano Editor on Termux but it's a very slow process, especially on a small screen.

 

Editing the next app on Android while using Github

Now, let's install the git while issuing this command,

pkg install git

Now check the present working directory while running these commands.

pwd

and,

cd folder name

We can't log in with a username and password because GitHub removed the password authentication on August 13 2021; we need to set the SSH key to access the GitHub repository. Open Termux and run this command to generate an SSH key. Also, add your email address.

ssh-keygen -t ed25519 -C "your_email@gmail.com"

Now, you can run this command to access the public SSH key.

cd .ssh
and
cat ed25519.pub

Copy this public SSH key, Go to your GitHub account and click on the repository setting icon and you will see the option of deploy keys add your deploy key here and do not forget to checkmark the write access feature so that you can push your code,

Now let's run this command,

git init

After that, add the README.md file while using this command,

git add README.md

You can add your first commit while running this command,

git commit -m "first commit"

Then run this command to set your main origin,

git branch -M main

Now, run this command to check the connection between the GitHub repository and your local Termux terminal.

 ssh -T git@guthub.com

Now you need to set the git remote origin,

git remote set-url origin git@github.com:your_git_user_name/repository_name.git

and

git add .

Now you can run this command to push your code to GitHub.

git push -u origin main

Now, you can edit your next app on GitHub in Android. You can also use codespace for the terminal. And vs code server for editing the next app on GitHub.