外部协议请求

<data> | Android Developers  https://developer.android.com/guide/topics/manifest/data-element.html

<data>

SYNTAX:
<data android:scheme="string"      android:host="string"      android:port="string"      android:path="string"      android:pathPattern="string"      android:pathPrefix="string"      android:mimeType="string" />
CONTAINED IN:
<intent-filter>
DESCRIPTION:
Adds a data specification to an intent filter. The specification can be just a data type (the mimeType attribute), just a URI, or both a data type and a URI. A URI is specified by separate attributes for each of its parts:

<scheme>://<host>:<port>[<path>|<pathPrefix>|<pathPattern>]

These attributes that specify the URL format are optional, but also mutually dependent:

  • If a scheme is not specified for the intent filter, all the other URI attributes are ignored.
  • If a host is not specified for the filter, the port attribute and all the path attributes are ignored.

All the <data> elements contained within the same <intent-filter> element contribute to the same filter. So, for example, the following filter specification,

<intent-filter . . . >    <data android:scheme="something" android:host="project.example.com" />    . . .</intent-filter>

is equivalent to this one:

<intent-filter . . . >    <data android:scheme="something" />    <data android:host="project.example.com" />    . . .</intent-filter>

You can place any number of <data> elements inside an <intent-filter> to give it multiple data options. None of its attributes have default values.

Information on how intent filters work, including the rules for how Intent objects are matched against filters, can be found in another document,Intents and Intent Filters. See also the Intent Filters section in the manifest file overview.

ATTRIBUTES:
android:scheme
The scheme part of a URI. This is the minimal essential attribute for specifying a URI; at least one scheme attribute must be set for the filter, or none of the other URI attributes are meaningful.

A scheme is specified without the trailing colon (for example, http, rather than http:).

If the filter has a data type set (the mimeType attribute) but no scheme, the content: and file: schemes are assumed.

Note: Scheme matching in the Android framework is case-sensitive, unlike the RFC. As a result, you should always specify schemes using lowercase letters.

android:host
The host part of a URI authority. This attribute is meaningless unless a scheme attribute is also specified for the filter. To match multiple subdomains, use an asterisk (*) to match zero or more characters in the host. For example, the host *.google.com matcheswww.google.com.google.com, and developer.google.com.

The asterisk must be the first character of the host attribute. For example, the host google.co.* is invalid because the asterisk wildcard is not the first character.

Note: host name matching in the Android framework is case-sensitive, unlike the formal RFC. As a result, you should always specify host names using lowercase letters.

android:port
The port part of a URI authority. This attribute is meaningful only if the scheme and host attributes are also specified for the filter.
android:path 
android:pathPrefix 
android:pathPattern
The path part of a URI which must begin with a /. The path attribute specifies a complete path that is matched against the complete path in an Intent object. The pathPrefix attribute specifies a partial path that is matched against only the initial part of the path in the Intent object. The pathPattern attribute specifies a complete path that is matched against the complete path in the Intent object, but it can contain the following wildcards:

  • An asterisk (‘*‘) matches a sequence of 0 to many occurrences of the immediately preceding character.
  • A period followed by an asterisk (".*") matches any sequence of 0 to many characters.

Because ‘\‘ is used as an escape character when the string is read from XML (before it is parsed as a pattern), you will need to double-escape: For example, a literal ‘*‘ would be written as "\\*" and a literal ‘\‘ would be written as "\\\\". This is basically the same as what you would need to write if constructing the string in Java code.

For more information on these three types of patterns, see the descriptions of PATTERN_LITERALPATTERN_PREFIX, andPATTERN_SIMPLE_GLOB in the PatternMatcher class.

These attributes are meaningful only if the scheme and host attributes are also specified for the filter.

android:mimeType
A MIME media type, such as image/jpeg or audio/mpeg4-generic. The subtype can be the asterisk wildcard (*) to indicate that any subtype matches.

It‘s common for an intent filter to declare a <data> that includes only the android:mimeType attribute.

Note: MIME type matching in the Android framework is case-sensitive, unlike formal RFC MIME types. As a result, you should always specify MIME types using lowercase letters.

INTRODUCED IN:
API Level 1
SEE ALSO:
<action> 
<category>

w

体会“协议”

http://stackoverflow.com/questions/3469908/make-a-link-in-the-android-browser-start-up-my-app

http://stackoverflow.com/questions/2958701/launch-custom-android-application-from-android-browser

更新:通过浏览器直接打开Android应用程序 - Cundong‘s log  https://my.oschina.net/liucundong/blog/354029

Android实现通过浏览器点击链接打开本地应用(APP)并拿到浏览器传递的数据 - 被艺术搞,哥很享受! - 博客频道 - CSDN.NET  http://blog.csdn.net/jiangwei0910410003/article/details/23940445

<a href="[scheme]://[host]/[path]?[query]">启动应用程序</a> 

各个项目含义如下所示:

scheme:判别启动的App。 ※详细后述

host:适当记述

path:传值时必须的key     ※没有也可以

query:获取值的Key和Value  ※没有也可以

时间: 2024-08-19 04:55:35

外部协议请求的相关文章

http请求与响应全过程

HTTP 无状态性 HTTP 协议是无状态的(stateless).也就是说,同一个客户端第二次访问同一个服务器上的页面时,服务器无法知道这个客户端曾经访问过,服务器也无法分辨不同的客户端.HTTP 的无状态特性简化了服务器的设计,使服务器更容易支持大量并发的HTTP 请求. HTTP 持久连接       HTTP1.0 使用的是非持久连接,主要缺点是客户端必须为每一个待请求的对象建立并维护一个新的连接,即每请求一个文档就要有两倍RTT 的开销.因为同一个页面可能存在多个对象,所以非持久连接可

HTTP 400 错误 - 请求无效 (Bad request)

在ajax请求后台数据时有时会报 HTTP 400 错误 - 请求无效 (Bad request);出现这个请求无效报错说明请求没有进入到后台服务里: 原因:1)前端提交数据的字段名称或者是字段类型和后台的实体类不一致,导致无法封装: 2)前端提交的到后台的数据应该是json字符串类型,而前端没有将对象转化为字符串类型: 解决方案: 1)对照字段名称,类型保证一致性 2)使用stringify将前端传递的对象转化为字符串    data: JSON.stringify(param)  ;

WAF——针对Web应用发起的攻击,包括但不限于以下攻击类型:SQL注入、XSS跨站、Webshell上传、命令注入、非法HTTP协议请求、非授权文件访问等

核心概念 WAF Web应用防火墙(Web Application Firewall),简称WAF. Web攻击 针对Web应用发起的攻击,包括但不限于以下攻击类型:SQL注入.XSS跨站.Webshell上传.命令注入.非法HTTP协议请求.非授权文件访问等.

POST请求 参数 使用body

主要是记录一下,post请求,参数请放到body里: 虽然放到params里,也可以,但是并不合理,因为url的长度是有限制的

http网络请求 基础

http://tuijian.hao123.com:80/index.html scheme(协议前缀): host(主机):port(端口):path(资源路径) 核心类: URL:网络统计资源定位符 ,标识是网络中唯一资源 HttpURLConnection 网络资源连接类,可以打开网络连接,读取网路资源,上传网路资源等 功能方法:getinputStream()来获取网路资源字节读取流 getContentLength()来获取网路资源字节数 getPesponseCode() 来获取网路

HTTP请求报文详解

HTTP Request Header 请求头 Header 解释 示例 Accept 指定客户端能够接收的内容类型 Accept: text/plain, text/html Accept-Charset 浏览器可以接受的字符编码集. Accept-Charset: iso-8859-5 Accept-Encoding 指定浏览器可以支持的web服务器返回内容压缩编码类型. Accept-Encoding: compress, gzip Accept-Language 浏览器可接受的语言 Ac

学习笔记12JS异步请求

*一般用JS来监听按钮事件,都应该先监听页面OnLoad事件. *Js写在哪里,就会在页面解析到哪里执行. 异步请求:所谓异步请求,就是使用JS来监听按钮点击事件,并且发送请求,等到回复后,再使用JS来进行页面跳转,或动态改变页面.使用场合:当请求是ashx是,都可以使用异步方法,页面就无需刷到ashx的一个空白页面或者不用于展示的页面了. *使用jquery发送异步请求:$("#按钮ID").Click(fuction(){ $.get( "页面URL.ashx"

接口测试,添加请求头的时候,大小写一定要正确

今天同事碰到了一个问题,就是他用robot framework+requests写接口测试用例的时候,post一个json数据的时候,发送出去的数据一直是data=<empty>,明明有数据啊,通过log打印也是没问题. 最终发现是添加头的时候,将Content-Type写成了content-type. 我刚开始也没看出来问题在哪里,费了好长时间才搞定.说一下如何排查出的这个问题吧,以往写Content-Type的时候,还真没注意到大小写的问题,jmeter应该不区分的.于是今天一直没想到是这

Spring MVC HTTP请求数据绑定

package com.springmvc.controller; import com.springmvc.model.UserInfo; import org.springframework.core.io.ClassPathResource; import org.springframework.core.io.Resource; import org.springframework.stereotype.Controller; import org.springframework.uti