telephony

Sending DTMF tones over the uplink in-call

99封情书 提交于 2019-11-27 18:23:50
I'm working on a project that requires my app to be able to send DTMF tones on the voice's uplink frequency during an active call. My 2 conditions are: We don't use a customized Android platform We don't need to root the phone I've spent several days doing my homework and am aware that in-call DTMF sending is not supported by the current SDK/standard APIs. However, by using the relevant classes in com.android.internal.telephony I am hoping to mimic how the native Phone app does this. I followed this site on how to use internal APIs for standard 3rd party apps . I've also set myself up with the

How to record call in android? Is it possible?

孤街浪徒 提交于 2019-11-27 15:35:43
I want to record call from android phone. I am using android.media.MediaRecorder pckg. Also used following code: mrec.setAudioSource(MediaRecorder.AudioSource.VOICE_CALL); mrec.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP); mrec.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB); But I didn't succeed in recording an incoming call. Can anyone recommend a tested code snippet? Also, Is this true? http://groups.google.com/group/android-developers/browse_thread/thread/c2bc85eb60ae2aa5?pli=1 http://code.google.com/p/android/issues/detail?id=2117#c226 Standard distributions of Android does

How to end an incoming call programmatically on Android 8.0 Oreo

半城伤御伤魂 提交于 2019-11-27 14:42:43
Up to Android 7.1 it was possible to end an incoming call by using the ITelephony.endCall() method and giving your app the permissions android.permission.CALL_PHONE and android.permission.READ_PHONE_STATE . When doing the same on Android 8.0 Oreo (API 26) , i get this error 12-09 18:11:25.195 16833-16833/li.doerf.leavemealone E/TelephonyServiceCallHangup: Missing permission MODIFY_PHONE_STATE, cannot hangup call Since MODIFY_PHONE_STATE is a protected permission, my app cannot get it. Is there a way to programmatically end an incoming call on Android 8.0+ ? Changed App Target and Compile level

How to retrieve missed calls on Android SDK 2.2

℡╲_俬逩灬. 提交于 2019-11-27 12:34:15
问题 in my app I should do some action when a call comes but not answered by the user. I have searched in the android.telephony and the NotificationManager , but I haven't found a method to solve this problem. Does someone have an idea of how to get to know if there is a missed call on the phone or not ? 回答1: Here is code that can query the call log for a missed call. Basically, you will have to trigger this somehow and make sure that you give the call log some time ( a few seconds should do it)

How to Reject a call programatically in android

北城以北 提交于 2019-11-27 11:59:21
In my app I will maintain a list of contacts. Any calls from contacts in the list will be dropped. They will show under missed calls but the phone will not ring. Finn Larsen First create this Interface: public interface ITelephony { boolean endCall(); void answerRingingCall(); void silenceRinger(); } Then Create this class that extends BroadcastReceiver public class IncomingCallReceiver extends BroadcastReceiver { private ITelephony telephonyService; private String blacklistednumber = "+458664455"; @Override public void onReceive(Context context, Intent intent) { TelephonyManager tm =

Get Signal Strength in Android

时光怂恿深爱的人放手 提交于 2019-11-27 11:56:49
I want to get the Signal Strength of the Device at the point I hit the API call. I have searched on all the related threads and I am not successful yet. So I would like to get the signal strength like SignalStrength ss = null ; // some initialization int n = ss.getGsmSignalStrength(); But while using this, it is obvious that I will get null pointer exception since I have initialised SignalStrength as null. But I don't know how to initialise this. Also that I don't want to use PhoneStateListener because it is triggered only if the signal changes. I am getting the Signal Strength using the below

Rejecting Incoming call in android

孤者浪人 提交于 2019-11-27 11:43:46
I want to reject incoming in android, I have seen so many code from these links. Android: Taking complete control of phone(kiosk mode), is it possible? How? How to Reject a call programatically in android http://androidsourcecode.blogspot.in/2010/10/blocking-incoming-call-android.html http://androidbridge.blogspot.com/2011/05/how-to-answer-incoming-call-in-android.html?showComment=1361478035090#c5468022990217431781 But I am still unable to do it, can anybody tell me in simple and easy steps how to do it? Zubair In order to intercept your call you just have to: 1. Make a package named. com

how to resolve this error “com.android.internal.telephony cannot be resolved to a type” in android

风格不统一 提交于 2019-11-27 08:09:22
i am creating simple call filter application which restrict unwanted calls. i use following code to restrict call but i am unable to resole problem of this line in below code " com.android.internal.telephony.ITelephony telephonyService = (ITelephony) m.invoke(tm); " it show the error message com.android.internal.telephony cannot be resolved to a type in android how to resolve this error . public class CallBlockReceiver extends BroadcastReceiver{ @Override public void onReceive(Context context, Intent intent) { // TODO Auto-generated method stub } private void getTeleService(Context context) {

end incoming call programmatically

十年热恋 提交于 2019-11-27 06:34:33
This is a familiar question in SO. and what I need is to end call programmatically. I have searched a lot... http://androidsourcecode.blogspot.in/2010/10/blocking-incoming-call-android.html http://androiddesk.wordpress.com/2012/08/02/blocking-a-call-without-user-intervention-in-android/ Rejecting Incoming call in android How to programmatically answer/end a call in Android 4.1? http://www.emoticode.net/android-sdk/block-incoming-and-outgoing-phone-calls-programmatically.html How to block calls in android how to block a mobile number call and message receiving in android application development

How to get the country code for CDMA Android devices?

北城以北 提交于 2019-11-27 04:47:32
问题 Does anyone know how to retrieve the country code information for Android devices under CDMA networks? For all others, you can just use the TelephonyManager for that: String countryCode = null; TelephonyManager telMgr = (TelephonyManager)context.getSystemService(Context.TELEPHONY_SERVICE); if (telMgr.getPhoneType() != TelephonyManager.PHONE_TYPE_CDMA) countryCode = telMgr.getNetworkCountryIso(); } else { // Now what??? } I searched a bit but did not find any useful information that would lead