Lets go Mobile!
One of my interests in software development is in mobile devices, websites and applications. I have blogged about it in several topics. But this was all about mobile websites and optimizing your website for mobile devices.
In my search for new and interesting things, I ended up with an idea to develop a native app. Because I don’t own any apple device (proud of that!), I wanted to develop a native Android application.
A good starting point for creating Android apps is, of course, the Android docs. But there is one disadvantage, it is Java. I don’t really hate Java, but it is just not for me. I don’t have an IDE set up for Java, I don’t know the language as well as c#, so I didn’t really feel like working with c#.
That is when I found Xamarin. It was actually Scott Hanselman who blogged about it. If you don’t know who Scott Hanselman is, please read his blog! Even better, if you have the change, go and see him when he is speaking.
Xamarin lets you develop native apps in Visual Studio using c#. Everything is strongly typed and works how you expect it to work. The debugger starts the Android emulator and lets you easily test your application.
Just one bad thing about Xamarin, the pricing! It is very expensive, but you can download a 30 day trial.
Setting up your environment
Before you can use Xamarin, you need to set up your environment. I assume you already have Visual Studio installed.
To start using Xamarin, you need to install the following:
First install the Java JDK. In my case I needed to updated the PATH environment variable (Control Panel -> System -> Advanced System Settings -> Environment Variables) and add the bin folder to this variable. In my case C:\Program Files\Java\jdk1.7.0_51\bin.
After that, unzip theAndroid SDK to a location of choice. Run the SDK Manager as administrator. And install all desired packages.
The installed APIs can be selected from within Visual Studio in the Project Properties.
Now this is done, we can install Xamarin. When this the installation is completed, start Visual Studio and configure it. Go to tools -> options and select Xamarin. In the Android Settings tab Select the Android SDK location. And that’s it. Ready to go!
When you open Visual Studio and select new project, you will find a new option in templates, Android. By selecting this option, you will find several Android applications. Most of it just change the API level.
This can simply be changed in the properties window of the Project.
The Xamarin docs are a good place to start. They have a lot of good tutorials to get started. In my next posts, I will post about native apps and code!
Latest posts by Vincent Keizer (see all)
- EntityFrameworkCore and IDesignTimeDbContextFactory - April 20, 2018
- Posting a form with files with jQuery Ajax - January 17, 2018
- EF Code First Index Column not created - March 17, 2017