I am making an application to call multiple numbers.
In that app
When I call to 1 person and if the call is answered by the user then the loop should be stopped.
But If the call is rejected then the call should be on next number and loop should be continue.
My problem is I can't detect whether the call is rejected or answered. When I had search on net some people says it is not possible to detect the call is answered or rejected.
Is it really not possible to detect the call in android? If it is possible then how can I do that?
There are many phone states that you can read as follow for incoming phones
http://developer.android.com/reference/android/telephony/TelephonyManager.html
Device states ->
if you answer an incoming call, the phone goes into OFF_HOOK. IDLE
implies that the phone is not doing anything. When a call first comes
in, the state is RINGING until you reject the call (send the phone to
idle) or answer the call (send the phone to OFF_HOOK).
(Android: the three phone states)
Edit: But there's no way to listen states of outgoing calls, maybe you can parse logcat logs or something else but it's impossible as far as i know, but you can try http://developer.android.com/reference/android/telephony/TelephonyManager.html because there's a state named ACTION_PHONE_STATE_CHANGED maybe it can help.
Here's the issue link : issue
Related
I want to make an app that forcibly ends a call by recognizing a specific word when I am on a call.
So, So there are a few questions.
Can the app detect that it is on the phone and end the call if it is on the phone?
Which API should I use?
Is it possible to activate the voice recognition function while on a call?
When I searched, there was a lot of question to hang up the incoming call. But i want to hanu up on a call.
You can use TelephonyManager#getCallState to detect if phone is in call and use TelecomManager#endCall to end active call.
We know there're IDLE and OFFHOOK state for caller, but for my app, we need to know the state of alerting and talking.
Alerting means the ring tone ring and talking means callee answers the call.
We know the framework and native Phone APP already have this information.
However, it needs READ_PRECISE_PHONE_STATE or MODIFY_PHONE_STATE permission, but only manufacturer can have the permissions. How can we work around or hack to get this kind of information(alerting and talking of caller)?
Of course, we also hope users can download our app from google play if the hack is achieved.
We checked the Phone App source code, it calls enforceCallingOrSelfPermission to check the permission before get the information. It seems impossible to get the information because Google protects it on purpose.
What do you think? We almost give it up.
I am working on an android app and i wanted to know if it is possible to receive the numbers or DTMF tone or any such related data at the called party's phone, that the calling party is typing on his/her phone while the phone of the called party is ringing.
Just to make the question more clearer, consider this scenario with two people A and B :
Caller A is calling B.
B's phone is ringing.
A types a sequence or a single digit on his phone while it is still ringing.
Those digits are received at B's phone.
Based on what digit / what sequence it is, an action will be triggered at B's phone (Through my app).
I just wanted to know if the above scenario or anything equivalent or remotely like the same is possible.
Thank you
No. First, we have no access to the in-call audio stream, except perhaps if the phone is in speakerphone mode. Second, I am not aware of any Android device that plays the audio of the incoming call over top of the ringing where the user has not picked up the phone.
I have a fantastic idea for an Android app but I would need to be able to detect when an emergency call is made from the handset. I only need to be able to read the number, I won't be changing it at all.
The documentation for NEW_OUTGOING_NUMBER says:
Emergency calls cannot be intercepted using this mechanism, and other
calls cannot be modified to call emergency numbers using this
mechanism.
Obviously I don't want to find out if I can read an emergency number by dialing it. I was hoping someone here might be able to tell me whether or not I can grab EXTRA_PHONE_NUMBER if the number would be, for example 999.
I want to be able to answer a phone call and hang up the phone call as soon as it starts ringing within my application without having to touch the phone. I have searched but I haven't found much about this. Can some one please help?