After defined the authority in the manifest, can other class in the
application read into the manifest and find out the authority to call
ContentProvider?

Thanks,
David


On 4月6日, 上午10时07分, Dianne Hackborn <[email protected]> wrote:
> I'm not sure what you are asking, but you can't define the authority at run
> time, only in the manifest.
>
> 2009/4/6 [email protected] <[email protected]>
>
>
>
>
>
> > Dianne,
>
> > Thanks for the suggestion. I have to use content provider because my
> > application use webview to display local file, and the local file can
> > change over time.
>
> > Is there a way my ContentProvider can find out what is the defined
> > authority in AndroidManifest.xml at RUN TIME?
>
> > Thanks,
> > David
>
> > On 4月4日, 下午8时02分, Dianne Hackborn <[email protected]> wrote:
> > > Permissions are not relevant for this.  Just make sure each of the
> > providers
> > > is published under a unique authority (please please please use a name
> > > properly scoped to your own namespace) and you should be fine.
>
> > > But if you are making these things for only private access in your app,
> > you
> > > might to back up and ask: why are you using a content provider at all?
> >  It
> > > would probably be easier to just have a singleton in each application
> > that
> > > provides direct access to the database.
>
> > > On Fri, Apr 3, 2009 at 9:23 PM, [email protected] <
>
> > > [email protected]> wrote:
>
> > > > How about use "permission" in your AndroidManifest.xml to impl. it?
>
> > > > <uses-permission
> > > > android:name="android.permission.ACCESS_TEST_PROVIDER" />
> > > > ...
> > > > <provider android:name=".TestProvider" ...
> > > > android:permission="android.permission.ACCESS_TEST_PROVIDER"/>
>
> > > > android:permission="android.permission.ACCESS_BLUETOOTH_SHARE"/>
> > > > On Apr 3, 9:34 am, "[email protected]"
> > > > <[email protected]> wrote:
> > > > > I have multiple applications which use the same ContentProvider code
> > > > > for internal WebView to access local files (application private).
> > > > > Because the ContentProvider has the same code base (package name,
> > > > > content uri), this will cause problem when deployed 2 or more of my
> > > > > application in the same device? How do I make the contentProvider
> > only
> > > > > accessible by its application and prefer a solution without code
> > > > > changes.
>
> > > > > Thanks,
> > > > > David
>
> > > --
> > > Dianne Hackborn
> > > Android framework engineer
> > > [email protected]
>
> > > Note: please don't send private questions to me, as I don't have time to
> > > provide private support, and so won't reply to such e-mails.  All such
> > > questions should be posted on public forums, where I and others can see
> > and
> > > answer them.
>
> --
> Dianne Hackborn
> Android framework engineer
> [email protected]
>
> Note: please don't send private questions to me, as I don't have time to
> provide private support, and so won't reply to such e-mails.  All such
> questions should be posted on public forums, where I and others can see and
> answer them.
--~--~---------~--~----~------------~-------~--~----~
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