If I use the Android Phone app to call, the app shows a photo from the contact that I am calling.
But, if I use an intent to call the Phone app (below code), there is no photo.
Intent callIntent = new Intent(Intent.ACTION_CALL);
callIntent.setData(Uri.parse("tel:1234567890"));
startActivity(callIntent);
How do I show the contact's photo when calling?
Thanks!
http://developer.android.com/reference/android/content/Intent.html#ACTION_DIAL
I'm assuming you need to pass the Uri of a phone number, and not an explicit phone number.
ACTION_DIAL content://contacts/people/1 -- Display the phone dialer
with the person filled in.
Related
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
I have a plan to make a dialing feature to hide the caller's ID. I have an application with the caller's phone number embedded in the "Dial" button.
In the application the both parties (caller and receiver) can see their own numbers.
I use the following code for the default call:
Intent callIntent = new Intent(Intent.ACTION_CALL);
callIntent.setData(Uri.parse(“tel:”+mNumberEditText.getText().toString()));
startActivity(callIntent);
My problem is to hide both parties' numbers. How do I do this?
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 ?
In one of my apps I'm using the following code to issue a phone call:
Intent intent = new Intent(Intent.ACTION_CALL, Uri.parse(...));
startActivity(intent);
The docs say I do need the following Manifest permission to do so:
<uses-permission android:name="android.permission.CALL_PHONE" />
Is this really required? I do not understand the difference between a phone and a camera feature. When using a phone intent I do need a permission but I don't need permission for a camera intent:
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
...
startActivityForResult(intent, 1);
Is there a list on hardware features that need a permission if fired with the help of an intent and those that don't?
Actually, if you wish to just open the dialer with a specific phone number, without direct calling (needs user confirmation), you can do it without any permission:
Uri uri = Uri.parse("tel:" + PHONE_NUMBER);
Intent callIntent = new Intent(Intent.ACTION_DIAL, uri);
try {
context.startActivity(callIntent);
} catch (ActivityNotFoundException activityNotFoundException) {
// TODO: place code to handle users that have no call application installed, otherwise the app crashes
}
Is this really required?
Yes.
I do not understand the difference between a phone and a camera feature.
Phone calls can cost people money. Hence, if you directly place a phone call (vs. ACTION_DIAL to just put the number in the dialer), Android wants the user to agree ahead of time to allow this.
Taking pictures with the camera does not usually directly cost users any money.
Is there a list on hardware features that need a permission if fired with the help of an intent and those that don't?
Not really.
When you issue a request to the camera, it merely opens an app requiring user interaction before it can do anything.
Phone calls open an app with the phone number already entered so you merely just have to press a button.
There's a much higher risk that you'll accidentally call someone than if you were to accidentally take a picture (Which you could just delete if taken accidentally.)
I want the user to select a contact to which my application would send a SMS. How do I ensure that when I start an activity with ACTION_PICK intent only those contacts with mobile phone numbers are displayed?
Currently, I'm starting the activity like this:
Intent intent = new Intent(Intent.ACTION_PICK, Phones.CONTENT_URI);
You can use:
intent.setType(android.provider.ContactsContract.CommonDataKinds.Phone.CONTENT_TYPE);
However when used the contact picker will display a list of all the phone numbers with the contacts name above each one so if a contact has multiple numbers you will see multiple entries for that contact
I suspect it is not possible. You would need a separate Uri, one that the Phones content provider used to restrict the output to mobile phones only. I do not see that such a Uri exists.
You can still have an activity pick only users with phone numbers, but you will have to write the activity yourself, using a managedQuery().
Reading the code, it looks like you can specify the UI.LIST_CONTACTS_WITH_PHONES_ACTION action in the intent to show only contacts with phone numbers. I haven't tried this out though. Also, this action has the same effect as the contact setting "Only contacts with phones"