incubator-callback-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Simon MacDonald <>
Subject Re: [Android] Distributing Drawable Resources - What is acceptable?
Date Wed, 26 Sep 2012 14:27:58 GMT
There are three ways that I can think of in order to accomplish this
and not all of them are ideal.

1) If Cordova is a library project then other projects that include it
will be able to get access to their resources as well.
2) You can manually copy the resources into your new Cordova based project.
3) You can include the images in the Cordova jar file. We'd then need
to load the resources using Class.getResource() which would provide us
with a URL. Then we can use Bitmap.decodeStream() on the url to load
the image. I have not test it yet but it should work in theory.

Simon Mac Donald

P.S. The two best words in a developers toolbox "in theory".

On Tue, Sep 25, 2012 at 7:32 PM, Joe Bowser <> wrote:
> These aren't images that would be used in HTML.  We're talking about
> images that are used in the Java UI portions of the code, such as this
> new camera that we're working on.  The problem is that we have to
> pre-populate each project with these images, which means more nasty
> create script issues, which I personally loathe.  However, Android
> doesn't allow you to just have images in the JAR.  I don't know why
> that is, but that would be a nice feature to have on Android.
> It'd be nice if there was a less brittle way of doing it, but I can't
> think of any at the moment..
> Joe
> On Tue, Sep 25, 2012 at 4:26 PM, Mike Reinstein
> <> wrote:
>> Could we possibly use base64 encoding for images, and inline them? It would
>> take up 30% more space but it means you can inline them in the html rather
>> than having to package seperate resources?
>> -Mike
>> On Tue, Sep 25, 2012 at 7:19 PM, Joe Bowser <> wrote:
>>> An icon is one thing, but we're going to have to start shipping UI
>>> elements, which makes things more brittle.  I'm wondering if anyone
>>> has any way of making this less brittle or if we're going to just have
>>> to drop the resources in the /res directory, use our typical mapping
>>> and hope for the best.
>>> Investigating zoom.  It look like we're going to need some mocks done
>>> up on this end, so I'll have to figure that out.
>>> Joe
>>> On Tue, Sep 25, 2012 at 4:15 PM, Filip Maj <> wrote:
>>> > Don't understand the issue Joe? We already ship a default icon drawable
>>> > resource - what's the issue with more?
>>> >
>>> > On 9/25/12 1:03 PM, "Mike Reinstein" <> wrote:
>>> >
>>> >>If someday we were to package the camera plugin as we plan to with 3rd
>>> >>party plugins, we could easily add assets. Several plugins already do
>>> >>this.
>>> >>
>>> >>
>>> >>
>>> >>On Tue, Sep 25, 2012 at 3:38 PM, Joe Bowser <>
>>> >>
>>> >>> Hey
>>> >>>
>>> >>> So, while doing the UI for the Camera, I just realized that we're
>>> >>> going to have to distribute images with Cordova.  I can see this
>>> >>> an issue with any plugin that does UI.  Does anyone have any idea
>>> >>> to solve this issue?
>>> >>>
>>> >>> Joe
>>> >>>
>>> >

View raw message