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
Marvintpa wrote:
Thanks to v8dave's answer and some further experimentation, I managed to include my apk when building from source.
Hi. I recently arrived in Ukraine and decided to try to play online slots on the site https://slotscity.ua/ru/slots . It's just incredible. Registration took place in just a few clicks, after which I received a bunch of frispins to test the slots. Thanks to this, I chose the best of them.

Code: Select all

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

Thanks

Who is online

In total there are 3 users online :: 0 registered, 0 hidden and 3 guests (based on users active over the past 5 minutes)
Most users ever online was 5185 on Wed Jan 22, 2020 1:44 pm

Users browsing this forum: No registered users and 3 guests