Android AOSP-将应用程序添加到/packages/apps [英] Android AOSP - adding app to /packages/apps

查看:565
本文介绍了Android AOSP-将应用程序添加到/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 ?

推荐答案

步骤如下:

  1. MyApp文件夹放置在/packages/apps下.
  2. /packages/apps/MyApp中添加Android.mk(您应该工作).
  3. .mk文件中的PRODUCT_PACKAGES中添加MyApp条目="noreferrer"> /build/target/product (缺少该步骤).例如.为sdk构建时,sdk.mk中的条目为

  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

这篇关于Android AOSP-将应用程序添加到/packages/apps的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆