In this case study, we'll be creating a new Android application that will have a button which that show a new text view when clicked. We'll also be writing UITest for this application:
- Create a new blank Android application project in Visual Studio, name it ButtonWidget, and click OK:
![](https://static.packt-cdn.com/products/9781788296243/graphics/assets/44e1124c-48aa-4bbd-b076-a79644b5d102.png)
- After creating the project, open the Main.axml file from Resources | Layout in Solution Explorer.
- Then, add a text view and a button to the view from the Toolbox on the left.
- Give each of these IDs to identify them in the code. You can select them, then show the property window, and give them IDs there:
![](https://static.packt-cdn.com/products/9781788296243/graphics/assets/9644673b-558e-4368-bf9a-a68fa792e42d.png)
- Also, set the visibility of the text view to hidden, because we'll be showing this text only on a button-click:
![](https://static.packt-cdn.com/products/9781788296243/graphics/assets/89de4430-dd45-4a53-ac58-7b194ccdea12.png)
- Now, open the MainActivity.cs file from Solution Explorer:
![](https://static.packt-cdn.com/products/9781788296243/graphics/assets/ee70252c-ca55-41d1-bd4a-b9287031cb93.png)
- In MainActivtiy.cs, add code to show the text view when the button is clicked...