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.
Related
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
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">
I am creating an application from which the user can call people. In this application I would like to give the option of using either the phone's dialer or other VOIP applications such as Skype or Lync (which incidentally are both Microsoft software). My only problem is that they don't seem to be registered to listen for android.intent.action.CALL (this gives me the phone), but only for android.intent.action.CALL_PRIVILEGED - via which I cannot reach the phone's dialer (I'm guessing that's the privileged part). I'm developing on a stock Nexus 4 btw.
Is there a pretty way that I can launch my intent and be given the option of both the dialer and also Skype/Lync?
Right now my calling the intent looks like this:
Uri numberUri = Uri.parse("tel:" + number);
final Intent intent = new Intent("android.intent.action.CALL_PRIVILEGED");
intent.setData(numberUri);
mContext.startActivity(intent);
Feel free exchange the contents of the intent for Intent.ACTION_CALL - I'm doing it all the time at the moment.
Sorry Dear this cannot be possible.
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 ?
I am working on an application where I want to make a video call programmatically. I am using API level 8 for my application.
I have Samsung Galaxy S, where I can use video calling functionality. Using intent action ACTION_CALL, I can start voice call.
How to start video call? Which intent extra I have to provide? Is there any particular field which indicates that current outgoing call is video call? If yes, how can I set that field to indicate that I want to invoke a video call?
Here is the code for creating video call on my Samsung Galaxy Tab (Android 2.2)
Intent callIntent = new Intent("com.android.phone.videocall");
callIntent.putExtra("videocall", true);
callIntent.setData(Uri.parse("tel:" + [your number goes here]));
activity.startActivity(callIntent);