buggins / coolreader

Official site of CoolReader project. Sourceforge repository is obsolete.
GNU General Public License v2.0
386 stars 101 forks source link

android: add a simple state log file #357

Open teleshoes opened 1 year ago

teleshoes commented 1 year ago

writes a single line at startup, shutdown, tts start, and tts stop. it currently writes to the coolreader app dir, but could write to external storage for interfacing with other apps.

i use this to control coolreader TTS audio using the volume up/down buttons while my phone is locked. (if coolreader is running and in TTS mode, play/pause coolreader. otherwise, play/pause my media player).

i have previously used a combination of querying the android media layer, pgrep to see if tts is running, and logcat, which worked a little less reliably and a lot less efficiently.