- create a directory for the new component in $(YOUR_ANDROID)/external folder: $(YOUR_ANDROID)/external/hello
- put the hello.c into the directory: $(YOUR_ANDROID)/external/hello/
- create Android.mk in $(YOUR_ANDROID)/external/hello/ directory, the Android.mk likes the following:
LOCAL_PATH:=$(call my-dir)
include $(CLEAR_VARS)
LOCAL_ARM_MODE := arm
LOCAL_SRC_FILES:= \
hello.c
LOCAL_MODULE := hello
include $(BUILD_EXECUTABLE) - add the following line into $(BUILD_SYSTEM)/main.mk,$(BUILD_SYSTEM) is in $(YOUR_ANDROID)/build/core:
external/hello - launch the build command in $(YOUR_ANDROID): make hello
You can use include $(BUILD_SHARED_LIBRARY) to create shared library. Find more in $(YOUR_ANDROID)/build/core/config.mk.
7 comments:
thanks for the post. i don't understand the following step that you mentioned: (step #4):
"add the following line into $(BUILD_SYSTEM)/main.mk,$(BUILD_SYSTEM) is in $(YOUR_ANDROID)/build/core:
external/hello"
My question is that _where in the main.mk_ should i add the line to? :)
Kenny.
Did you find the external/zlib in main.mk? Append your lines after that.
why is that every one suggests that the new modules should be added in external/ folder only.Say i have an Android.mk file in packages/inputmethods/hello/.How do include this android.mk in the build so that my android.mk is also included while the complete code is built.
From what I can tell if you have Android.mk anywhere in your build tree build/tools/findleaves.sh will find it and include it in the make.
I want to know what is an android used for, I also wonder if an android uses stuff like Generic Viagra or such
There are hundreds of great free Android weather apps that more than make up for the lack of paid weather apps in the Android market.
best android apps
best iphone apps
In my /build/core/main.mk file, no entry of extrenal/zlib.
I am using Android source code of version 5.0
The entry of external/zlib in main.mk file is upto the Android verion 4.2 .
From version 4.3 and later there is no such a entry in main.mk file.
So what to do in that case ?
Post a Comment