<> Hello ! This is Kite blog ,

<> Welcome to communicate with me .

habit Linux People of , In the beginning Android When , Will think :
Can it be like that Linux equally , adopt arm-linux-gcc -o test test.c
Compile an executable program into the Android How about running in the environment ?
Yes, of course , By writing Android.mk realization .

* 1. get into hardware Under the table of contents , Create a directory in it , Like what I used aw The board of : cd ./hardware/aw/sensors/ mkdir demo
&& cd demo
* 2. Write your own C/C++ file , I use it :test.c #include <stdio.h> int main() { printf("Android
test success\n"); return 0; }
* 3. stay demo Below the table of contents , Copy from other directories Android.mk, to write Android.mk file : LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS) LOCAL_MODULE := test LOCAL_SRC_FILES := test.c
LOCAL_MODULE_TAGS := optional #LOCAL_C_INCLUDES := #LOCAL_STATIC_LIBRARIES :=
#LOCAL_SHARED_LIBRARIES := include $(BUILD_EXECUTABLE)
BUILD_EXECUTABLE Indicates that the compiled is an executable binary

* 4.mm Compile current path
After successful compilation , The executable file is saved in :
out/target/product/xxxxx/system/bin/
route , The name is LOCAL_MODULE Name to fill in , In this case LOCAL_MODULE by test

This will file the push reach Android lower , Giving executive authority , You can test it .

Technology
©2019-2020 Toolsou All rights reserved,
Send love - A little romance for programmers VHDL—— Design of frequency divider Python Implementation of Hanoi Tower code It's over , Starting salary 30khtml+css+js Make a simple website home page QQ Login interface implementation Hill sorting of sorting algorithm ——c++ realization 【 Wechat applet learning 】 Netease music cloud code page implementation details Resume the 13th session python Blue Bridge Cup 2022 Solution to the 13th Blue Bridge Cup ( whole )