A Hello World Android App in C#
This post is a continuation of Writing Android apps in C# using MonoDroid.
Writing your first MonoDroid project
Now that you have installed and configured MonoDroid and its prerequisites, you are ready to create your first project.
- Open Visual Studio.
- Go to File | New | Project.
- Choose “Mono for Android”. This is a new project type added by the Mono for Android Visual Studio 2010 Plugin.
- Give the project a name and click OK.
You now have a sample MonoDroid app.
Running your first MonoDroid App in an Emulator
Now that you have a sample MonoDroid app, learning to deploy it to an Android device and to test it is the next step.
- Simply press F5 in your “Mono for Android” Visual Studio project. The following screen appears however, there are no running Android devices.
- Click the link to “Start emulator image”.
- Wait until your Android emulator starts and you see the graphical display and not just a text display.
- Select your emulator from the Running Devices list and click OK.
- Wait. It is going to deploy the mono library to your emulator and deploy your app and this can take time.
You application should now be running in your Android emulator.
This is just a sample application that increments a counter and displays how many times you have click the button.
You are now ready to start writing your own application.
Xamarin has multiple Tutorials to help you get a little further along.