android apps, learn android programming, android for beginners, android
NEXT Page -Tutorial - Android RJava and BuildConfig Java PREV Page - Tutorial - Android App Coding Android For Beginners- Read the Article

The Android MANIFEST File


Usually named androidmanifest.xml
The code in these free Android tutorials is from AIDE - the free Android App for Creating Android Apps.
The programming language is JAVA XML

android tutorial

It is a file that basically gives an overview of what is included in the android application including required app components. Some elements within it are required while others are not necessary; you can add them if you want to. Structure of the Manifest File
The manifest file contains important app details like the app package name, activity, application, and intent declarations.

The Manifest file has a xml extension...this file is created when you run your app. This file can and may need to be edited when adding certain elements or certain additional elements to your app.
Certain elements must be in this manifest file or your app will not launch or run.

Activity Element

Your app must have at least one activity.
The activity is considered a necessary app component, because without it, your app would not run nor could you add additional coded pages to your app.
One activity is like one screen view; you can have an app with just one activity or several.
And the first activity of your application must have an intent filter. The intent filter is what communicates to any additional activities your app may have.
In each activity you can add a Text View which allows you to add text to the screen.
You can also add more elements like buttons, menus, nav bars, and images.

To add any of these elements you need only add the respective code and then specify your source file, example, for an image add its file name, and upload the image to the app resources folder for images.
View all elements of Activity

Application Element

View all application elements at: Android Developer Your app requires this element. Common attributes within it are icon and label . Icon is the image that shows on the first activity page or when your app first opens - usually an image that has to do with your app`s topic.
The label is the name you gave your app which also shows when it is first launched -
Example LEARN FRENCH
Other common elements are Logo, and description. Logo is a drawable resource (image) for each activity and the app. Description is a lengthy description of the app; whereas label is a shorter description.

There is also a package app name - the file name you give your app when you are creating your app. This can be seen in the manifest file at package -
View all elements of Application

Uses SDK Element

The Uses SDK element is the version of android you want your app to be compatible with. Each android device has a platform version number; for example 4.2 is an older version while 8.1 is the most recent version of android -meaning the newest android phones and tablets on the market are using version 8.
These version numbers also have a corresponding API number. This API number is what is used when coding your app's compatibility in the SDK element in the manifest file.
For version 4.2 the corresponding API number is 14.
For version 8 the corresponding API number is 27.

It is usually a good idea to specify versions prior to the current version because not everyone has the most up to date android versions on their cell or tablet. Basically you want your app to be compatible with as many android versions as possible.

For example, if today, this year, May 2019, your building your first app and you use API 14 as your target SDK; you will not reach a large user base because today this year the android version 4.2 has less than a 7% share of the android platform market. You would want to build to be compatible with versions 5.1 to 8 at the best; as these versions currently have the greatest share of the android market - meaning most users of android today are using versions 5.1 to version 8; they represent about 75% of the market share combined. So, for the API, you could use from 21 (android os version 5) to 27 (android os version 8).

You could however, use API 14 as the minimum SDK, and then use a later version like 6, 7, or 8, as your Target SDK. That way, your app is compatible with older versions but also compatible with the newer android devices giving you a better potential user base.

The other consideration when determining your SDK target is the code class your using in your app. All code classes have a corrresponding API. As new versions of the android os are introduced so are new code classes. When you code you need to make sure your target SDK includes the required API of your code class.

For example, if your using a code class whose required API is 25, and you use API24 as your target SDK, you will get app errors cuz your code class (25) does not match your targetted API(24). In this case you want your API SDK TARGET to be at least the same as the Code Class used in the app. So the SDK Target API could be 25, and then your code in the app would be fine; or the Target SDk can be equal or greater than the Code Class in the app but not less than it.

You may also need to add dependencies to your app's gradle build file. This is determined by the code class and if your coding environment(AIDE, ANDROID STUDIO) has up-to-date dependencies added for the code class required API.

When making apps from template apps with simple features APIs aren't much of an issue. When you begin adding more sophisticated app functions and features coding the APIs and adding dependencies is more important.
For additional reading on android platform versions and corresponding APIs gohere

Intent Filter Element

The intent filter is required in order to activate the first activity within the app.
The intent filter also links your first activity to any additional activities your app may have.
If you do not use an intent in the manifest file, then your app will not launch the first activity screen, or view; (usually containing text, buttons, images, menus)
View all elements of Intent Filter
To locate this file in your android app project files goto:
AppProjects/nameOfApp/AndroidManifest.xml
nameOfApp is the name you gave the app when you created your appProject

This covers the basics of the manifest file and its elements; also Read Android Developer website Manifest File Features, Conventions, Libraries....

Share







You May Like:
Make Sushi Rolls Taste World Wines Flavours and Aromas

TO COPY CODE USE MOUSE

This free script provided by
JavaScript Kit