The default template for Android projects has a little more built-in functionality than iOS. Android user interface layouts are defined in XML files that are readable by humans and editable. However, Xamarin Studio has provided an excellent design tool that allows you to drag and drop controls to define your Android layouts. Let's add some more features to your application and start using the Android designer.
Return to Xamarin Studio and carry out the following steps to add features to your app:
Open the Android project you created earlier in this chapter in Xamarin Studio.
Navigate to Resources | layout in your project and open
Main.axml
.You will see the Android designer open in Xamarin Studio.
Drag TextView from the Toolbox section on the right to the layout just above the button labeled Hello World, Click Me!
Type some default text such as
Count: 0
into the label.In the Properties pane on the right, you'll see the id value is set to
@+id/textView1
. Let's change...