]>
Commit | Line | Data |
---|---|---|
435d7f97 P |
1 | Battery Status of an Android Phone |
2 | ================================== | |
3 | ||
4 | Plug your Android device to a power supply and start this shell script. The script will inform you when the battery is loaded to about 80%. | |
5 | Generally, keeping the battery loaded to 40 - 80% increases its live time. | |
6 | The application terminates when this threshold is passed or when the device is not attached to a power supply. | |
7 | As the delay between battery checks is 5 minutes (to reduce power consumption), it may take up to 5 minutes to terminate. | |
8 | ||
9 | This application is based on Termux which runs a shell script. Termus is a kind of Linux running on Android devices. | |
10 | ||
11 | What you need is: | |
12 | ----------------- | |
13 | ||
14 | **Apps:** | |
15 | ||
16 | * Termux: Terminal-Emulator | |
17 | * Termux:API: To access the Android-Functions | |
18 | * Termux:Widget: To place the script as Widget on the Android-Desktop | |
19 | ||
20 | **Termux Packages** | |
21 | ||
22 | * termux-api: from Termux:API | |
23 | * jq: Analysing `json` data. termux-battery-status returns the data in `json` format | |
24 | ||
25 | Place the script into the folder `~/.shortcuts/tasks` | |
26 | ||
27 | *It may take up to 1 minute before the result is returned.* | |
28 | ||
29 | Hints | |
30 | ----- | |
31 | ||
32 | * How can I access device storage with Termux? | |
33 | Run `termux-setup-storage`. It will ask for permission and once it was granted, it will setup symlinks in directory ~/storage to standard directories like DCIM, Download, etc. | |
34 | ||
35 | References | |
36 | ---------- | |
37 | ||
38 | * https://wiki.termux.com/wiki/Main_Page |