Air Mobile Development Configuration File Usage tutorial

Source: Internet
Author: User
Tags uppercase letter home screen
  • Required AIR runtime version
  • Application ID
  • Application version
  • Main Application SWF
  • Home screen Properties
  • Supported configuration files
  • Required local extensions
    Virtual Keyboard Behavior

    Some application descriptor settings are important to all mobile device applications.

    Required AIR runtime version

    Use the namespace of the application descriptor file to specify the AIR runtime version required by the application.

    InApplicationThe namespace allocated in the element determines to a large extent what functions the application can use. For example, if the application uses the air 2.7 namespace, but the user installs a future version, the application will still reference the behavior of air 2.7 (even if this behavior has been changed in future versions ). The application accesses new behaviors and functions only when you change the namespace and release updates. However, security patches are not restricted by this rule.

    If the running time of a device (such as Android) is different from the running time of an application, the system prompts the user to install or upgrade when the user does not have the required air version. This does not happen on iPhone or other running devices (because the required version and application are already packaged at the beginning ).

    Use RootApplicationThe xmlns attribute of the element specifies the namespace. Use the following namespace for mobile applications (depending on your target mobile platform ):

    iOS 4+ and iPhone 3Gs+ or Android:<application xmlns="http://ns.adobe.com/air/application/2.7">iOS only:<application xmlns="http://ns.adobe.com/air/application/2.0">
    Note: Based on the air 2.0 SDK, packager for iPhone SDK provides support for iOS 3 devices. For information about building an iOS 3 AIR application, see building an iPhone application. The air 2.6 SDK (and later versions) supports IOS 4 and later on iPhone 3G, iPhone 4, and iPad devices.

    Application ID

    For each published application, the following settings should be unique. Including ID, name, and file name.

    Android Application ID

    On Android, add the prefix "Air." To the air ID to convert it to the android package name. In this case, if the air ID isCom. example. MyAppThe android package name isAir.com. example. MyApp.

    <id>com.example.MyApp</id><name>My Application</name><filename>MyApplication</filename>

    In addition, if this ID is not a valid package name on the Android operating system, it is converted to a valid name. The hyphen is changed to an underscore. If any ID component starts with a number, an uppercase letter "a" is added to the front ". For example, ID:3-goats.1-boat, Will be converted into the package name:Air. a3_goats.a1_boat.

    Note: The prefix added to the Application ID can be used to identify the AIR application in the Android Market. If you do not want the application to be identified as an air application by prefix, you must unpackage the APK file and change the Application ID, and repackage it according to the instructions in opt-out of AIR application Analytics for Android. IOS Application ID

    Set the air Application ID to match the Application ID you created in the Apple IOS provisioning portal.

    The IOS Application ID contains the bundle seed ID followed by the bundle identifier. The bundled seed ID is a string that Apple assigns to the Application ID, for example, 5rm86z4djm. The bundle identifier contains the Reverse Domain style name you selected. The bundled identifier may end with a star (*), indicating the ID of the wildcard application. If the bound identifier ends with a wildcard, you can use any valid string to replace the wildcard.

    For example:

    • If your apple Application ID is5rm86z4djm.com. example. helloworld, You must useCom. example. helloworld.
    • If your apple Application ID is96lpvweasl.com. example .*(Wildcard Application ID), you can useCom. example. helloworldOrCom. example. anotherapp, Or useCom. ExampleOther IDs.
    • Finally, if your apple Application ID only binds the seed ID and wildcard, for example:38je93kjl .*, You can use any application ID in air.

    When specifying the Application ID, do not include the bundle seed ID section of the Application ID.

    Application version

    In air 2.5 and later versions, you canVersionnumberSpecifies the application version. Cannot be used againVersionElement. WhenVersionnumberWhen a value is specified, a sequence consisting of up to three numbers separated by vertices must be used, for example, "0.1.2 ". Each segment of a version number can contain up to three numbers. ("999.999.999" is the maximum allowed version number ). It is not necessary to include all three paragraphs in the number; "1" and "1.0" are both valid versions.

    You can also useVersionlabelTo specify the version label. If the version tag is added, the version tag is displayed instead of the version number on the Android Application Information Screen. You must specify a version label for the application that uses the Android Market distribution. If it is not specified in the air application DescriptorVersionlabelValueVersionnumberThe value is assigned to the tag field of the Android version.

    <!-- AIR 2.5 and later --><versionNumber>1.23.7<versionNumber><versionLabel>1.23 Beta 7</versionLabel>

    On Android, airVersionnumberConvert to Android integerVersioncode, The conversion formula is:A * 1000000 + B * 1000 + cA, B, and C represent the components of the air version:A. B. C.

    Main Application SWF

    InInitialwindowElementContentSpecify the SWF file of the main application in the sub-element. When locating a device in a mobile configuration file, you must use the SWF file (HTML-based applications are not supported ).

    <initialWindow>    <content>MyApplication.swf</content></initialWindow>

    Files in the air package must be included (using ADT or IDE ). If you only reference the name in the application descriptor, the file is not automatically included in the package.

    Home screen Properties

    Several sub-elements of the initialwindow element control the initial appearance and behavior of the main application screen.

    • Aspectratio-Specify the initial display mode of the applicationPortraitFormat (larger than width ),LandscapeFormat (height less than width) orAnyFormat (the stage can be automatically adjusted to any direction ).

      <aspectRatio>landscape</aspectRatio>
    • Autoorients-Specify whether the stage should automatically change the direction as the user rotates the device or makes other orientation-related gestures (such as opening or closing the sliding keyboard. If it is setFalse(Default), the stage will not change with the device.
      <autoOrients>true</autoOrients>
    • Depthandstenpencil-Specify the depth or template buffer. These buffers are usually used when processing 3D content.
      <depthAndStencil>true</depthAndStencil>
    • Fullscreen-Specify whether the application occupies the entire display of the device or shares the display with the Standard Operating System window style (such as the system status bar.
      <fullScreen>true</fullScreen>
    • Rendermode-Specify whether the Graphic Processing Unit (GPU) or the main central processing unit (CPU) should be used to render the application. Generally, GPU rendering can increase the rendering speed, but some features (such as some mixed modes and pixelbender filters) cannot be used in GPU mode. In addition, the GPU features and restrictions for drivers of different devices and devices are different. Applications should always be tested on as many devices as possible, especially in GPU mode. You can set the rendering modeGPU,CPU,Direct
      OrAuto. The default value isAutoThis setting is now rolled back to the CPU mode.

      Note: To use GPU acceleration with mobile platform air Flash content, Adobe recommends using rendermode = "direct" (that is, stage3d) instead of rendermode = "GPU ". Adobe officially supports and recommends the following stage3d-based frameworks: Starling (2D) and away3d (3D ). For more information about stage3d And Starling/away3d, see http://gaming.adobe.com/getstarted /.
      <renderMode>direct</renderMode>

      The GPU mode is limited:

      • The flex framework does not support the GPU rendering mode.
      • Filter not supported
      • Pixelbender mixing and filling are not supported
      • The following blending modes are not supported: layer, Alpha, erase, overlay, strong light, brightening, and darkening
      • We do not recommend that you use the GPU rendering mode in the video playback application.
      • In GPU rendering mode, text fields are not correctly moved to visible locations when the virtual keyboard is turned on. To make sure that text fields are visible when you enter text, use the softkeyboardrect attribute of the stage and keypad event to move text fields to the visible area.
      • If the Display object cannot be rendered using the GPU, It is not displayed at all. For example, if you apply a filter to a display object, the object is not displayed.
      Note: In Air 2.6 and later versions, the GPU Implementation of IOS is significantly different from that used in earlier versions (Air 2.0. Applicable to different optimization considerations.

    Supported configuration files

    You can addSupportedprofilesTo specify which device configuration files your application supports. Use the mobiledevice configuration file for mobile devices. When you run an application using Adobe debug launcher (ADL), ADL uses the first configuration file in the list as the active configuration file. You can also use-ProfileTo select a specific configuration file in the support list. If your application runs in all configuration files, you can ignore it completely.Supportedprofiles
    Element. In this case, ADL uses the Desktop configuration file as the default Active configuration file.

    To specify that the application supports both the mobile device and desktop configuration files, and test the application in the mobile device configuration file, add the following elements:

    <supportedProfiles>mobileDevice desktop</supportedProfiles>

    Required local extensions

    SupportedMobiledeviceThe application of the configuration file can use the local extension.

    Declare all local extensions used by the air application in the application descriptor. The following example illustrates the syntax used to specify two local extensions:

    <extensions>     <extensionID>com.example.extendedFeature</extensionID>    <extensionID>com.example.anotherFeature</extensionID></extensions>

    ExtensionidElement value and in the extension descriptor FileIDElement values are the same. The extension descriptor file is an XML file named extension. xml. It is packaged in the ANE file received from the local extended developer.

    Virtual Keyboard Behavior

    SetSoftkeyboardbehaviorElementNoneSo that you can disable automatic translation and size adjustment. When you run the command, you can use these actions to ensure that the text entry fields with focus are in the view after the virtual keyboard appears. If you disable this automatic action, make sure that the text entry area or other relevant content is visible after the virtual keyboard appears. You can use the stageSoftkeyboardrectProperties, combined with softkeyboardevent to detect when the keyboard will be opened and determine the areas covered by the keyboard.

    To enable this automatic action, set this element valuePan:

    <softKeyboardBehavior>pan</softKeyboardBehavior>

    BecausePanIs the default value, omittedSoftkeyboardbehaviorThe element also enables automatic keyboard behavior.

    Note: translation is not supported when you use GPU rendering at the same time.
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.