Does the Android SDK have the ability to to trap a Dropped Call event? If so, what is it called? I've been prowling the documentation looking for it.
Is there a difference between a hang up, and a dropped call?
Does the Android SDK have the ability
to to trap a Dropped Call event?
No.
Is there a difference between a hang
up, and a dropped call?
To humans, yes. To Android, no.
Just a bit of additional information.
The Android system does know when a call is dropped for what ever reason, i.e. Congestion, No Circuit Available etc. However none of this information is parsed through to the sdk. In the source at some point android basically mashes a whole bunch of telephony related information into a few, excruciatingly vague sdk calls. For example - the only indication we get of a call end is the changed in a PhoneStateListener from OffHook to Idle. Which literally encompasses every single reason for a call ending.
Even different states of the call are mashed together. Where as we should be able to get information like whether the phone is alerting the b party or actually has an active connection, this is reduced to the three states available, offhook, idle and ringing - note ringing is only when your device is ringing, not when the person you are calling phone's ring.
Sorry to be another bearer of bad new, but alas. all we can hope for is better support at a later stage
Related
I'm implementing a function where an outgoing alarm is triggered, f.e. If the phone falls down and doesn't move for 60s afterwards. Then, between 1-5 numbers should be called. Example of how it should work:
Phone falls down and doesnt move for 60s
Number 1 is called
Number 1 doesn't accept call in 20s
Number 2 is called
Number 2 doesn't accept call in 20s
Number 3 is called
Number 3 accepts call, alarm is being terminated
The alarm is triggered correctly, and I can make a call. But I couldn't find anything on how to determine if a call was accepted after x seconds, and how to start a new call then. Any help / sources?
Edit:
Via the PhoneStateListener I'm now able to see if the call was cancelled. However if it's not, I can't get the actual state, so I don't know if it's still ringing, if it's actually calling or if it has gone to the mailbox. In the description of the CALL_STATE_OFFHOOK it's pretty clear that you can't see wheter the call was answered or the number has just been dialed. Is there any workaround for that, maybe even with rooting the phone or something like that? Any hint is appreciated.
It seems like this isn't possible.
The documentation for Intent.ACTION_CALL states that it doesn't return an output (at least I guess that's what the oh-so-helpful "Output: nothing" comment means).
Similar questions here and here have not gotten any useful positive responses.
While using an intent makes it NOT possible since you can't check the state, that's NOT the way you should call the telephony service since you want your program to be in control. The best way is to this is to:
a) enable telephony permissions in your app:
b) instantiate the Telephony manager class in your activity, then
c) handle Android call states dial/listen in your activity to store the previous state. If it was 'ringing' and current state is idle a they cancelled the call. If the current state is off-hook and the previous state was ringing, they answered the call. See a working sample here:
http://www.compiletimeerror.com/2013/08/android-call-state-listener-example.html
Let me summarize my problem and what I would like to achieve.
I have a SonyEricsson X10i phone with Android 2.3.3. I realized that sometimes my phone not receiving calls even if it indicating full coverage. I checked myself in the MSC/VLR and it indicates that I registered and my phone is currently active (and also there is no IMSI DETACH flag), so it should working correctly (only the last Activate Date is a little bit old ~couple of hours, which can be good as well, without SMS/Call/Location Update), as I mentioned before the phone indicates full coverage and it seems it’s on the network. But when I tried to call it I only reached the Voice Mail.
In the MSC/VLR I see No Paging Response Cause for the call, but the phone does nothing. I tried with other SW version (4.0.3 ICS), but the same result. But I not noticed similar behaviour with a different handset (same type).
Sorry for the long summary.
So because what I described above, I ‘m trying to write an application/service which will perform GSM/UMTS location update in 15-20 minutes, but I couldn’t find any kind of procedure in android.telephony.gsm.GsmCellLocation, android.telephony.TelephonyManager which will do this for me.
My other concern is the
getState()/setStateOutOfService()/ setState() procedures from ServiceState class…
It seems they not really working. For example, when I first call the getState() I always get back STATE_OUT_OF_SERVICE, which is not true…
When I’m set the state to STATE_POWER_OFF or STATE_IN_SERVICE, at least I get back that state from getState() afterwards, but the phone does nothing for that . (Not even indicate out of coverage,etc…)
Every suggestion/comment are welcome.
I have also seen this problem many times (2 phones from the same manufacturer as yours). From your question, I understand that you want to force the phone to send an MM periodic location update (which it should be sending anyway).
This is too low level, and there's nowhere you can force this directly in the programming interface. The mobility management procedure is part of the phone stack, and is specified in detail in 3GPP TS 24.008, available from www.3gpp.org. Paragraph 4.2.2 defines when the phone is supposed to send these location updates.
The only other thing would be to try by indirect means to force the phone into a condition where it would send a location update. You might be able to do that by trying to select another network manually. If it's successful, and you then manually re-select your home network, then you would trigger a location update. If it's rejected and falls back to its home network, then I think a location update would be triggered as well.
But there would also be small costs to this - battery use while it does a networks scan, and time lost while it scans and does manual network selection.
(My personal experience is that the lost calls don't happen often enough to justify this.)
Is it possible to find another phone number is on or off.
I think it depends on service provider and in India there is no service provider gives information. In Uruguay it is possible!! and if it is possible so how i can check this in India?
Thanks in advance.
There is no standard for determining if a cell phone is powered on or off. Most of us can tell if a cell phone is powered off when calling a phone by the fact that it goes to voice mail immediately. Usually there is no ring-back when this occurs but it may differ slightly from carrier to carrier. The other issue with using this as a determination is that the user can select to avoid the call which if they are fast enough may give similar results to the caller.
You may be able to make a determination on whether a cell phone is on or off using call progress analysis, but for the fore mentioned reasons it will not be 100% accurate. One way to get call progress analysis is to use Call Control XML (CCXML) with a platform that has good call progress analysis like Voxeo's Prophecy. If you look at their documentation on CCXML there is a section on outbound dialing that covers call progress analysis. You would look to see if there was no ring-back before the answer to determine if the phone is off.
My app requires to know whether the other party has recived my call or not. I need to execute some logic after 1 or 2 rings.
To do this I have overridden onCallStateChanged method, and check for CALL_STATE_RINGING state. But it looks like this method is not 100% perfect since it takes some time for the ring to happen after the state changes to CALL_STATE_RINGING.
Any suggestions on how to go ahead with the implementation? One approach is to have some delay of 2 to 3 seconds after the state changes to CALL_STATE_RINGING. But this approach is really dumb since the delay will vary between telcos. Any other ideas?
Not sure if is possible to detect when the other party picked up, still i think this link can be useful to you
How do I get state of a outgoing call in android phone?
I am not able to detect when outgoing call has been answered, I have registered BroadcastReceiver for PHONE_STATE broadcast, but onReceive() gets called only when number is dialed and when call has ended.
Edit: If it is not possible with current API (1.5 or 1.6) please enlighten me ?
Android does not have specific listener yet for making sure whether the call(outgoing call) is answered or not. The moment a number is dialled it goes to off_hook state (in case of outgoing call). This is one one of the gap which android telephony has to yet come up with
I don't see you getting any specific answers, so I try with a general one that may help. If you are referring to calls going out the PSTN (Public switched telephone network), you won't be able to detect when the far side answers. The way the phone network is structured, you won't be able to get that information except in very special cases. Usually what you see on the handset is the moment the call is being routed out of the cell network.
As for in network (same subscriber), it may be possible to get that information, but I'm not sure. You may want to look into CDMA or the protocol used by your carrier to see if it is going to even be possible to get farside information.