Replacing standard Android Dialer - dog chasing its tail - android

The issue seems simple enough - provide your own app that intercepts dial commands, and then dials them itself (imagine a VoIP application that if connected places a VoIP call, and if not connected, uses the phone's cellular capabilities to make the call).
this thread provides all the information you'd ever need - except there's a bit of a glitch:
Not every application seems to be using the same intents. I figure Intent.ACTION_DIAL must be the recommended standard option, and sure enough, most apps do that. Then there's Intent.ACTION_CALL_BUTTON, which seems to be of an oddity (my S3 tells me it has no application handling this action in the first place) and finally Intent.ACTION_CALL_PRIVILEGED.
Doing a little trial and error I figured that "native" apps (I'd call the native call log and contact application native) seem to be using Intent.ACTION_CALL_PRIVILEGED, whereas the rest uses INTENT_ACTION_CALL. And there lies the rub... if you register for both actions, then sure enough you can catch every dial command, but then what do you do with it? You can't fire off an intent with either of these actions since that'll just get you an infinite loop, there's no lower level action, and TelephonyManager conspicuously misses a makeCall method.
Since you cannot dynamically register and unregister intent filters, is there a solution for this dog chasing its tail?

Related

How to detect fake call log created by apps

Play store has numerous apps those creates fake call logs.But, sometimes it's important to detect is that call log real or fake to save yourself being a fool. Can anybody tell me how can we detect same?
If these apps are writing to the actual android call log, I don't think there is much you can do against that.
However, you might want to try the below solution, which can maintain your own call list based on the device behaviour.
In Android you can listen for incoming and outgoing calls, using a BroadcastReceiver. Here is a good tutorial for it:
https://www.codeproject.com/Articles/548416/Detecting-incoming-and-outgoing-phone-calls-on-And
If you implement it correctly, you will only receive events from calls being executed for real. So you can save them in your app's call log.

Get called number of an incoming call in android

My question may look a bit strange.
I want to know if, in android, it is possible to know which number has been called when you receive an incoming call (I'm not speaking about caller id).
For example: let's assume that my phone number is 555-12345, my operator will route to my phone every number starting with 555-12345.
This means that you can call me by dialing 555-12345, but also by dialing 555-12345-37967 or 555-12345-34 etc.
Is there a way to know which number the caller has dialed?
If it is not possible to do this using Android API, would be possible to achieve my goal at lower level? Maybe using a customized firmware?
I was searching for this and not found any answer, the sample app (sipDemo) do not handle incoming call too. Fortunately I found the answer:
mSipManager.getSessionFor(intent).getPeerProfile().getUserName()
Good luck ;)

Android app for monitoring sendBroadcast() messages

I'm adding sendBroadcast() to one of my apps but I won't be consuming the broadcast myself, so I'm wondering if there is a utility app or a debugger component I can use to monitor all sendBroadcast() messages on my device and see if the message I'm broadcasting is getting across.
I know I could probably throw something together, but if there is an exist app (that is known to work ;) that is the preferred route.
Thanks,
Jason
It is not possible to write this as an ordinary SDK app. You cannot listen for arbitrary broadcasts, only specific ones you explicitly register for.
Some broadcast information may be written to LogCat (I forget, haven't looked for that in ages).
Go figure, searched for 30 minutes for this and then found it 10 minutes after typing up a SO question...
https://play.google.com/store/apps/details?id=lt.andro.broadcastlogger

movement of phone causes unexpected result in code

I am developing an android app which makes no reference to the sensor aspect of the phone. At a certain pint the program sends an sms and then sleeps for five minutes. If I move the phone during this sleep period a dialog box displayed earlier reappears. I realise this is rather vague without code at this stage but to start with is this something to be expected. I am wondering if one of the broadcast listeners is being triggered by the movement but even if this is so I cant make the connection with the dialog box. Any pointers will be much appreciated.
Fist off, I would take care of the orientation change possibility by forcing the app into an orientation by using the option in the manifest file.
Second, I would look at what other apps are on the device that might have an affect on this functionality. Assuming by your question, your app uses BroadcastReceivers. If this is the case, provided your business logic permits, use explicit intents ( new Intent(this, )) in place of implicit intents and receivers. If this is not possible because of business logic, then perhaps using permissions to protect against accidental implicit intent receive triggers. Ref: http://developer.android.com/guide/topics/manifest/permission-element.html (its a good starting place anyways).
Without more info on your specific business logic or source code I can't go much deeper into the problem, but my first suggestion would probably give the simplest result. Just remember to set this attribute for each activity that this problem affects.
Steve.

Android incoming call interception , call forwarding

I would like to know how to intercept incoming calls and also how to forward them. I know there are several questions regarding this topic here and elsewhere on the net, but all the answers use the android.intent.action.PHONE_STATE action which is broadcast always after the phone begins to ring and the call screen is shown.
That's why I'm looking for a solution where i could intercept the call in an early stage before any notification (ringing etc..) has been done. I would like to know if maybe this is possible on a platform level in native code and if yes how ? Or perhaps with some kind of trick with the SDK ?
In general, if you can't do it in Java, you can't do it in the NDK. Most of the time the opposite is true: You can't do MOST things on Android in the NDK.
I don't know of a way to do that, and frankly doubt it exists: It would be a huge security hole if you could download an application that would forward calls to another number.
You may want to look at this source code, it may help you : http://code.google.com/p/auto-answer/
None of the existing apps in Android can forward a call based on a given number. All they can do is forward all or nothing. There's one app in particular (cBlocker) that can forward calls on schedule besides blocking incoming and outgoing calls and SMS based on rules.

Categories

Resources