构建Android系统应用程序的简单方法? (以Eclipse为例)
有人可以告诉我是否有一种简单的方法来构建 Android 系统应用程序?
由于 ICS 4.0.3 已经发布并开源,一些替代启动器开始推出,例如 投石机 或 Nova 启动器。它显然是基于系统启动器的,我想知道他们是如何做到这一点的。
如果您克隆启动器:
git clone https://android.googlesource.com/platform/packages/apps/Launcher2.git
并尝试在 Eclipse 中打开它,它将无法工作,因为它使用了 SDK 中不存在的一些类和变量,仅存在于整个框架中。
有没有办法构建或获取它并将其添加到 Eclipse 中(如 SDK 的 android.jar
)并使用 eclipse 构建启动器?如果没有,有人可以向我指出一个使用命令行执行此操作的好教程吗?
Can somebody tell me if there is a simple way to build system apps for Android?
Since ICS 4.0.3 is out and open source, severals alternative launchers start rolling out like Trebuchet or Nova Launcher. It's obviously based on the system launcher and I wonder how they did this.
If you clone the launcher:
git clone https://android.googlesource.com/platform/packages/apps/Launcher2.git
and try to open it in Eclipse, it won't work because it use some classes and variable not present in the SDK, only present in the entire framework.
Is there a way to build or get it and add it into Eclipse (like android.jar
for the SDK) and build the Launcher using eclipse? If no, can somebody indicates me a good tutorial to do this usong command line?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
不。
您也无法从命令行执行此操作。
要将 AOSP 应用程序转换为独立的 SDK 应用程序,您需要找到所有“SDK 中不存在的类和变量”并删除/替换对它们的引用。如果应用程序仍将以减少的功能运行,最简单的方法是删除对它们的引用。对于内部资源的引用,您只需将它们复制到您的项目中并修改
R
值以指向您的本地副本。欢迎您检查“SDK 中不存在的类和变量”,并确定您也可以复制它们(将它们重构到新包中),在这种情况下,您将更新您的项目以引用复制和重构的类。No.
You cannot do that from the command line, either.
To convert an AOSP application into a standalone SDK application, you will need to find all the "classes and variable not present in the SDK" and remove/replace the references to them. The simplest is to remove the references to them, if the app will still run with reduced functionality. For references to internal resources, you can simply copy those to your project and modify the
R
values to point to your local copy. You are welcome to examine the "classes and variable not present in the SDK" and determine that you can copy those as well (refactoring them into a new package), in which case you would update your project to refer to the copied and refactored classes.参见这里:
http://devmaze.wordpress。 com/2011/01/18/using-com-android-internal-part-1-introduction/
它向您展示了如何将所有类恢复到 android.jar 中
See here:
http://devmaze.wordpress.com/2011/01/18/using-com-android-internal-part-1-introduction/
It shows you how to restore all the classes into android.jar
我们需要 root 设备才能将应用程序复制或安装为系统应用程序的理论已被克服。互联网上(不在 Play 商店上)有一些应用程序充当间谍应用程序,可以将其自身安装在系统内/应用程序。我们可以做到这一点,但需要直接获得谷歌的许可(这是我在参考了几个论坛后实际理解的)。
The theory that we need to root our devices in order to copy or install an application as a System application has been overcome.There are some applications on the internet(not on the play store) that act as spy applications that can install themselves inside System/app. We can do this but need permissions from Google directly(that is what I understood actually after referring to several forums).