Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android AOSP - adding app to /packages/apps

I need to add a new app that I wrote in Eclipse to the /packages/apps folder in Android AOSP. But after the copying the app folder into that directory, building, and rebooting Android, I don't see my app in the launcher.

I see that the Android.mk file is missing. I want to ask what is the simplest Android.mk that could be written for a Eclipse project to make it compile. I tried the following (I put the file in the app's directory)

LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)

LOCAL_MODULE_TAGS := optional

LOCAL_SRC_FILES := $(call all-subdir-java-files)

LOCAL_PACKAGE_NAME := MyApp

include $(BUILD_PACKAGE)

I don't see any compilation errors, but still I don't see it in the launcher.

Can anyone tell what is missing in my Android.mk file? (I took the code from the Soundrecorder app)

Is there any other file that needs to be edited to include an app into /packages/apps folder ?

like image 913
Jake Avatar asked Jul 21 '14 03:07

Jake


1 Answers

The steps are as follows:

  1. Place MyApp folder under /packages/apps.
  2. Add Android.mk to /packages/apps/MyApp (yours should work).
  3. Add MyApp entry to PRODUCT_PACKAGES in the target product .mk file under /build/target/product (missed the step). E.g. when building for sdk, the entry in sdk.mk is

    PRODUCT_PACKAGES := \
            ... \
            SomeApp \
            MyApp
    
like image 147
Onik Avatar answered Oct 11 '22 14:10

Onik