On Mon, Nov 28, 2011 at 3:12 PM, Lucas de Jesus Matias
<lucas.matias...@gmail.com> wrote:
> Mark, but doing this I will need update the default Aplication every time
> that I create a new Package, right?

No.

> What I want is just read a directory and get all images which there is,
> independent of another applications, the other applications just include
> files in this directory.

Then put them all on the SD card, where any application can delete
them, the user can mount the storage (and make it inaccessible to your
application on Android 1.x/2.x), etc.

I wouldn't do it that way, but, hey, it's your app.

> I dont know how to make this with ContentProvider.

You wouldn't.

Off the cuff, here is how I would approach plug-ins of the sort you
are describing:

Your main app discovers plug-ins either by watching for
package-install broadcasts or querying PackageManager. In either case,
you are looking for packages that fit a specific naming convention --
for example, the main app might by com.myfirm.app and plugins would be
com.myfirm.app.plugin.*.

For each plug-in, you then either:

-- have the plug-in implement a ContentProvider, with the main app
deriving the content Uri to use for that content provider via a naming
convention (e.g., for com.myfirm.app.plugin.one, use
content://com.myfirm.app.plugin.one)

or:

-- have whatever images and stuff you want as resources in the plug-in
under well-known names (i.e., same names used across each plug-in),
and use PackageManager to access the Resources object of the plug-in
to retrieve those resources

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Warescription: Three Android Books, Plus Updates, One Low Price!

-- 
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

Reply via email to