I'm using eclipse with the NDK to port my C++ application to Android. On Linux, it is an application that you invoke with arguments in the shell to perform a task, no GUI is provided, it is just a command line interface. Presently, I have added a very basic GUI wrapper in java that encapsulates the argument specification that is passed to the ported C++ code in the NDK, however, I would like to also have an application that can be invoked when I ssh into my android phone.
On Android, I see that some applications have the ability to be launched from the shell. For example, the SSH Droid
installed from the Google Play Store, has in addition to its GUI, a shell invokable version. I see this under the pathname /data/data/berserker.android.apps.sshdroid/dropbear/ssh
whereas its APK is located at /data/app/berserker.android.apps.sshdroid-1.apk
. For my APK, I find no executables in /data/data/com.mydomain.myapp-37.apk
, only the directories cache
, files
, and lib
.
Using Eclipse, how can I package natively executable binaries in my application's APK archive? Once present in my APK, how can I in the installation automate the extraction and setting executable permissions so that I can launch it through the shell? It would appear that SSH Droid has done both of these things, I would like to do likewise. Is there a simple example that shows how this is done?
Do I even need an apk, can I somehow just create a command line interface executable more in line with my existing Linux port version?
How are arguments specified for the shell CLI? Do you use argc
and argv
like in C++ applications?