O'Reilly logo

Xamarin Studio for Android Programming: A C# Cookbook by Mathieu Nayrolles

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using form elements

For sure, you will need most of the form elements that Xamarin Studio provides. Form elements will give you a very easy and quick way to get a request and retrieve data from users—as we have done several times with the TextView elements.

Getting ready

Create a new Android project named GUIForm.

How to do it...

  1. CheckBox:

    A checkbox is either checked or not, and it contains an associated label describing the choice that the user is about to make:

    CheckBox cb = FindViewById<CheckBox> (Resource.Id.checkBox1); 
  2. Obviously, checkboxes support the method in order to know whether it's checked or not and to change the associated text. Respectively, these methods are as follows:
    cb.Text = "My Describing Text"; Boolean isMyCheckBoxChecked = cb.Checked; ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required