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.

  • 相关阅读:
    空气墙的制作,标签的添加
    子弹朝向问题的解决,移动方法的编写
    子弹的朝向问题
    坦克的攻击方法
    移动优先级的添加,2D渲染层级问题
    碰撞器的添加,解决抖动问题
    控制图片的移动切换
    控制玩家的移动
    游戏中预制体的制作,2D动画的制作
    场景搭建,素材的处理
  • 原文地址:https://www.cnblogs.com/echobfy/p/3548703.html
Copyright © 2011-2022 走看看