Flex移动项目自定义URL方案

Android和iOS支持通过自定义URL方案运行应用程序,或者换句话来说,应用程序可以通过用户点击链接或不同于在开始界面的图标的按钮来运行。此功能允许开发人员添加在公共网站的链接,或使用应用程序中的“启动URL”命令,这将使移动操作系统打开一个特定的应用程序。
Flex移动项目,使用Adobe AIR的Android和iOS包装器,支持这些自定义的URL方案。这些自定义方案的配置是在AIR应用程序描述XML文件中完成的。下面显示了一个自定义URL的示例,该URL使用常规的将在网站上放置和配置的HTML。
自定义URL方案示例
myapp://
HTML链接示例

<a href="myapp://">Open MyApp</a>

Android的XML示例

<android>         <manifestAdditions><![CDATA[                         <manifest android:installLocation="auto">                             <uses-permission android:name="android.permission.INTERNET"/>                             <uses-permission android:name="android.permission.CAMERA"/>                             <uses-permission android:name="android.permission.RECORD_AUDIO"/>                                 <application>                     <activity>                         <intent-filter>                             <action android:name="android.intent.action.MAIN"/>                             <category android:name="android.intent.category.LAUNCHER"/>                         </intent-filter>                         <intent-filter>                             <action android:name="android.intent.action.VIEW"/>                             <category android:name="android.intent.category.BROWSABLE"/>                             <category android:name="android.intent.category.DEFAULT"/>                             <data android:scheme="myapp"/>                         </intent-filter>                     </activity>                 </application>                         </manifest>                 ]]></manifestAdditions>     </android>

iOS的XML示例

<iPhone>      <InfoAdditions><![CDATA[         <key>UIDeviceFamily</key>         <array>                 <string>1</string>                 <string>2</string>         </array>               <key>CFBundleURLTypes</key>                 <array>                         <dict>                                 <key>CFBundleURLName</key>                                 <string>com.dreamingwell.myapp</string>                                 <key>CFBundleURLSchemes</key>                                 <array>                                         <string>myapp</string>                                 </array>                         </dict>                 </array>         ]]></InfoAdditions>    <requestedDisplayResolution>high</requestedDisplayResolution> </iPhone>

本文转自:http://bbs.9ria.com/viewthread.php?tid=86600

更多相关文章

  1. 高级Redis应用进阶课 一站式Redis解决方案
  2. Android应用程序介绍页面实现 (二)
  3. android压力测试命令Monkey
  4. Android小项目之七 应用程序的更新安装
  5. 我的Android学习之旅[1]——Android的系统架构
  6. android studio 2.2单元测试
  7. AndroidManifest.xml文件详解(三)
  8. Android中使用WebView建立应用程序
  9. android sharedUserId sharedPreferences

随机推荐

  1. Android:单元测试Junit的配置
  2. Android高手进阶教程(二十二)之Android中
  3. Android(安卓)串口通讯-------android -s
  4. [置顶] 修改Android开机画面之rle制作
  5. Android开发者已经度过了初级、中级,如何
  6. android 开发提速
  7. Android进程间通信IPC机制Binder
  8. android 操作sdcard中的多媒体文件(一)——
  9. Android(安卓)Studio 3.6 正式版终于发布
  10. Android高性能编程