How can incoming calls be answered programmatically in Android 5.0 (Lollipop)?

Update with Android 8.0 Oreo Even though the question was originally asked for Android L support, people still seem to be hitting this question and answer, so it is worth describing the improvements introduced in Android 8.0 Oreo. The backward compatible methods are still described below. What changed? Starting with Android 8.0 Oreo, the PHONE … Read more

How to make a phone call from a flutter app

Call the launch method from url_launcher package: launch(“tel://214324234”); Here’s the complete code: import ‘package:flutter/material.dart’; import ‘package:url_launcher/url_launcher.dart’; class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return new MaterialApp( title: ‘Flutter Demo’, home: new Home(), ); } } class Home extends StatelessWidget { Home({Key key}) : super(key: key); @override Widget build(BuildContext context) => new Scaffold( … Read more

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

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://” + number) else { return } UIApplication.shared.open(number) OR UIApplication.shared.open(number, options: [:], completionHandler: nil) Make sure you’ve scrubbed your phone number string to remove any instances of (, ), … Read more

Calling a phone number in swift

Just try: if let url = NSURL(string: “tel://\(busPhone)”) where UIApplication.sharedApplication().canOpenURL(url) { UIApplication.sharedApplication().openURL(url) } assuming that the phone number is in busPhone. NSURL‘s init(string:) returns an Optional, so by using if let we make sure that url is a NSURL (and not a NSURL? as returned by the init). For Swift 3: if let url = … Read more

How to make a phone call programmatically?

You forgot to call startActivity. It should look like this: Intent intent = new Intent(Intent.ACTION_CALL); intent.setData(Uri.parse(“tel:” + bundle.getString(“mobilePhone”))); context.startActivity(intent); An intent by itself is simply an object that describes something. It doesn’t do anything. Don’t forget to add the relevant permission to your manifest: <uses-permission android:name=”android.permission.CALL_PHONE” />

Make a phone call programmatically

To go back to original app you can use telprompt:// instead of tel:// – The tell prompt will prompt the user first, but when the call is finished it will go back to your app: NSString *phoneNumber = [@”telprompt://” stringByAppendingString:mymobileNO.titleLabel.text]; [[UIApplication sharedApplication] openURL:[NSURL URLWithString:phoneNumber]];