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.
Related
I need to start an action after a call has ended. No button clicks or anything like that, I need it for both incoming and outgoing calls. I understand I have to deal with PHONE_STATE_IDLE.
Does this mean I have to have listeners to listen to incoming and outgoing calls, and when they start and finally when the pgone goes IDLE after that?
Or is there a simpler way. I checked the Telephony docs from Android, but the 3 PHONE_STATE cases mentioned there are a bit vague for me.
Also , most answers related to this are both old and lead to a dead-end (for me, atleast). Anything concerning Marshmallow, or better yet Oreo, would be of great help.
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.
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 ;)
I am trying to build an NFC enabled application that transmits data to another device via Android Beam (pushing a NDEFMessage).
While I know there is a success callback void onNdefPushComplete(NfcEvent event), I can't find a failure callback, which would be really useful.
I tried to think of other way to sort of guess whether the transfer happened, if it succeeded or failed but cannot really find anything satisfying. Even a dirty timer would not work since I cannot know for sure when and even if the user actually starts the beam.
I feel pretty much bound by the API since the OS is handling most of the functionality and the application is only providing the message to send.
Any suggestions, something I might have missed? I'd rather avoid rooting the device if possible, but if it cannot be accomplished without tinkering with the core NFC code, then so be it.
Cheers
No, there is no such callback. Or a notification or anything that would give you a clue that things didn't worked.
Unfortunately.
In general the Android Beam API has not been designed with error handling in mind.
I have been working a bit on reading radio logs to retrieve USSD replies, rather than the aidl,
though I am not yet sure which suits my purpose better. I am still hoping to trap menus as well as simple exchanges.
Anyway, I can now read the replies programmatically, but they still land onscreen in a system dialog that I need to press OK to dismiss.
Is there a programmatic way to dismiss this system dialog?
What I am writing is some code that will execute my own USSD (ie 3rd party from carrier) on an android used without human interfacing (there is no one present to press OK). It's used more to send info to the server than to receive info back. I did this on an old Wavecom modem ages ago, so it has been a frustration discovering how difficult this was to do in Android.
In as much as the documentation is minimal, this app actually does a good job intercepting USSD responses:
https://github.com/alaasalman/ussdinterceptor