Xamarin for Android Development – Part 1 of 2

Xamarin for Android Development – Part 1 of 2

There are lots of frameworks for mobile application development. A popular framework used to develop mobile applications. This is the first part of a two-part series on the framework. In the first part of the series, we will learn about what Xamarin is and how we can set up our system to be ready for developing applications using Xamarin forVisual Studio

The first thing you need to do is download and install Xamarin for Visual Studio so that you can use it to develop applications for both iOS andAndroid.

Getting Started

The minimum requirements for getting started are given.

  • Windows 7 or higher
  • Visual Studio 2010 Professional or higher
  • Xamarin’s plug-in for Visual Studio

After you sign up for a new account, you would need to install Xamarin on the website. The link is at http://www.xamarin.com.

You can get a 30-day free trial of the Business Edition of Xamarin at this link.

You should install the following to get started.

  • JDK 1.7: http://download.xamarin.com/Installer/MonoForAndroid/jdk-7u71-windows-i586.exe
  • Android SDK: http://dl.google.com/android/installer_r24.0.2-windows.exe
  • GTK#: http://download.xamarin.com/GTKforWindows/Windows/gtk-sharp-2.12.26.msi
  • Xamarin Studio: http://download.xamarin.com/studio/Windows/XamarinStudio-5.7.0.661-0.msi
  • There is a version of Xamarin for Windows with Xamarin.iOS and Xamarin.Android.

You should take a look at this link to learn how to get started with the XamarinAndroid Player.

The plug-ins won’t work inVisual Studio Express Edition. If you want to develop applications using Visual Studio, you should have a Xamarin account; if you don’t, you’ll see a popup asking you to create one and then use Xamarin in yourVisualStudio. If you want to check the settings in your Xamarin app, you need to click on Tools to check them.

You should point to the path where the SDK is located in your system.

Working with Xamarin

The AXML layout is what most of the applications start with. The AXML format is used to describe the user interface on the device. The Main.axml file flutter tutorial is shown.

LinearLayout is an example of a linear layout.

If you want to deploy your application to an emulator that matches your target machine, you can use the visual studio ide.

These are the steps to start developing an application.

Click to open the file. Select the template you want to use Provide a name for the project.

A new project will be created in the studio You would find the solution folders when you create a new project.

  • The application would need a lot of files, such as text, xml, fonts, music, and video.

This would hold the files that the application needs. This would contain the assembly data.

This would be the assembly data. In other words, strings, images, and so forth, would be contained in the resources. It can be used to create the user interface of your application.

Assets can be placed in the Assets folder with your application. The AssetManager would allow you to access these assets.

LoadDefaultAsset is a public class that protects an override void on OnCreate.

You can use the Activity attribute on top of your activity class to include the main launcher, icon, and label. An activity class would look like this.

The public class SampleActivity is a protected override of the void on the base. “Button Clicked…”

A sample AXML file would look like this:

LinearLayout is an example of a linear layout.

The complete code for a simple application is provided here. The Activity class is extended by the SimpleAndroid Activity class.

Using System, using App, using OS, using Internet.com.

Suggested Readings

In the first part of the series, we had a basic idea of Xamarin, its benefits, and how to start using it. Happy reading


Leave a Reply

Your email address will not be published.