phone-call

android Call Forwarding programmatically

﹥>﹥吖頭↗ 提交于 2019-11-30 06:57:07
问题 I want to forward any calls received to another predefined phone number. I have searched forums and found some contradictory answers. so i m confused. First I looked at this post https://stackoverflow.com/a/5735711 which suggests that it is not possible through android. But another post has some solution. https://stackoverflow.com/a/8132536/1089856 I tried this code from second post, but i m getting the following error message: "Call Forwarding connection problem or Invalid MMI Code." String

I want to read call logs in the android [duplicate]

孤人 提交于 2019-11-30 05:29:06
Possible Duplicate: How can I retrieve recently used contacts in android? I want to read recently used contacts. Anyone know how to do this? alezhka 1. Create observer: class CustomContentObserver extends ContentObserver { public CustomContentObserver(Handler handler) { super(handler); } @Override public boolean deliverSelfNotifications() { return false; } public void logCallLog() { long dialed; String columns[]=new String[] { CallLog.Calls._ID, CallLog.Calls.NUMBER, CallLog.Calls.DATE, CallLog.Calls.DURATION, CallLog.Calls.TYPE}; Cursor c; c = getContentResolver().query(Uri.parse("content:/

My streaming audio player continues to play during a phone call - cannot make it stop! (Android)

╄→гoц情女王★ 提交于 2019-11-30 05:02:51
问题 I have an app that consists of multiple activities and one service. The primary activity is a UI for streaming audio. When the user pushes the play button, the service is started, streaming the audio and reading metadata. The metadata is then pushed to the UI if visible and the Notification Bar. Everything functions as expected until a phone call comes in. I had assumed that by using the standard media player, Android would handle switching audio between the stream and phone call itself. So I

Android Media Recording: java.lang.RuntimeException: start failed

 ̄綄美尐妖づ 提交于 2019-11-30 04:16:28
问题 I am working on records a phone calls. When i start a record a phone call then it's unfortunately stop. & it's gives error MediaRecorder start fail -2147483648 . I refer this answer link. But i don't understand. Please tell me what is the problem in my code? Here is my Code. public class IncomingCall extends BroadcastReceiver { Context pcontext; private static MediaRecorder recorder; private boolean recordedStart = false; @SuppressWarnings("unchecked") public void onReceive(Context context,

How to ask permission to make phone call from Android from Android version Marshmallow onwards?

孤人 提交于 2019-11-30 01:29:48
问题 I am trying to make a phone call from Android, and I've set run time permissions as well. And it asks whether to allow making phone calls. But when I press allow, the app crashes: This is how I implemented it: private static final int REQUEST_PHONE_CALL = 1; Intent intent = new Intent(Intent.ACTION_CALL, Uri.parse("tel:" + "+918511812660")); if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { if (ContextCompat.checkSelfPermission(MainActivity.this, Manifest.permission.CALL_PHONE)

iOS How to check if currently on phone call

女生的网名这么多〃 提交于 2019-11-29 23:31:49
I have look around and all I can find is checking the callState of CTCallCenter. However, this works by listening to an event - which depending on whether the application is active/suspended/resumed the event can be raised at different time. What I need is rather than listening to event and got told when call is connected, I want to decide myself when to ask if the call is connected. Use case: When phone call is connected - user knows and will always click on the app icon, which will open the app. At this time I just want to run a quick function to check if currently on call or not. Is this

How to make phone call in iOS 10 using Swift? [duplicate]

跟風遠走 提交于 2019-11-29 19:48:37
This question already has an answer here: Calling a phone number in swift 20 answers I want my app to be able to call a certain number when a button is clicked. I've tried to google it but there doesn't seem to have one for iOS 10 so far (where openURL is gone). Can someone put an example for me on how to do so? For instance like: @IBAction func callPoliceButton(_ sender: UIButton) { // Call the local Police department } You can call like this: if let url = URL(string: "tel://\(number)") { UIApplication.shared.openURL(url) } For Swift 3+ , you can use like guard let number = URL(string: "tel:/

Checking if call being made is international

試著忘記壹切 提交于 2019-11-29 18:12:07
I'd like to check if a call being made is international or not. I have the SIM number which I obtain by using TelephonyManager.getLine1Number() and also the Country code ISO of the SIM Card which I obtain using TelephonyManager.getSimCountryIso(). Is there anyway I can find the country code of the number to which the call is being made? I don't think telephonyManager.getSimCountryIso() would help you determine 'to which country the call is being made' as it will return your country's ISO. Moreover, length of ISD codes vary across countries. For some countries it is 1, for some it's 2, for some

handling an incoming call through an app in iphone xcode

自作多情 提交于 2019-11-29 18:01:52
My requirement from a client is to handle incoming calls of iphone, in such a way that any unwanted calls (such as any call that is outside from the address book) should go terminate automatically with just one ring and should go into missed calls. i.e, i need an app that runs in background, detects every incoming call and if the call is from outside the address book contact, should terminate it after one ring. Is it possible to do so? As far as my knowledge you don't have controls to handle the phone. What Record Phone Calls does is not actually recording calls made through the native dialler

Call 911 in Android

孤者浪人 提交于 2019-11-29 17:49:27
问题 I want to call Emergency number using Android SDK. I am using following code to call the number (911). This code works fine for all the numbers except 911 (Emergency Number). When I use 911, then it shows the dialer screen that I don't want. Is there any procedure to call 911 without open the dialer or can we stop the user to edit the number in Dialer screen? Uri callUri = Uri.parse("tel://911"); Intent callIntent = new Intent(Intent.ACTION_DIAL,callUri); callIntent.setFlags(Intent.FLAG