1
0
mirror of https://github.com/danog/termux-api.git synced 2024-11-30 04:19:20 +01:00
Go to file
Tom Yan 1be62a5c91 MediaPlayerAPI: remove extension pattern check
There are way more possibilities and extension doesn't guarantee
anything about the file.
2018-04-07 00:38:55 +02:00
.idea Update gradle and Android Studio 2016-09-26 22:43:16 +02:00
app MediaPlayerAPI: remove extension pattern check 2018-04-07 00:38:55 +02:00
gradle/wrapper Update gradle configuration 2018-04-02 00:58:32 +02:00
.gitignore Update gitignore for Android Studio 3.1 2018-04-02 01:38:10 +02:00
build.gradle Add google() too allprojects.repositories 2018-04-02 01:52:50 +02:00
gradle.properties Update gradle 2016-04-28 12:46:05 +02:00
gradlew Update gradle configuration 2017-09-24 22:54:15 +02:00
gradlew.bat Update gradle and Android Studio 2016-09-26 22:43:16 +02:00
README.md Add SensorAPI (#147) 2018-04-02 00:51:14 +02:00
settings.gradle Initial push 2015-07-26 02:23:21 +02:00

Termux API

Join the chat at https://gitter.im/termux/termux

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 made 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.
  • real-time sensor data output instead of snap with a second delay.
  • LED Flash.
  • Add extra permissions to the app to (un)install apps, stop pricesses etc.