Creating an Android Executable

Creating an Android executable is easy and straight forward with the Android source. Android is not GNU/Linux and it does not have access to standard glibc functions. Instead, android has its own C runtime called bionic. Your executable has to be linked with the bionic libraries instead of standard glibc.

The Android Build System searches every sub folder for and executes it. The macros defined by the Android Build System makes sure that your executable are linked with the right libraries.

Steps for creating the android executable

1. Create a folder for your program in the Android Tree. If you not sure on where to create it put it under system folder.

2. Create a basic file with the below contents.

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

my_program.c \

libcutils \

LOCAL_MODULE:= myprogram


3. Add you program's C files in the macro LOCAL_SRC_FILES.

4. Build and Flash the Android Source.

You should see your program "myprogram" under /system/bin folder.

You can launch you program using the Terminal Emulator application inside the Android Device OR connect the device with adb and execute from the adb shell.

0 Responses to "Creating an Android Executable"