hthy46vbs
hthy46vbs

Reputation: 179

How to create android projects for native applications from terminal?

I would like to speed up my work creating a template for my native applications for Android that only make use of C++ code, this kind of applications have a slightly different manifest and a slightly different folder and file configuration, and i was hoping that i can create a project from the command line with the

android create project

command.

I'm only interested in creating an android project template for the NDK and for a native activity, nothing else, no java no JNI.

Upvotes: 2

Views: 1443

Answers (1)

André Oriani
André Oriani

Reputation: 3613

  1. Create the Android Project as said. You have to create it as it were a pure Java Android project.
  2. Create the jni folder inside you android project. Create your code and your Makefile. Look at the examples that come with the NDK.
  3. Once you have all ( the native code), the manifest for the native activity and the native activity, run ndk-build to compile the native part.
  4. Then run ant debug to build the APK.

Upvotes: 3

Related Questions