Close
Topic : Anatomy of a Xamarin.Android Application:

Anatomy of a Xamarin.Android Application.

In Our Previous Tutorial - Hello World - We have created an Application to show Message on button. In this tutorial, we will take that example and will explore some of its essential parts. We will Discuss, How Android Applications work so that we can build More Sophisticated Programs. This Tutorial reviews the steps that we took in Hello World Program so that we can understand what we did and begin to develop a fundamental Understanding of Android Application Development.



Anatomy-Step-1 : infobrother

Above in Screenshot, there is Solution's contents. this is the Solution Explorer of our First App called Hello World. This Solution Explorer contains the directory structure and all of the files associated with the solution.

A solution called HelloWorld was created and the Android project HelloWorld was placed of it. Now it’s time to develop a deeper understanding of how Android Applications work so that we can build more sophisticated programs. Look at the items inside the Project to see each folder and its purpose.



Properties:

In Solution Explorer, the first things that we have is Properties. The Properties contains these two important files -


The AndroidManifest file describes all of the Xamarin.Android Application, including Name, Version Number and Permissions. the AssemblyInfo.cs file is the .NET assembly metadate file. it is good practice to fill this file with some basic information about our application.



Reference:

In Solution Explorer, the Next thing that we have is References. The References contains the Assemblies required to build and run the applications. if we expend the references directory, we'll see references to .NET assemblies such as -


As well asSystem.core .NET Assemblies and reference to Xamarin's Mono.Android assembly.



Assets:

In Solution Explorer, the Next thing that we have is Assets. the Assets contains the files the applications need to run including fonts, local data, files, and text files. Files included here are accessible through the generated Assets class. follow the given link to read more about Assets.



Resources:

In Solution Explorer, the Next important thing that we have is Resources. if we expend the resources directory, we will find three folders named Drawable, Layout and Values Over there and one file named Resource.designer.cs.


Drawable: (Folder)

In Drawable directories we have Drawable resources such as images and bitmaps. In the default template, the drawable directory houses the application icon file. Multiple drawable-Folders are usually included to provide images and bitmaps that are tailored for different device screen densities. follow the given link to read more about Drawable directories.



Layout: (Folder)

Layout Directory contains Android Designer files that define the user interface for each screen or Activity. The Template creates a Default Layout Called Main.axml.



Values: (Folder)

This directory contain XML files that store simple values such as strings, integers, and color. The template creates a File to store String values called String.xml.



Resource.Designer.cs: (File)

The Resource.Designer file, also called Resource Class is partial class that holds the Unique IDs assigned to each resource. It is Automatically created by the Xamarin.Android tools and is regenerated as necessary. This file should not be manually edited, as Xamarin.Android will Overwrite any manual changes made to it.



MainActivity.cs:

In Solution Explorer, the Last thing that we have is MainActivity.cs file. The Hello World application has only one screen (activity). The class that power the screen is Called MainActivity and lives in the MainActivity.cs file. The Name MainActivity has no special significance in Android. although the convention is to name the first activity in as Application MainActivity. Android does not care if it is Named somethings else.

















I Tried my Best to Provide you complete Information regarding this topic in very easy and conceptual way. but still if you have any Problem to understand this topic, or do you have any Questions, Feel Free to Ask Question. i'll do my best to Provide you what you need.

Sardar Omar.
InfoBrother





WRITE FOR INFOBROTHER

Advertising






Advertisement