5

Is there any Zenity alternative available for Android?

I am trying to do something like this using a Bash script in my Android device:

  1. Show a pop-up message
  2. Play a notification tone
  3. Show a pop-up window with text (or number) input box;
  4. Add item to notification panel;
  5. Show toaster message?

Is it possible to do this without using any external tool (or with only lightweight external tool)? If not then please name some command-line tools for this purpose.

Expected usage scenario, from command line:

$ ANWSER=$(android_show_message --buttons OK,Cancel "Do you really want ...?" )
 (android_show_message script brings up a tiny apk app using `am start`)
 (android_show_message communicates with the app to configure what it want to do)
 (android_show_message waits until the app tells it to exit)
 user presses "OK", android_show_message exits successfully, printing "OK";
$ if [ "$ANSWER" == "OK" ]; then android_show_message --toast "Operation completed"; fi
 (a toast message is shown)
  • It can be implemented as a pair of "apk" application that shows dialog and a script that manages connection to this apk (using sockets or sd card). – Vi. Apr 13 '15 at 9:19
1

Installing a command line tool will need a terminal app to be installed on your device. Instead you can use following third-party tools

Tasker can do these things for you.

Just a little heads-up. It is a paid app and a trial version is available. Please test it before you buy. It needs little advanced understanding.

There is also Trigger

Simple, free but has limited workings Let us know which one you choose.

  • 1
    How do I call from bash to Tasker/Trigger and read user's input back in bash? – Vi. Apr 14 '15 at 23:43
  • Also someting simple expected, but a complex thing that can be also misused as just a message/inputbox shower from remote. – Vi. Apr 14 '15 at 23:44
  • There is no exact alternative. but both apps can automate the tasks you needed. what you are trying to do exactly by taking input back to terminal? – Prachil Tambe Apr 16 '15 at 2:42
  • To have interactive scripts that work on Linux also work on Android. – Vi. Apr 16 '15 at 10:44
  • 1
    For this there should be Python + something toolkit to support Zenity already on Android. This leads to heavy-weight solution. Also the way of communication between "command line world" and "Android GUI world" is not covered. – Vi. Apr 19 '15 at 12:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.