Install Termux on Android - eliranwong/UniqueBible GitHub Wiki

Install Termux on Android

Android

You can run UniqueBible.app via Termux on Android.

This wiki page briefly describe how to install and set up Termux on Android device, to prepare for running Unique Bible App.

Do NOT use Play Store to Install Termux

The play store version of Termux no longer work on latest Android versions.

We managed to install Termux with the method described below.

(Remarks: Termux community also suggests installing Termux via F-droid, but unfortunately we haven't been able to install Termux via F-droid. That's why we use the following method.)

FIRST, Give Permission to Chrome App

We will describe how to install the Termux apk file via Chrome app, but first you need to enable your Chrome app to install unknown app.

  1. Go to "Settings > Apps and notifications > Special app access > Install unknown apps"

  2. Select Chrome

  3. Enable "Allow from this source"

Remarks: You may disable this feature after you install Termux app.

Install Termux App

  1. Launch Chrome on your Android device.

  2. Go to official Termux GitHub release page: https://github.com/termux/termux-app/releases

  3. Download the "universal" version from the list under "Assets"

  4. After the file is downloaded, select it from Chrome download list

  5. Select "Install"

Install Repositories

Launch Termux and run,

pkg install root-repo

pkg install x11-repo

Update and Upgrade

  1. Launch the newly installed Termux app

  2. Run "apt update && apt full-upgrade"

  3. Answer "Y" in all prompts until finish

Storage Setup

Run termux-setup-storage and grant permissions when the dialog pops up. This will create a $HOME/storage directory with symlinks to respective paths of sdcard(s).

Read more at https://wiki.termux.com/wiki/Sharing_Data

Install Termux:API & termux-api [optional]

Installing Termux:API & termux-api enables uba to interact more with mobile device api, e.g. sms bible verse, use google text-to-speech engine directly on Android phone without using a separate Google API key.

Termux:API app and termux-api package are two different elements that needed to be installed separately.

pkg install termux-api

Read more at https://wiki.termux.com/wiki/Termux:API

Install Basic Packages

To install packages, required for setting up UBA, launch Termux and run:

pkg install python git binutils libxslt libjpeg-turbo libpng build-essential clang make pkg-config curl wget lynx w3m elinks vlc xclip xsel vim libxml2 libxslt python-apsw which

Please note that we install the official python-apsw package created by Termux team, rather than using pip3, in order to work with regular expression searches. For details, read https://github.com/termux/termux-packages/issues/12340

Read more at: https://wiki.termux.com/wiki/Python#Python_module_installation_tips_and_tricks

Install matplotlib on Termux

To generate charts on bible references with UBA terminal mode, users need to have matplotlib installed.

On Termux, do not use pip3 to install matplotlib, we manage to install matplotlib on Termux by running:

pip3 install 'kiwisolver<1.4.0,>=1.0.1' --force-reinstall

pip3 install cycler

pip3 install fonttools

pip3 install python-dateutil

pkg install python-numpy

pkg install matplotlib

Download and Install UBA on Termux

To download:

git clone https://github.com/eliranwong/UniqueBible

To set up for the first time:

cd UniqueBible

touch use_system_site_packages

python3 uba.py terminal

Remarks:

  • When you run 'python3 uba.py terminal' for the first time, it takes some time for UBA to start as there is a script helping you to download all essential packages automatically. The startup would be much quicker after the first setup.

  • The second step above 'touch use_system_site_packages' tells UBA to use official packages (e.g. as mentioned above, python-apsw, python-numpy, matplotlib). This step should be executed before the first run or setup of virtual environment resource folder that starts with 'venv_*' in UBA directory.

To run UBA thereafter:

python3 uba.py terminal

Use Termux API with UBA

UBA terminal mode integrates some useful Termux API features.

To enable it, run in UBA command prompt:

_setconfig:::terminalEnableTermuxAPI:::True

Run Unique Bible App in Different Modes on Termux

There are several running mode that UBA supports. You may read for more information at https://github.com/eliranwong/UniqueBible/wiki/UBA-Run-Modes

Currently, we support running UBA in the following modes on Termux:

  • HTTP/Web mode - UBA acts as a web server and can be accessed by browsers.

    python uba.py http-server

  • Terminal mode - A command line mode, running locally, where all input and output is text based, without Qt library.

    python uba.py terminal

  • Telnet mode - UBA acts as a telnet server and can be accessed by telnet clients.

    python uba.py telnet-server

Our recommendation:

We recommend users to run mainly terminal mode on Termux. Most features available on GUI mode are available in terminal mode. In addition, you can start or stop http-server mode via terminal when you need it.

Automate UBA

You may place the following line in file '/data/data/com.termux/files/home/.bashrc':

python /data/data/com.termux/files/home/UniqueBible/uba.py http-server & disown

alias uba="python /data/data/com.termux/files/home/UniqueBible/uba.py terminal"

With these two lines in place, http-server automatically starts when you start a Termux session.

In addition, you can simply run commands like below to launch terminal mode:

uba

uba John 3

Change Text Size

"... text size can be adjusted by pinch zooming ..."

References

https://wiki.termux.com/wiki/Package_Management

https://wiki.termux.com/wiki/Python

⚠️ **GitHub.com Fallback** ⚠️