• Android -- The Manifest File


        Before the Android system can start an app component, the system must know that the component exists by reading the app's AndroidManifest.xml file (the "manifest" file). Your app must declare all its components in this file, which must be at the root of the app project directory. 

    The manifest does a number of things in addition to declaring the app's components, such as:

    • Identify any user permissions the app requires, such as Internet access or read-access to the user's contacts.
    • Declare the minimum API Level required by the app, based on which APIs the app uses.
    • Declare hardware and software features used or required by the app, such as a camera, bluetooth services, or a multitouch screen.
    • API libraries the app needs to be linked against (other than the Android framework APIs), such as the Google Maps library.
    • And more

      Activities, services, and content providers that you include in your source but do not declare in the manifest are not visible to the system and, consequently, can never run. However, broadcast receivers can be either declared in the manifest or created dynamically in code (as BroadcastReceiver objects) and registered with the system by calling registerReceiver().

      For every resource that you include in your Android project, the SDK build tools define a unique integer ID, which you can use to reference the resource from your app code or from other resources defined in XML. For example, if your app contains an image file named logo.png (saved in the res/drawable/ directory), the SDK tools generate a resource ID named R.drawable.logo, which you can use to reference the image and insert it in your user interface.

      One of the most important aspects of providing resources separate from your source code is the ability for you to provide alternative resources for different device configurations. For example, by defining UI strings in XML, you can translate the strings into other languages and save those strings in separate files. Then, based on a language qualifier that you append to the resource directory's name (such as res/values-fr/ for French string values) and the user's language setting, the Android system applies the appropriate language strings to your UI.

  • 相关阅读:
    Java 包装类的自动封箱与拆箱
    Java 基本类型的包装类
    Java日期时间练习三(闰年)
    导入包与模块
    模块_os模块
    Re模块练习题
    Re模块的方法补充
    Re模块的 三个方法
    基础纹理
    ruby 的数组操作
  • 原文地址:https://www.cnblogs.com/echobfy/p/3548703.html
Copyright © 2020-2023  润新知