Re: [android-developers] Programmatically discover ContentProviders in the current application

2010-12-13 Thread Kostya Vasilyev

Mark,

Have you tried specifying first or second parameters - process name or 
the uid?


You can get the latter by calling: android.os.Process.myUid(), which 
doesn't require a Context, so it's particularly suited to use within a 
library.


-- Kostya

13.12.2010 21:23, Mark Carter пишет:

I'm aware of:
http://developer.android.com/reference/android/content/pm/PackageManager.html#queryContentProviders(java.lang.String,
int, int)

but this returns all ContentProviders available to the system.

However, I am only interested in ContentProviders of my own
application and, for performance reasons, would rather not iterate
through a potentially long list returned by the above method.

Does anyone know a more performant solution to this?

BTW, if you are wondering why not just hardcode this list (since it's
my own app), it's because I am writing a library which I intend to use
in several of my apps.




--
Kostya Vasilyev -- WiFi Manager + pretty widget -- http://kmansoft.wordpress.com

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


Re: [android-developers] Programmatically discover ContentProviders in the current application

2010-12-13 Thread Mark Carter
Thanks Kostya.

I did see those other parameters but was confused by what it would mean for
a content provider to be hosted by the given process. Does it only return
ContentProviders that have already been started in the given process?

I will give it a try though...

On 14 December 2010 02:37, Kostya Vasilyev kmans...@gmail.com wrote:

 Mark,

 Have you tried specifying first or second parameters - process name or the
 uid?

 You can get the latter by calling: android.os.Process.myUid(), which
 doesn't require a Context, so it's particularly suited to use within a
 library.

 -- Kostya

 13.12.2010 21:23, Mark Carter пишет:

  I'm aware of:

 http://developer.android.com/reference/android/content/pm/PackageManager.html#queryContentProviders(java.lang.String
 ,
 int, int)

 but this returns all ContentProviders available to the system.

 However, I am only interested in ContentProviders of my own
 application and, for performance reasons, would rather not iterate
 through a potentially long list returned by the above method.

 Does anyone know a more performant solution to this?

 BTW, if you are wondering why not just hardcode this list (since it's
 my own app), it's because I am writing a library which I intend to use
 in several of my apps.



 --
 Kostya Vasilyev -- WiFi Manager + pretty widget --
 http://kmansoft.wordpress.com

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en

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