I.MX6 pre-install a prebuilt APK file to Android system

来源:互联网 发布:怎么样提高淘宝排名 编辑:程序博客网 时间:2024/05/22 17:26
https://community.nxp.com/thread/321047

http://blog.csdn.net/andylao62/article/details/50705622

以BT为例

1. 新建文件夹/home/public/project/android/freescaleandroid5.1/device/fsl-proprietary/prebuilt_app

在prebuilt_app文件夹下新建Android.mk文件如下

LOCAL_PATH := $(call my-dir)include $(call all-subdir-makefiles)


2. 新建文件夹/home/public/project/android/freescaleandroid5.1/device/fsl-proprietary/prebuilt_app/BT

将BT.apk(见附件)解压后文件放在BT文件夹下

将BT.apk放入BT文件夹下

在BT文件夹下新建Android.mk文件如下

LOCAL_PATH := $(call my-dir)include $(CLEAR_VARS)LOCAL_MODULE := BTLOCAL_SRC_FILES := $(LOCAL_MODULE).apkLOCAL_MODULE_SUFFIX := $(COMMON_ANDROID_PACKAGE_SUFFIX)LOCAL_MODULE_CLASS := APPSLOCAL_CERTIFICATE := PRESIGNEDLOCAL_PREBUILT_JNI_LIBS:= \    @lib/armeabi-v7a/libconnectBT.so\    @lib/armeabi-v7a/libgnustl_shared.so\    @lib/armeabi-v7a/libplugins_generic_libqevdevkeyboardplugin.so\    @lib/armeabi-v7a/libplugins_generic_libqevdevmouseplugin.so\    @lib/armeabi-v7a/libplugins_generic_libqevdevtabletplugin.so\    @lib/armeabi-v7a/libplugins_generic_libqevdevtouchplugin.so\    @lib/armeabi-v7a/libplugins_imageformats_libqdds.so\    @lib/armeabi-v7a/libplugins_imageformats_libqgif.so\    @lib/armeabi-v7a/libplugins_imageformats_libqicns.so\    @lib/armeabi-v7a/libplugins_imageformats_libqico.so\    @lib/armeabi-v7a/libplugins_imageformats_libqjpeg.so\    @lib/armeabi-v7a/libplugins_imageformats_libqtga.so\    @lib/armeabi-v7a/libplugins_imageformats_libqtiff.so\    @lib/armeabi-v7a/libplugins_imageformats_libqwbmp.so\    @lib/armeabi-v7a/libplugins_imageformats_libqwebp.so\    @lib/armeabi-v7a/libplugins_platforms_android_libqtforandroid.so\    @lib/armeabi-v7a/libplugins_platforms_libqminimal.so\    @lib/armeabi-v7a/libplugins_platforms_libqminimalegl.so\    @lib/armeabi-v7a/libplugins_platforms_libqoffscreen.so\    @lib/armeabi-v7a/libplugins_sqldrivers_libqsqlite.so\    @lib/armeabi-v7a/libQt5Core.so\    @lib/armeabi-v7a/libQt5Gui.so\    @lib/armeabi-v7a/libQt5Sql.so\    @lib/armeabi-v7a/libQt5Widgets.so\LOCAL_MODULE_PATH := $(TARGET_OUT)/app#LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS) #can be uninstallLOCAL_MODULE_TAGS := optionalinclude $(BUILD_PREBUILT)



note:

LOCAL_MODULE和LOCAL_PREBUILT_JNI_LIBS:= \需要根据具体的情况做出更改,其他内容可沿用

3. 根据我们需求,按照上述方法创建FM、GaodeMap、QQmusic;

4. 修改/home/public/project/android/freescaleandroid5.1/device/fsl/imx6/imx6.mk

加添如下内容:

#BT FM GaodeMap QQmusic is my prebuilt APK of systemPRODUCT_PACKAGES += \    rtw_fwloader \    BT    \    FM    \    GaodeMap\    QQmusic


5. 编译:

cd /home/public/project/android/freescaleandroid5.1/

$ source build/envsetup.sh

$ lunch sabresd_6dq-userdebug

$ make



note:

编译如果报system.img size 错误

例如:

Out of space? the tree size of out/target/product/nitrogen6x/system is (MB):
273    out/target/product/nitrogen6x/system
The max is 360 MB.
make: *** [out/target/product/nitrogen6x/obj/PACKAGING/systemimage_intermediates/system.img] Error 1

解决方法:

修改/home/public/project/android/freescaleandroid5.1/device/fsl/imx6/BoardConfigCommon.mk文件中

BOARD_SYSTEMIMAGE_PARTITION_SIZE参数

BOARD_SYSTEMIMAGE_PARTITION_SIZE := 536870912 #LQY change BOARD_SYSTEMIMAGE_PARTITION_SIZE := 377487360

即把之前的360MB改为512MB




阅读全文
0 0
原创粉丝点击