On Thu, Feb 16, 2012 at 9:39 AM, Mark Cz <[email protected]> wrote:
> But I don't want to use the assets directory, since it's not my
> project. I am just giving the developers a jar with an html file
> inside. Of course I can give them two files, a jar to put in their
> classpath and a html file to put in their assets directory, but i want
> to avoid that.
> Anyhow I found a solution to read the file.
> I am reading the apk file using
> getPackageManager().getApplicationInfo(getPackageName(),
> 0).sourceDir;
> And then by using java.util.zip.ZipFile I retrieve the html file, and
> copy it to context.getFilesDir().getPath().

Personally, I would not rely upon that long-term, though it may work today.

Once the ADT supports distributing Android library projects as JARs,
you could put the file in res/raw/ in your Android library project and
distribute it that way.

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