mirror of
https://github.com/danog/termux-api.git
synced 2025-01-22 21:31:10 +01:00
Ted Stein
4b3a1528b0
PhotoAPI: Take sensor orientation into account.
On a Nexus 5X, the old code would take pictures that were upside-down. Apparently, the Android device standards require that the long edge of the sensor must align with the long edge of the device, but doesn't say which of the two ways to satisfy this manufacturers should pick. This change makes PhotoAPI generate right-side-up pictures in both conditions. Tested on a Nexus 7 (second-gen) and a Nexus 5X.
Termux API
This is an app exposing Android API to command line usage and scripts or programs.
License
Released under the GPLv3 license.
The termux-api client helper binary
The client helper binary (termux-api.c) generates two linux anonymous namespace sockets, and passes their address as in:
/system/bin/am broadcast ${SERVICE_CLASS} --es socket_input ${INPUT_SOCKET} --es socket_output ${OUTPUT_SOCKET}
where the sockets are used to transfer:
- input through stdin to the helper binary are forwarded to java code
- java code may output feedback which are forwarded to the stdout of the helper binary
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.
Description
Languages
Java
100%