码迷,mamicode.com
首页 > 移动开发 > 详细

Android M新特性之APP Link

时间:2015-08-11 09:57:05      阅读:425      评论:0      收藏:0      [点我收藏+]

标签:

  The Android M Developer Preview introduces support for App Links, which improves upon existing link handling by allowing app developers to associate an app with a web domain they own.

  Declare a Website Association

  This JSON file indicates the Android app that should be used as the default handler for the URLs under this domain.

The following file listing shows an example of the contents and format of a statements.json file:

[{
  "relation": ["delegate_permission/common.handle_all_urls"],
  "target": {
    "namespace": "android_app",
    "package_name": "<package name>",
    "sha256_cert_fingerprints": ["6C:EC:C5:0E:34:AE....EB:0C:9B"]
  }
}]

  An app can request that the platform automatically verify any app links defined by the host names in the data elements of its intent filters against the statements.json files hosted on the respective web domains. To request app link verification, add an android:autoVerify attribute to each desired intent filter in the manifest, as shown in the following manifest code snippet:


<activity ...>
    <intent-filter android:autoVerify="true">
        <action android:name="android.intent.action.VIEW" />
        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />
        <data android:scheme="http" android:host="www.android.com" />
        <data android:scheme="https" android:host="www.android.com" />
    </intent-filter>
</activity>

 

Managing App Link Settings

   Settings > Apps > App Info > Open by default.

Android M新特性之APP Link

标签:

原文地址:http://www.cnblogs.com/WalsonWang/p/4720010.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!