Android AOSP-将应用程序添加到/packages/apps [英] Android AOSP - adding app to /packages/apps
问题描述
我需要将我在Eclipse中编写的新应用程序添加到Android AOSP的/packages/apps
文件夹中.但是,在将应用程序文件夹复制到该目录,构建并重新启动Android之后,我在启动器中看不到我的应用程序.
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.
我看到Android.mk
文件丢失.我想问一下可以为Eclipse项目编写的最简单的Android.mk
是什么.我尝试了以下操作(我将文件放在应用程序的目录中)
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.
谁能告诉我Android.mk
文件中缺少什么? (我从Soundrecorder应用程序中获取了代码)
Can anyone tell what is missing in my Android.mk
file? (I took the code from the Soundrecorder app)
是否需要编辑其他文件以将应用程序包含在/packages/apps
文件夹中?
Is there any other file that needs to be edited to include an app into /packages/apps
folder ?
推荐答案
步骤如下:
- 将
MyApp
文件夹放置在/packages/apps
下. - 在
/packages/apps/MyApp
中添加Android.mk
(您应该工作). -
在.mk文件中的
PRODUCT_PACKAGES
中添加MyApp
条目="noreferrer">/build/target/product
(缺少该步骤).例如.为sdk
构建时,sdk.mk
中的条目为
- Place
MyApp
folder under/packages/apps
. - Add
Android.mk
to/packages/apps/MyApp
(yours should work). Add
MyApp
entry toPRODUCT_PACKAGES
in the target product.mk
file under/build/target/product
(missed the step). E.g. when building forsdk
, the entry insdk.mk
is
PRODUCT_PACKAGES := \
... \
SomeApp \
MyApp
这篇关于Android AOSP-将应用程序添加到/packages/apps的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!