Adham
Adham

Reputation: 64854

What is the Uri for phone intent in android?

I found in android docs that Uri is a

Uniform Resource Identifier that identifies an abstract or physical resource, as specified by RFC 2396.

and when I want to make a call from my android application, the intent looks like:

String toDial="tel:"+number.getText().toString();
Intent i = new Intent(Intent.ACTION_DIAL,Uri.parse(toDial));

What is the physical or abstract resource in this case ?

Upvotes: 1

Views: 5338

Answers (2)

jeet
jeet

Reputation: 29199

see Uri syntax from following link:

http://en.wikipedia.org/wiki/URI_scheme#Generic_syntax

note syntax:

<scheme name> : <hierarchical part> [ ? <query> ] [ # <fragment> ]

Here scheme name defines what type of Uri it is: it may have options http, mailto, tel, etc.

next is hierarchical part, which may have information into hierarchy. As number does not have fragments or queryl, its only part avaialable for this URI.

Upvotes: 1

Chirag Shah
Chirag Shah

Reputation: 3674

The URI for phone numbers is documented in RFC 3966

https://www.rfc-editor.org/rfc/rfc3966

The URI can refer to resources identified by a telephone number, including but not limited to originators or targets of a telephone call.

Upvotes: 3

Related Questions