内容提供者,权限和URI匹配 [英] Content Providers, Authority and URI matching

查看:59
本文介绍了内容提供者,权限和URI匹配的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在尝试与自定义内容提供商合作,但我有几个问题.

I've been trying to work on a custom content provider and I have a few questions.

  1. Android框架如何使用Authority属性?为什么要求在清单中声明它,类名不够吗?

  1. How is the Android framework using Authority property? Why is it required to declare it in the manifest, shouldn't the class name be enough?

谁/哪个进程在ContentProvider实现中调用getType()方法?

Who/what process calls the getType() method in the ContentProvider implementation?

urimatcher需要什么?如果基础数据库只有几个表,应该使用它吗?

What is the need of the urimatcher? Should it be used if the underlying database has only a handful of tables?

推荐答案

您需要在清单中声明它,因为在市场"条目中列出了数据访问权限.IE.具有阅读联系信息的权限".

You are required to declare it in the manifest because data access permissions are listed in the Market entry. I.E. "Has permission to read contact information".

getType().当您使用 MyContentProvider.getType(myUri)

希望这会有所帮助!

这篇关于内容提供者,权限和URI匹配的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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