When we must use especial library(eg. android.bluetooh.*) in Android SDK, how to compile our java code.

Oh, it is not difficult.

 

[Step 1] Prepare Build environment

Just prepare to set up build Android environment, and download all the Android source code

Just refer to http://source.android.com/download

 

[Step 2] Develop your Java Source code by using Eclipse

Firstly, you must coding on Ecilpse.

After completing coding, copy your source code file to Android folder.

Also copy these three file in it

1. NOTICE

2. Android.mk (Android makefile)

3. MODULE_LICENSE_APACHE2

 

[Step 3] Edit your Android.mk file

Modify your Android.mk that is your make environment settings

Just like that:

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

LOCAL_MODULE_TAGS := userdevelopment

# Only compile source java files in this apk.
LOCAL_SRC_FILES := $(call all-java-files-under, src)

LOCAL_PACKAGE_NAME := your_package_name
LOCAL_CERTIFICATE := platform


include $(BUILD_PACKAGE)

# Use the following include to make our test apk.
include $(call all-makefiles-under,$(LOCAL_PATH))

 

[Step 4] Compile source code

After setting, enter the Andorid folder, #make your_package_name

Then your will get the your_package_name.apk Android application

 

[Step 5] Install and Enjoy it

Install the application, you will start to control your bluetooth device

Enjoy it...

 

 

 

 

arrow
arrow
    全站熱搜

    owenhuangtw 發表在 痞客邦 留言(0) 人氣()