Add one android project as a library in AOSP App

后端 未结 4 551
暗喜
暗喜 2020-12-24 09:53

I want to add some features into Browser app by start an activity from another android application. It gives me package does not exist while I make the Main Pro

4条回答
  •  无人及你
    2020-12-24 10:17

    To add a pre-build jar file to the framework I did that:

    1. Locate a folder with the jar and the Android.mk file under

      prebuilds/misc/common/

    Android.mk:

    LOCAL_PATH := $(call my-dir) 
    include $(CLEAR_VARS) 
    
    LOCAL_MODULE :=  
    LOCAL_MODULE_TAGS := optional 
    LOCAL_SRC_FILES := .jar 
    LOCAL_MODULE_CLASS := JAVA_LIBRARIES 
    LOCAL_MODULE_SUFFIX := $(COMMON_JAVA_PACKAGE_SUFFIX) 
    
    include $(BUILD_PREBUILT) 
    
    1. Run make on the Android.mk file: make prebuilds/misc/common/Android.mk

    2. Add the jar file to the frameworks/base/services/Android.mk:

    LOCAL_STATIC_JAVA_LIBRARIES := $(addprefix services.,$(services)) jar-name

提交回复
热议问题