Android app that makes a phone call

16 Aug

The other day, it something like a week ago, I thought of if Varsity(something I’m building) could make a call. So I got down to digging out information. Anyway so, its all got to do with intents. A while ago I did, an email intent, I am mentioning this because its really similar. Basically when describing the intent you pass in the parameter Intent.ACTION_CALL.
Maybe to understand this you have to put into consideration what an intent is. Intents are the little messages that are passed in between Activities, say like in this case between our app and the phone app. We first have to describe this – that it will launch the call.

String num="0123456789";
Intent callIntent = new Intent(Intent.ACTION_CALL);
callIntent.setData(Uri.parse("tel: " + num));

That should do it.

Leave a comment

Posted by on August 16, 2012 in Android, Android tutorials


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: