-5

I need to implement calling functionality in android app without using the Intent.ACTION_CALL........or existing calling app.....Pl share suggestions or an demo code

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
  • you have to use the default app for calling – Tabish Hussain Dec 09 '16 at 07:57
  • 1
    Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it. – José Luis Dec 09 '16 at 08:52

1 Answers1

0

Use this function

public static void makeCall(Context context, String number) {
    if (!TextUtils.isEmpty(number)) {
        Intent intent = new Intent(Intent.ACTION_CALL, Uri.parse("tel:" + number));
        PackageManager manager = context.getPackageManager();
        List<ResolveInfo> infos = manager.queryIntentActivities(intent, 0);
        if (infos.size() > 0) {
            context.startActivity(intent);
        } else {
            Toast.makeText(context, "Please install a dialer app", Toast.LENGTH_LONG).show();
        }
    } else {
        Toast.makeText(context, "Please add phone number to make a call", Toast.LENGTH_LONG).show();
    }
}
Tabish Hussain
  • 852
  • 5
  • 13