I would do that when the adt would support creating a library jar with res/assets directory. I am sure many 3rd party developers will thank Google for that.
On Feb 16, 11:18 pm, Dianne Hackborn <hack...@android.com> wrote: > Please don't do that. The correct way to retrieve the content of your .apk > is with Resources and AssetManager. > > > > > > > > > > On Thu, Feb 16, 2012 at 6:39 AM, Mark Cz <ome...@gmail.com> wrote: > > Thanks Mark. > > 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(). > > > On Feb 16, 3:22 pm, Mark Murphy <mmur...@commonsware.com> wrote: > > > On Thu, Feb 16, 2012 at 4:24 AM, Mark Cz <ome...@gmail.com> wrote: > > > > Hi, > > > > I am having an android application that is using an external jar that > > > > has in addition to regular classes an html file. > > > > > The final apk root directory looks something like this > > > > > assests > > > > res > > > > AndroidManifest.xml > > > > classes.dex > > > > resources.arsc > > > > helloworld.html > > > > > How can I access from my application to the last file > > > > "helloworld.html"? > > > > You move it into assets/ and then use getResources().getAssets().open(). > > > > -- > > > Mark Murphy (a Commons Guy)http://commonsware.com| > >http://github.com/commonsguyhttp://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 > > -- > Dianne Hackborn > Android framework engineer > hack...@android.com > > 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 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