An app cannot be installed if (in a provider Manifest element) it
specifies an authority that has already been specified by an existing
app.

This can lead to problems when installing the pro version of an app
with the lite version already installed.

How do devs deal with this?

My current approach is to always specify an authority using the app
package name as a prefix. This guarantees uniqueness.

Furthermore, I use a meta-data element to specify that the lite/pro
content providers are logically the same.

In the code, I use PackageManager.queryContentProviders() to get the
authority "candidates" (sharing the same meta-data value) and then
choose the most appropriate one to use in a Uri which I can then pass
into ContentResolver.query().

Essentially, I'm using the meta-data element to specify what I would
like to use as an authority, but am prevented from doing so.

This is quite cumbersome, so is there a neater way?

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to