日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 >

【Android】Uri和Url和URN

發布時間:2023/12/20 34 豆豆
生活随笔 收集整理的這篇文章主要介紹了 【Android】Uri和Url和URN 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

最早在Android方面接觸這兩個概念,是學習ContentProvider的時候,當時花了很多時間,始終不能很好的理解他們的區別,順帶著ContentProvider的用法也無法理解,最近通過實現網頁鏈接和Android-APP的無縫跳轉問題,對這里的區別有了一定的認識。

下面是來自StackOverFlow上的一段解釋What's the difference between a URI and a URL?:

A URI can be further classified as a locator, a name, or both. The term "Uniform Resource Locator" (URL) refers to the subset of URIs that, in addition to identifying a resource, provide a means of locating the resource by describing its primary access mechanism (e.g., its network "location"). The term "Uniform Resource Name" (URN) has been used historically to refer to both URIs under the "urn" scheme [RFC2141], which are required to remain globally unique and persistent even when the resource ceases to exist or becomes unavailable, and to any other URI with the properties of a name.

URI(Uniform Resource Identifier)中文名為統一資源標識符。

URL(Uniform Resource Locator)中文名字為統一資源定位符。

Examples

  • Roger Pate

This is my name, which is identification. It is like a URI, but cannot be a URL, as it tells you nothing about my location or how to contact me. In this case it also happens to identify at least 5 other people in the USA alone.

  • 4914 West Bay Street, Nassau, Bahamas

This is a location, which is identification for that physical location. It is like both a URL and URI (since all URLs are URIs), and also identifies me?indirectly?as "resident of..". In this case it uniquely identifies me, but that would change if I get a roommate.

I say "like" because these examples do not follow the required syntax.

URIs identify?and?URLs locate; however,?locations are also identifications, so every URL is also a URI, but there are URIs which are not URLs.

?

在Wikipedia上面,解釋如下:

URIs can be classified as locators (URLs), as names (URNs), or as both. A?uniform resource name?(URN) functions like a person's name, while a?uniform resource locator?(URL) resembles that person's street address. In other words: the URN defines an item's identity, while the URL provides a method for finding it.

A?uniform resource locator, abbreviated?URL, also known as?web address, is a specific?character string?that constitutes a reference to a resource. In most?web browsers, the URL of a web page is displayed on top inside an?address bar. An example of a typical URL would be?"http://en.example.org/wiki/Main_Page".

三者的關系如下:

?

?

OK,上面一大段英文之后,如果看懂了,基本上有了一個大概的了解,URN確定了一個資源的身份,比如,我可以叫你為大腳印,大腳印標志了你的身份,但是我應該如何找到你呢?XX學校XX班級的大腳印!這是一個URL(但是其實根據上面URL的定義,URL定義的應該是網址,我的理解是,URL代表著URI的一種形式,URI中用來標志一個資源位置的方式還有很多,最常見的比如文件系統中的某個文件的絕對地址),通過這個URL我們可以找到這個資源!URL和URN同統一包含于URI。

下面我去整理一下ContentProvider的有關文章。

?

轉載于:https://www.cnblogs.com/lqminn/archive/2013/04/20/3031949.html

總結

以上是生活随笔為你收集整理的【Android】Uri和Url和URN的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。