Put some message in a call from android app - android

I'm trying to make a call from my android app using the code below
Intent callIntent = new Intent(Intent.ACTION_CALL);
callIntent.setData(Uri.parse("tel:123456789"));
startActivity(callIntent);
Now i'm able to make a call from my device successfully but my requirement is that when the receiver of call (i.e. phone with number 123456789 )....picks the call he should be able to hear some custom message.....this custom message i should be able to give from my andriod app .....is it possible ?...any ideas ?

Related

Specify which app respond to intent startActivity call

I am developing a simple android application for my job
There is a button that when clicked fires an ACTION_CALL intent to a series of phone numbers. the problem is, my phone is opening skype to try and make the call and I want it to use the built in native phone app. this is the code that runs the intent call:
Intent intent = new Intent(Intent.ACTION_CALL);
intent.setData(Uri.parse("tel:989653523"));
startActivity(intent);
I realize that "tel:" protocol can work for both Skype and the native Phone app but how can I make it so the app can always open it using the native phone app?
Well, you need to make an explicit intent call.
Intent i=new Intent (this,theActivityYouWantToStart.class);

Double Intent for call skype/phone

Hi I want with the press of the button to either call a phone number or make a Skype call.
To make the call I use:
Intent phone= new Intent(Intent.ACTION_CALL, Uri.parse("tel:" + "+30 6********7"));
startActivity(phone);
Which pops a Window and let me choose from phone app or Skype. When I choose Skype it tries to make a call with Skype founds and not VoIP Skype call.
I found out that for Skype I need to use :
Intent skype = new Intent("android.intent.action.VIEW");
skype.setData(Uri.parse("skype:" + "user_name"));
startActivity(skype);
Is there a way to chain those two intents and whenever I choose phone app to run phone Intent and whenever I choose Skype to run Skype Intent ?
I know I can make a custom dialog to choose Intent to run and exclude Skype app from Intent phone
But I was wondering if there is a more elegant way built in android or even if I can make the VoIp call from the number it self (finding the user from phone).
Thank you in advance

Making calls programmatically in Samsung Devices in Android

I am trying to make a call using the following code:
String phoneNumber = unItemVal.getText().toString();
Intent callIntent = new Intent(Intent.ACTION_CALL);
callIntent.setData(Uri.parse("tel:" + phoneNumber));
startActivity(callIntent);
Call is getting initiated using Nexus 5 but when I try the same code on Samsung device it doesn't do anything.
What is the difference between Nexus 5 and Samsung Devices?
Thanks!
[EDITED]
Try using Action.PHONE_DIAL instead. (In your code, replace ACTION_CALL with ACTION_DIAL).
Action.PHONE_CALL is not guaranteed to work for all apps. Quoting from the Javadoc:
Note: there will be restrictions on which applications can initiate a call; most applications should use the ACTION_DIAL.
Note: this Intent cannot be used to call emergency numbers. Applications can dial emergency numbers using ACTION_DIAL, however.

How to make a phone call programatically without Intent

I'm new on android and i want make phone call without use the intent.
I know that this code:
Intent intent = new Intent(Intent.ACTION_CALL);
intent.setData(Uri.parse("tel:" + bundle.getString("mobilePhone")));
context.startActivity(intent);
Can i make call in android programmatically without use "Intent"?
Do you have any answer?
Thanks
Can i make call in android programmatically without use "Intent"?
Not from an ordinary Android SDK app. A custom ROM mod certainly could.
You can't, and that's a security feature.
See http://developer.android.com/reference/android/content/Intent.html#ACTION_CALL and http://developer.android.com/reference/android/content/Intent.html#ACTION_DIAL

How to choose third party dials before making a call in android

I have implemented how to make a call in android, it working now but I need choose option before making call if any third party dials app is available in my phone, is it possible do this,
Intent intent = new Intent(Intent.ACTION_CALL);
intent.setData(Uri.parse("tel:" + "mobilePhone"));
context.startActivity(intent);
As a measure of security android does not allow dialing app, i mean you can design your own dialing app and contacts etc but you can only go as far as "dialing the number", all calling etc is done by the system own app
if you want to build the app you need only call this
Intent callIntent = new Intent(Intent.ACTION_CALL, Uri.parse("tel:The telephone number to call"));
startActivity(callIntent);
After this android will take over control and make the call
Do not forget the permission:
<uses-permission android:name="android.permission.CALL_PHONE">

Categories

Resources