Power & Source of Big Ideas

How to include custom app in Lollipop source build?

Moderators: chensy, FATechsupport

Hi all,

I would like to include a custom app (apk) when I build the Android 5 source for NanoPC T2.

I followed the procudure below and then compiled and booted the img ok, but the app is not installed. FYI - the apk is called ControlCenter and it is signed with the supplied platform keys.

Procedure:

Created device-partial.mk in ~/android5/vendor/isenzo/apps
Created Android.mk in ~/android5/vendor/isenzo/apps/prebuilt/ and copied ControlCenter.apk into the same folder


device-partial.mk contents:

Code: Select all

# FriendlyARM apps
PRODUCT_PACKAGES += \
   ControlCenter


Android.mk contents:

Code: Select all

LOCAL_PATH := $(call my-dir)

ifeq ($(TARGET_BOARD_PLATFORM),slsiap)


include $(CLEAR_VARS)
LOCAL_MODULE := ControlCenter
LOCAL_MODULE_PATH := $(TARGET_OUT_APPS_PRIVILEGED)
LOCAL_MODULE_SUFFIX := $(COMMON_ANDROID_PACKAGE_SUFFIX)
LOCAL_MODULE_CLASS := APPS
LOCAL_MODULE_OWNER := isenzo
LOCAL_MODULE_TAGS := optional
LOCAL_SRC_FILES := ControlCenter.apk
LOCAL_CERTIFICATE := platform
include $(BUILD_PREBUILT)

endif
I had a similar issue and I ended up putting it in the vendor/friendly-arm/apps/prebuilt directory and modifying the .mk files to include it.
Hi v8dave,

I tried your approach but still no luck.

When you modified the .mk file, did you create your own entry or did you copy/modify an existing entry?

Would you mind sharing the .mk file so I can see if I am using the same terms?
Thanks to v8dave's answer and some further experimentation, I managed to include my apk when building from source.

Steps:

Place the custom APK in the following directory: /vendor/friendly-arm/apps/prebuilt
Add the following code to /vendor/friendly-arm/apps/prebuilt/android.mk

Code: Select all

include $(CLEAR_VARS)
LOCAL_MODULE := myapp
LOCAL_MODULE_PATH := $(TARGET_OUT_APPS_PRIVILEGED)
LOCAL_MODULE_SUFFIX := $(COMMON_ANDROID_PACKAGE_SUFFIX)
LOCAL_MODULE_CLASS := APPS
LOCAL_MODULE_OWNER := friendlyarm
LOCAL_MODULE_TAGS := optional
LOCAL_SRC_FILES := myapp.apk
LOCAL_CERTIFICATE := platform
include $(BUILD_PREBUILT)


Add the app name to /vendor/friendly-arm/apps/device-partial.mk

Code: Select all

# FriendlyARM apps
PRODUCT_PACKAGES += \
   libfriendlyarm-hardware \
   iTest \
   myapp

Who is online

In total there is 1 user online :: 0 registered, 0 hidden and 1 guest (based on users active over the past 5 minutes)
Most users ever online was 576 on Tue Aug 20, 2019 5:38 pm

Users browsing this forum: No registered users and 1 guest