Android AOSP - adding app to /packages/apps

做~自己de王妃 提交于 2019-12-19 02:49:41

问题


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 ?


回答1:


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
    


来源:https://stackoverflow.com/questions/24857285/android-aosp-adding-app-to-packages-apps

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!