What is manifest file in Android?

后端 未结 6 1675
Happy的楠姐
Happy的楠姐 2021-02-19 13:33

Can anybody explain me in simple words what is the use of Manifest file and R.java file in android.

Why do we need these files while making an application?

6条回答
  •  醉梦人生
    2021-02-19 13:54

    Manifest file:

    1. It is a declaration file.
    2. Here only Which activity should start first, that has been declared.
    3. It declares which permissions the application must have.
    4. It also declares the permissions that others are required to have in order to interact.
    5. It declares the minimum level of the Android API.
    6. It lists the libraries that the application must be linked.
    7. All the component should declared here.
    8. The components are activities, services, broadcast receivers, and content providers.

    R.java file:

    1. It is an auto-generated file by aapt (Android Asset Packaging Tool) that contains resource IDs for all the resources of res/ directory.
    2. If you create any component in the activity_main.xml file, id for the corresponding component is automatically created in this file.
    3. This id can be used in the activity source file to perform any action on the component.

提交回复
热议问题