Sending an SMS

With this fourth recipe on TheInternship project, we will pick a contact from the contact list of the user and send an SMS to him/her.

How to do it...

Let's look at how to send an SMS.

  1. Create a new activity named SendActivity and add the following code to the OnCreate() method:
    // On click of the contact field, run a contact selection Intnet. FindViewById<TextView> (Resource.Id.ppl1).Click += delegate { //Concrete description of our Intent. Here we want to pick an User Intent contact_intent = new Intent(Intent.ActionPick, ContactsContract.Contacts.ContentUri); //More specifically, we would like the phone number contact_intent.SetType(ContactsContract.CommonDataKinds.Phone.ContentType); // Start the Intent and provide a response code. ...

Get Xamarin Studio for Android Programming: A C# Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.