问题
To illustrate the problem, let's say I want to write an app that allows call recording.
I know that I can't record the caller and called audio due to the OS restrictions on the systems current phone activity. The only way to pass this restriction is by "hacking" the OS code, which will require in the minimum a root access from my users.
So, is it possible not to hack the android phone activity, but to write one of my own, that when an incoming call intent rises, the user will be able to choose which activity to launch ?
If so, a few pointers would be nice :)
Thanks.
回答1:
I could be wrong, but I have not seen any phone recorders that work across all platforms because it seems to be a hardware kernel level issue and not an OS/API issue.
As far as replacing system applications you have to root the phone to do that anyway, unless I am misunderstanding what you are asking.
Of course all the android source is available so you can poke around in that all you want and see if there is anything that has been missed
回答2:
You can define an activity that responds to the Intent.ACTION_CALL intent, which will cause the user to be prompted to choose between your app and Phone when they do something that initiate dialing a number (the new Skype app does this, for instance).
However, there are some big limitations. You will not be able to intercept incoming calls. And you will not be able to access the API to actually make a call with the phone (again, think of Skype--they handle the intent by placing a call through their own service, not through the Phone's modem).
来源:https://stackoverflow.com/questions/6865414/is-it-possible-to-write-a-new-phone-activity-and-if-yes-then-how