1、编写Java项目和Android.mk文件
├── Android.mk
└── src
└── com
└── lhw
└── framework
└── led
└── Led.java
//Led.java文件
package com.lhw.framework.led;
/**
* LED操作库
* @author Micky Liu
*/
public class Led {
public boolean turnOn() {
return true;
}
public boolean turnOff() {
return true;
}
}
LOCAL_PATH := $(call my-dir)
LOCAL_SRC_FILES := $(call all-java-files-under, src)
LOCAL_MODULE := framework_led
LOCAL_MODULE_TAGS := framework_led
LOCAL_JAVA_LIBRARIES :=
LOCAL_STATIC_JAVA_LIBRARIES :=
include $(BUILD_JAVA_LIBRARY)
2、编译
mmm /home/administrator/workspace/android_test/framework_led
编译结果:
Install: out/target/product/generic/system/framework/framework_led.jar