Home > Android-NDK > Android- How to Create Executable

Android- How to Create Executable

1. Setup ndk project with android.mk and native sources

Android.mk file should include BUILD_EXECUTABLE, sample android.mk is below.


LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)

LOCAL_MODULE := Modulename
LOCAL_SRC_FILES := file1.c\
file2.c

LOCAL_MODULE_TAGS := optional
include $(BUILD_EXECUTABLE)

2. Building executable.

$ ndk-buld

3. Run executable

copy to device say /sdcard/data/Modulename
xxxx@xx:$> adb shell
$./sdcard/data/Modulename

Note:Make sure you place Android.mk file along with source(c/c++) in same folder and name it as jni. as libs and obj folders are created next to jni folder.

Advertisements
Categories: Android-NDK
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: