title: How to create an Android executable for launch from the shell?
body: <p>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.</p>
  
  <p>On Android, I see that some applications have the ability to be launched from the shell.  For example, the <code>SSH Droid</code> installed from the Google Play Store, has in addition to its GUI, a shell invokable version.  I see this under the pathname <code>/data/data/berserker.android.apps.sshdroid/dropbear/ssh</code> whereas its APK is located at <code>/data/app/berserker.android.apps.sshdroid-1.apk</code>.  For my APK, I find no executables in <code>/data/data/com.mydomain.myapp-37.apk</code>, only the directories <code>cache</code>, <code>files</code>, and <code>lib</code>.</p>
  
  <p>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?</p>
  
  <p>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?  </p>
  
  <p>How are arguments specified for the shell CLI?  Do you use <code>argc</code> and <code>argv</code> like in C++ applications?</p>