I am an experienced c/c++/php programmer. I'm new to Java and Android. To get my learning kickstarted, I would like to modify the mms source code to remove the ability to delete text messages (My kids, ages 12 and 14, have android phones, and knowing that they can't delete text messages should help to keep their conversations clean!). More specifically, I 开发者_如何学编程want to modify the mms code so that you need a pin to delete messages. All of our phones are rooted, so replacing the entire app if need be isn't a problem.
Modifying/creating the source is no problem, my question is more a matter of the correct way to do it. Does android or provide a way to "intercept" that a user has chosen to delete a text message, so that I can patch my own handling code in a separate external app? Or do I need to directly modify and build the mms source code and replace it on the target device to accomplish this?
You would have to modify the exist MMS app and remove the delete functionality. Specifically in the ConversationList and remove delete from the menu.
Also, there is nothing stopping them from downloading another MMS app from the Market that will still let them delete texts.
You are going to need to modify the Android Platform source directly.
Intents provide a way to "intercept" various user actions and route them to external apps. However if multiple apps can handle an intent, the user is allowed to pick which one to use (a bad thing in your case). Even if you wrote a custom SMS/MMS app for receiving/sending messages, the user would still be able to use the default app.
精彩评论