4

好的,情况如下:

我正在为客户开发应用程序(或尝试这样做)。它需要很多(如果不是全部)与内置 SMS/MMS 应用程序相同的功能。所以,我想——嘿!Android是开源的吧?我可以申请并根据我的需要进行修改,对吗?

因此,我在 github 上找到了 MMS/SMS 应用程序的代码(出于某种原因,基于 AndroidManifest 文件,它调用了我构建的项目“ConversationList”)。但是我得到了涉及 import com.google.android.mms.* 包和其他几个包的大量错误。

每个人都在说“这是一个私有/内部包”,“下载整个 AOSP”。但是,我如何在 Windows 上执行此操作,为什么我不能只下载适当的包以在程序中使用?

我要做的就是在 Eclipse 中构建一个项目,将其部署到我的手机上,然后修改必要的代码。如果 Android 是开源的,为什么会有这么多秘密/内部包?这令人沮丧。

有什么建议吗?

4

2 回答 2

5

So, I found the code on github for the MMS/SMS application (for some reason, based on the AndroidManifest file, it calls my project I built, "ConversationList"). But I get TONS of errors involving the import com.google.android.mms.* package and a couple other packages.

AOSP applications like this are designed to be built as part of a firmware image, not as standalone apps.

But, HOW do I do this on Windows

Most likely, you don't. Cygwin might work. More likely, you will need to use OS X or Linux, such as running Linux in VirtualBox. And the result of your build will not run on anything, except as part of a firmware build that you use to replace the firmware on a device.

WHY can't I just download the appropriate packages to use in the program?

Because that application is designed to be built as part of a firmware image, not as a standalone app.

ALL I want to do is build a project in Eclipse deploy it to my phone, and then modify the necessary code.

Then find a project that is designed to be built as a standalone app as your starting point. Or, work on modifying the project you are trying to use to work as a standalone app, by ripping out all the functionality that depends upon things that are not in the app itself.

If Android is open source, why so many secret/internal packages?

They are not "secret". They are part of the firmware.

For example -- since you appear to be familiar with Windows -- it is entirely possible that "apps" like Control Panel are not designed to be built independently from the Windows OS. If you were able to download the source code to Windows and tried to load Control Panel into Visual Studio, it is eminently possible that you could not create some standalone CPANEL.EXE file just via that one project. Rather, you would need to use a customized Windows OS build process to build the whole OS, which would then contain a CPANEL.EXE that would run within that built version of the OS.

Most of the AOSP apps work this way. Some have been forked to create standalone apps -- K-9 Mail came from the early version of the AOSP email app. I have no idea if anyone has done this with the stock AOSP Messaging app or not.

于 2012-05-12T23:59:27.643 回答
3

您可以改为 fork TextSecure[0],因为它不是系统应用程序,但看起来与股票消息传递应用程序非常相似。AOSP 应用程序需要安装在 /system/app 上,它需要 root 并且可能不是您的客户想要的。

请注意,此应用程序是 copylefted (GPLv3),因此如果您分叉,您必须根据 GPL 条款授予您的客户访问源代码的权限。

[0] https://github.com/WhisperSystems/TextSecure

于 2012-07-07T22:32:40.793 回答