What is the Android manifest file - Codiclick

share

What is android manifest file

Adverts

In the entry on the Android directory structure, the application manifest file was mentioned, this time we will see what it consists of and its importance.


AndroidManifest file is a configuration file that our android project must have, this manifest file describes important information of the project. in the next publication of the official page there is a little more about this file. (

Defines general information such as app name, icon, theme and application components such as activities, services, content providers, access permissions to system functions such as camera, internet, bluetooth, among others, as well as How to determine which is the main activity of the system.


This file can be found in the manifest directory and has the following structure:

Here we can identify basic elements such as:


  • icon: Corresponds to the path where the application icon is located.
  • labels: Path where the application name is located.
  • theme: Path with the style that the application uses in terms of theme.
  • activity: Corresponds to the parameterization of the activities used by the application


For example, in the case of activities, we already know that an app is made up of activities, these correspond to the application's screens and are divided into a graphical part and a logical part of the system, so that the app can load these screens, these must be parameterized in the manifest.


In the following image you can see that the project is composed of 3 Activities, these in turn are defined in the manifest file.


It is very important to make it clear that this file is created and updated automatically, it is not necessary to add the activity manually, this was done before when it was used in Eclipse IDE to develop applications, but now with Android Studio this process is automatic.


however, this does not mean that we cannot modify the file, on the contrary, we may have the need to do so, but it is very important that we are careful, because if this file is damaged our system will not be able to start .


For example, some of the most common modifications may be the possibility of defining which is the first screen that appears, for this, if we have seen the previous images, we will notice that in the section corresponding to MainActivity there is a block of code < intent-filter> and in the property that indicates that this will be the first screen, if we want we can modify this filter and add it to “OtherActivity”, also changing the property “android:exported=”true””



This way, when starting the project, it checks what is in the manifest, indicating that the first screen to be displayed is the one defined by OtraActivity.


Another very common modification to the file is the linking of permissions in the application, although this can also be done logically, from here you can add permissions to use the camera, internet, among many others.



And that's it, with that we can get an idea of what the file is and its importance for our project.

It may also interest you.




Is there anything you want to add or comment about this entry? feel free to do….And if you liked it... I invite you to share Y Subscribe by clicking on the “Join this site” button to hear more posts like this one 😉