什么是Android平台打造的URI的原则是什么? [英] What are principles of building URIs on Android platform?

查看:169
本文介绍了什么是Android平台打造的URI的原则是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有使用落后Android平台上的URI原则的任何文档?例如,我有一个应用程序,允许用户读取特定的论坛。它有一对夫妇的活动 - 一个用于查看论坛列表,一个用于观察线程的列表,其中查看职位列表等

Is there any documentation on principles behind using URIs on Android platform? For example, I have an application that allows user to read particular forums. It has a couple of activities - one for viewing list of forums, one for viewing list of threads, one for viewing list of posts, etc.

我想使用分层URI在我的活动意图以表示活动应该显示的内容。这是个好主意吗?如果是这样,什么是制定这些URI的最好方法?

I'd like to use a hierarchical URI in my activities' intents to indicate what an activity should display. Is it a good idea? If so, what is the best way to formulate those URIs?

例如,我应该用我自己的方式,比如 myforums:内容:计划

For example, should I use my own scheme like myforums: or content: scheme?

推荐答案

使用标准的HTTP的URI用于查看公共网站的内容和设置您的意图过滤器基于主机/路径上。这一些插图包括Android电子市场,这将打开 http://market.android.com 而应用程式的连结网站本身将在任何浏览器中打开。 YouTube应用打开直接链接到视频以及

Use standard http URIs for viewing public web content and set up your intent filter based on the host/path. Some illustrations of this include Android Market, which will open links to apps on http://market.android.com while the site itself will open in any browser. The YouTube app will open direct links to videos as well.

使用HTTP的URI意味着共享链接到的内容可以从任何浏览器中打开的任何平台上,如果你的应用程序是不是present,但是当它的存在提供更丰富的或更优化的体验应用程序可以接管。

Using http URIs means that shared links to that content may be opened from any browser on any platform if your app is not present, but the app can take over when it's there to provide a richer or more optimized experience.

这篇关于什么是Android平台打造的URI的原则是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆