谁能解释一下UriMatcher(Android SDK)?
我的任务是设计我的 Web 服务客户端代码以使用 Android SDK 中的实用程序类 UriMatcher。不幸的是,开发指南中的示例与我的想法无关。我知道我遗漏了一些功能的基本要点,可能还遗漏了有关 Uri 本身的一些基本要点。如果您可以将其绑定到一些可通过 HTTP POST 请求访问的 Web API,那就太理想了。
I have been tasked with designing my web services client code to use the utility class UriMatcher in the Android SDK. Unfortunately, the example in the Dev Guide does not relate to anything in my mind. I know I am missing some fundamental points to the functionality and possibly about Uri itself. If you can tie it to some web APIs that are accessible with HTTP POST request, that would be ideal.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
UriMatcher 是一个方便的类,它允许使用模式匹配进行多对一映射。它以列表式表示简化了设计沟通。数字分配允许插入、删除和重新排列模式而不影响匹配。当在 switch 语句中使用匹配作为“case”值时,这特别有用 - 处理逻辑不必更改。
UriMatcher is a convenience class that allows a many-to-one mapping by using pattern matching. It simplifies the design communication in a list-style representation. The numeric assignment allows one to insert, remove and rearrange patterns without effecting the match. This is especially useful when the match is used in a switch statement as the 'case' value -- the handling logic does not have to change.
UriMatcher
和 Web 服务客户端的关系就像扫雪机和奶酪刨丝器一样。UriMatcher
用于实现ContentProvider
,仅此而已。UriMatcher
and a Web services client are as related as a snowplow and a cheese grater.UriMatcher
is used in implementing aContentProvider
, and little else.