2

I know how to start activities through a shell, run shell commands through Java, etc. But what about creating a command-line tool in Java? I want the user to be able to use the GUI as well as a CLI (i.e. adb shell or a Terminal emulator).

Is it possible to write the code in Java? Or do I need to delve into the NDK? Being able to write it in Java would be a lot easier due to all the available libraries etc.

1
  • It is possible to write an executable or script which launches a java program in a Davlik VM (see for example the source of the 'am' command), however it will be very tricky to make use of Android platform (vs generic Java) capabilities. To do so, you may be stuck having to use an Intent to launch an android Activity or Service and asking it to interact with the the Android platform. Jan 9, 2013 at 19:33

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.