Hi,
In this blog I will continue on the blog I earlier posted What is Xamarin, and we will discuss about the building blocks of Xamarin Android.
Application.
- Android Manifest
- Assembly Info
- Xamarin.Forms
- Resources
- Activity Class
etc.
Here, Android Manifest can be thought of a recipe to describe all the pieces and permissions and characteristics of your application in one place. It allows your device or emulator to know what is exactly contained in it and can use that to ask the user if it is ok for your application to use certain permissions or things like that.
When we create the Android application, just by following the steps file> new project > Android > Blank App (Android), We can see the bellow file structure inside the AndroidManifest.xml file:
We can see bellow code, inside the AndroidManifest.xml file:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="App1.App1" android:versionCode="1" android:versionName="1.0">
<uses-sdk />
<application android:label="App1" android:icon="@drawable/Icon">
</manifest>
Here we have the application element which contains the two elements
1.android:label
2.android:icon
The android:label by default, when built and deployed, views an APK package. You will see the icon on the main screen of the device once its installed. It will be represented by this element here @drawable/Icon which maps into the Resources folder under drawable, the Icon.png. Now, underneath that icon or depending on the view associated with that icon, the name of your application will be specified by the android:label attribute value, android:label="MyAndroidApp" and we can change it if we want. It will be shown when the apk is deployed.
You can also change the configuration of the Android Manifest file by just right clicking on the solution. When you go to properties, you see the options to set the various configurations of the Android Manifest file, like the API level, Android Version and all, which will define the behavior of your application.
0 Comment(s)