什么是Android中的Uri.parse

Adh*_*ham 16 android android-intent

功能Uri和使用方法是Uri.parse()什么?

例如 :

Uri.parse("tel:(+49)12345789"));
Run Code Online (Sandbox Code Playgroud)

Uri.parse("geo:50.123,7.1434?z=19"));
Run Code Online (Sandbox Code Playgroud)

做什么telgeo指的是什么?

Ang*_*elo 9

一个开放的对象通常是用来告诉ContentProvider的是我们要通过引用来访问.它是对资源或数据的不可变的一对一映射.该方法从正确格式化Uri.parse创建新Uri对象String.有关详细信息,请参见此处ContentProviders.


pul*_*ion 9

如果你想uriString在这里找到关于其性质的具体答案,请参阅,
来自
http://developer.android.com/reference/android/net/Uri.html#parse%28java.lang.String%29

不可变的URI引用.URI引用包括URI和片段,URI的组件在"#"后面.构建和解析符合RFC 2396的URI引用.

关于RFC 2396标准,
来自,
http://www.faqs.org/rfcs/rfc2396.html

本文档更新并合并"统一资源定位符"
[RFC1738]和"相对统一资源定位符"[RFC1808],以便为所有URI定义单个通用语法.

和,

1.1 URI概述

URI的特征在于以下定义:

  Uniform
     Uniformity provides several benefits: it allows different types
     of resource identifiers to be used in the same context, even
     when the mechanisms used to access those resources may differ;
     it allows uniform semantic interpretation of common syntactic
     conventions across different types of resource identifiers; it
     allows introduction of new types of resource identifiers
     without interfering with the way that existing identifiers are
     used; and, it allows the identifiers to be reused in many
     different contexts, thus permitting new applications or
     protocols to leverage a pre-existing, large, and widely-used
     set of resource identifiers.

  Resource
     A resource can be anything that has identity.  Familiar
     examples include an electronic document, an image, a service
     (e.g., "today's weather report for Los Angeles"), and a
     collection of other resources.  Not all resources are network
     "retrievable"; e.g., human beings, corporations, and bound
     books in a library can also be considered resources.

     The resource is the conceptual mapping to an entity or set of
     entities, not necessarily the entity which corresponds to that
     mapping at any particular instance in time.  Thus, a resource
     can remain constant even when its content---the entities to
     which it currently corresponds---changes over time, provided
     that the conceptual mapping is not changed in the process.

  Identifier
     An identifier is an object that can act as a reference to
     something that has identity.  In the case of URI, the object is
     a sequence of characters with a restricted syntax.
Run Code Online (Sandbox Code Playgroud)

以下是一些使用中:

1.3.示例URI

以下示例说明了常用的URI.

ftp://ftp.is.co.za/rfc/rfc1808.txt - 文件传输协议服务的ftp方案

gopher://spinaltap.micro.umn.edu/00/Weather/California/Los%20Angeles - Gopher和Gopher +协议服务的gopher方案

http://www.math.uio.no/faq/compression-faq/part1.html - 超文本传输​​协议服务的http方案

mailto:mduerst@ifi.unizh.ch - 电子邮件地址的mailto方案

新闻:comp.infosystems.www.servers.unix - USENET新闻组和文章的新闻计划

telnet://melvyl.ucop.edu/ - 通过TELNET协议进行交互式服务的telnet方案


小智 6

统一资源标识符 (URI) 是用于标识资源的字符串。URI 可以通过位置或名称或两者来标识资源。此类标识允许使用特定协议通过网络(通常是万维网)与资源的表示进行交互。例如,一个 URL 是一个 URI。 * 什么是 Uri.parse()* 它不会“解析”,但它实际上创建了一个 Uri 对象,使用传递给它的字符串并且该字符串对用户隐藏。现在的问题是 Uri 对象是做什么的??所以 URI 对象是对 URI 的不可变引用,我们可以用它来引用资源。