telephonymanager

How to answer automatically and programatically an incoming call on android

浪尽此生 提交于 2019-12-13 05:49:18
问题 I am trying to answer automatically incoming calls on my app once they are detected. My app already detects when I have an incoming call, but still does not answer the phone call. I am using the telephonyManager and I have red this tutorial Answer incoming call using android.telecom and InCallService, this one Answer Incoming Call in Android 6.0, and this one Can't answer incoming call in android marshmallow 6.0. If anyone knows how to do it please tell me. I do not mind change my code I just

Problem on PhoneStateListener to listen to OnCellInfoChanged in delphi firemonkey

爱⌒轻易说出口 提交于 2019-12-13 04:01:22
问题 It will be appreciated if help me. i am writing a program with delphi firemonkey that show mobile cell informations. i need to listen on cell info changes with JPhoneStateListener class. At First i write a class for implement main class as below : type TPL = class(TJavaGenericImport<JPhoneStateListenerClass, JPhoneStateListener>) public constructor create; Destructor Destroy; Override; procedure onCallForwardingIndicatorChanged(cfi: Boolean); cdecl; procedure onCallStateChanged(state: Integer

Android how to hold and unhold active phone call

房东的猫 提交于 2019-12-13 00:57:39
问题 Can anybody let me know how to hold and unhold active phone call? I am trying to do it using ITelephony.aidl but unable to hold the call. Here is the code I tried to hold an active call TelephonyManager tm = (TelephonyManager) CallholdddActivity.this.getSystemService(Context.TELEPHONY_SERVICE); try{ Class<?> c = Class.forName(tm.getClass().getName()); Method m = c.getDeclaredMethod("getITelephony"); m.setAccessible(true); com.android.internal.telephony.ITelephony telephonyService =

Syntax error on tokens, ConstructorHeaderName expected instead & Syntax error on token “(”, < expected

只愿长相守 提交于 2019-12-12 20:35:19
问题 I'm getting two errors stating Syntax error on tokens, ConstructorHeaderName expected instead & Syntax error on token "(", < expected on the line: mTM.listen(callListener, PhoneStateListener.LISTEN_CALL_STATE); ...any suggestions? public class DataCountService extends Service { String text = "USR;1"; String ERROR = Constants.PREFS_NAME; private Timer timer = new Timer(); private long period; private long delay_interval; EndCallListener callListener = new EndCallListener(); TelephonyManager

Background Audio for a Call in Progress - Possible?

放肆的年华 提交于 2019-12-12 04:36:51
问题 I am writing a android app which is supposed to play back a audio file when a call is in progress coming from a specific number .. I tried many approaches.. but all went in vein Separate Thread Listener on Telephone service starting a service in parallel can any one please help me how to proceed regarding this ? Update : I am able to play a mp3 file on call recieve and i am able to play it load on speaker.. but how ever loud i play the calling party is not able to listen to it.... is there

Using TelephonyManager to get location throws java.lang.SecurityException

馋奶兔 提交于 2019-12-12 03:26:36
问题 Hi in my app I am using TelephonyManager to get location. Here is the piece of code: TelephonyManager tm = (TelephonyManager) this.getSystemService(Context.TELEPHONY_SERVICE); doPermissionCheck(); location = (GsmCellLocation) tm.getCellLocation();//throws exception in this line cellID = location.getCid(); lac = location.getLac(); doPermissionCheck(): private void doPermissionCheck() { if (ContextCompat.checkSelfPermission(getApplicationContext(), Manifest.permission.ACCESS_COARSE_LOCATION) !=

Get calls from log by specific SIM

徘徊边缘 提交于 2019-12-12 02:00:07
问题 I want to get calls from Android CallLog.Calls which were made from a specific SIM. Is there's a way to check which SIM was used to make call? The following method allows to check SIM when call is performed and app is running. (TelephonyManager)getSystemService(Context.TELEPHONY_SERVICE).getSimSerialNumber(); How to check which SIM was used to make calls before app is installed? 回答1: In the CallLog.Calls class, there don't seems any field that keeps SIM Information (like which SIM is used

What telephonyManager.getCellLocation() method return

◇◆丶佛笑我妖孽 提交于 2019-12-12 01:51:52
问题 I use telephonyManager.getCellLocation() and i get the result which is [-1,-1,0] but i can't understand from the output. Is this any type of location code because i don't think that it is a kind of lat lang of any position. advance thanks for any help 回答1: You can get locating the position using the LocationManager.NETWORK_PROVIDER instead of LocationManager.GPS_PROVIDER. The NETWORK_PROVIDER will resolve on the GSM or wifi, which ever available. Obviously with wifi off, GSM will be used.

how to listen for a call disconnect on android?

狂风中的少年 提交于 2019-12-12 01:35:55
问题 I'm trying to figure out how to be notified when a call is disconnected - both incoming and outgoing. the intent is to launch something on call disconnect. I looked at the telephnyManager page and i can see getCallState(), but looking at all the constants, i don't see anything like what i'm looking. I'm guessing i need to set up a broadcast receiver - i'm just not sure what i'm listening to... Thanks for helping!! 回答1: Please try this link it have some documentation regarding android

Android - How to immediately endCall with telephonyService?

女生的网名这么多〃 提交于 2019-12-12 01:34:13
问题 In my application, there's a feature that ends outgoing call (and starts other activities) while dialing a certain number (e.g. *123* ) It's currently working, but requires a 200ms delay. Without the delay, the intent cannot be recieved. The delay causes a consequence of multiple screen flickers: my activity shows -> switch to call -> end call -> switch back to my activity public class OutgoingCallListener extends BroadcastReceiver { // ... public void onReceive(final Context context, Intent