1
0
mirror of https://github.com/danog/termux-api.git synced 2024-11-26 20:04:42 +01:00
Go to file
2016-01-12 14:13:59 +01:00
.idea Update gradle.xml to silence notification 2016-01-12 14:13:59 +01:00
app Remove unused annotations 2016-01-12 14:13:59 +01:00
gradle/wrapper Update gradle to 2.10 and android plugin to 1.5 2016-01-12 14:13:59 +01:00
.gitignore Initial push 2015-07-26 02:23:21 +02:00
build.gradle Update gradle to 2.10 and android plugin to 1.5 2016-01-12 14:13:59 +01:00
gradlew Update gradle from 2.7 to 2.9 2015-11-28 11:17:05 +01:00
README.md Update README.md 2015-12-27 12:22:25 +01:00
settings.gradle Initial push 2015-07-26 02:23:21 +02:00

Termux API

This is an app exposing Android API to command line usage and scripts or programs.

When developing or packaging, note that this app needs to be signed with the same key as the main Termux app for permissions to work (only the main Termux app are allowed to call the API methods in this app).

License

Released under the GPLv3 license.

How API calls are may through the termux-api helper binary

The termux-api client binary in the termux-api package generates two linux anonymous namespace sockets, and passes their address to the TermuxApiReceiver broadcast receiver as in:

/system/bin/am broadcast ${BROADCAST_RECEIVER} --es socket_input ${INPUT_SOCKET} --es socket_output ${OUTPUT_SOCKET}

The two sockets are used to forward stdin from termux-api to the relevant API class and output from the API class to the stdout of termux-api.

Client scripts

Client scripts which processes command line arguments before calling the termux-api helper binary are available in the termux-api package.

Ideas

  • Method for playing audio files using the system MediaPlayer, so termux-play myfile.ogg would play the audio file.
  • Wifi network search and connect.
  • Proximity sensor.
  • Accelerometer.
  • LED Flash.