Developing customized version of built-in SMS/MMS

2019-06-28 07:17发布

问题:

Okay, here's the situation:

I'm developing an application for a client (or trying to do so). It requires much (if not all) of the same functionality as the built-in SMS/MMS application. So, I thought - HEY! Android is open source right? I can take the application and modify to my needs, right?

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.

Everyone keeps saying "it's a private/internal package", and "download the entire AOSP". But, HOW do I do this on Windows, and WHY can't I just download the appropriate packages to use in the program?

ALL I want to do is build a project in Eclipse deploy it to my phone, and then modify the necessary code. If Android is open source, why so many secret/internal packages? This is frustrating.

Any advice?

回答1:

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.



回答2:

You could instead fork TextSecure[0] as it is no system application but looks very similar to the stock messaging application. The AOSP application needs to be installed on /system/app which requires root and might not be what your customer wants.

Please note that this application is copylefted (GPLv3) so you'd have to give your client access to the source code under the terms of the GPL if you fork.

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



标签: android sms mms