zoukankan      html  css  js  c++  java
  • 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.

  • 相关阅读:
    nginx配置详解
    nginx源码安装
    nginx调优
    生产环境常见的HTTP状态码列表
    如何修复损坏的MySQL数据表
    navicat报caching_sha2_password异常
    angular下载安装
    nodejs前端开发环境安装
    eclipse自动生成变量名声明(按方法返回值为本地变量赋值)
    eclipse设置代码模板和格式
  • 原文地址:https://www.cnblogs.com/echobfy/p/3548703.html
Copyright © 2011-2022 走看看