Firefly Open Source Community

Title: Add a third-party app on Android [Print This Page]

Author: linjc    Time: 12/10/2016 11:16
Title: Add a third-party app on Android
Take the apk of firefly official SDKas an example to simply introduce how to add third-party applications.
To find thisdirectory(vendor/firefly/firefly_assistant) in SDK, it should be the Fireflyofficial to add apk by their own, then use it as an example.
Steps:
1¡¢Create a directory under the vendor, such as:
vendor/firefly/firefly_assistant
2¡¢Put the apk and related library files into the directory, suchas: DLNARemoteService.apk libtchip-vinit.so
3¡¢Create an Android.mk file:
vendor/firefly/firefly_assistant/Android.mk
The code:
  1. LOCAL_PATH := $(my-dir)

  2. include $(CLEAR_VARS)
  3. LOCAL_MODULE := DLNARemoteService
  4. LOCAL_MODULE_CLASS := APPS
  5. LOCAL_MODULE_PATH := $(TARGET_OUT_APPS)
  6. LOCAL_SRC_FILES := $(LOCAL_MODULE)$(COMMON_ANDROID_PACKAGE_SUFFIX)
  7. LOCAL_CERTIFICATE := PRESIGNED
  8. LOCAL_MODULE_TAGS := optional
  9. LOCAL_MODULE_SUFFIX := $(COMMON_ANDROID_PACKAGE_SUFFIX)
  10. include $(BUILD_PREBUILT)
Copy the code
Explanation£º
LOCAL_MODULE :=DLNARemoteService (The name of APK)
LOCAL_MODULE_PATH :=$(TARGET_OUT_APPS) ( after compilation, apk in the directory (/ system / app /) )


4¡¢Create a mk file, such as£ºvendor/firefly/firefly_assistant.mk
  1. CUR_PATH := vendor/firefly/                                                                                                                                             

  2. # add remote for remoteservice
  3. PRODUCT_PACKAGES += \
  4.           DLNARemoteService

  5. PRODUCT_COPY_FILES +=$(CUR_PATH)/firefly_assistant/libtchip-vinit.so:system/lib/libtchip-vinit.s
Copy the code
Explanation£º
PRODUCT_PACKAGES followed by apk names
PRODUCT_COPY_FILES followed by the path tothe library file
5. device/rockchip/rksdk/device.mk to add:
includevendor/firefly/firefly_assistant.mk

The position aftercompilation£º
out/target/product/rk3288/system/app/DLNARemoteService.apk





Welcome Firefly Open Source Community (https://bbs.t-firefly.com/) Powered by Discuz! X3.1