as far as native-activity sample of android
cd native-activity
1. build so library
ndk-build
2. generate build.xml
android update project -p . -t android-19
3. package into apk with ant
ant release
or
ant debug
Additionally, the following steps are optional.
Above, the signature key is required for ant release, otherwise it will generate apk without signature.
1. generate ant.properties file
touch ant.properties
2. edit ant.properties file
key.store=<keystore>
key.alias=<key>
key.store.password=<keystore pwd>
key.alias.password=<key pwd>
for example:
Android Native Development Kit Cookbook
chapter 5, NativeInputs
cd NativeInputs
1. add application.mk in jni directory
APP_PLATFORM := android-19
2. Android.mk in jni directory
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := NativeInputs
LOCAL_SRC_FILES := NativeInputs.cpp
LOCAL_LDLIBS := -llog -landroid
LOCAL_STATIC_LIBRARIES := android_native_app_glue
include $(BUILD_SHARED_LIBRARY)
$(call import-module,android/native_app_glue)
3. AndroidManifest.xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="cookbook.chapter5.nativeinputs"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="9"/>
<application android:label="@string/app_name"
android:icon="@drawable/ic_launcher"
android:debuggable="true"
android:hasCode="true">
<activity android:name="android.app.NativeActivity"
android:label="@string/app_name"
android:configChanges="orientation|keyboardHidden">
<meta-data android:name="android.app.lib_name"
android:value="NativeInputs" />
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
4. run android command
android update project -p . -t android-19
5. run ant to package
ant debug
or ant release