jackpal/Android-Terminal-Emulator — pull request #320 by FrankWestlake (2014-05-09 16:27:26+00:00)
Title: Shortcuts phase 2

I am unable to test a feature. If the user tries to navigate into external storage when it is unavailable then a toast says that it is unavailable. If a path is entered into the path window that is a subdirectory of the external storage root then the path gets set to the external storage root. My Android version (4.3) does not permit mounting external storage to the PC so I can't test this feature.

I'm not a GUI guy but this is better then the previous, and this will probably be my last GUI improvement to shortcuts. I still need to export strings and spend some time on cleaning up and fine-tuning the code.

I also intend to update the example (examples/intents/src/jackpal/androidterm/sample/intents/IntentSampleActivity.java) but it will have to be more than simply replacing one procedure for the other. In the old procedure an entire command line was sent as a single string and in the new procedure the command and arguments are separate. Because they are separate they can be used differently. Here is basically what can now be done:

- If the Uri.path is specified it must be the full path, and this full path gets quoted for BASH. It must be the full path because it gets prefixed with '/' otherwise -- so 'ls' becomes '/ls'.
- The Uri.path may be left unused and the command placed in the Uri.fragment with the arguments, and the fragment may be a complete script. For example 'uri.fragment("cd /sdcard; curl http://ti.com/ >ti.html")'.

So in the example I would convert the existing two sample scripts to fragments only, then add a third script sample which places the command in Uri.path.

Frank