• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps using File on things under assets...

smantha

Lurker
hi;
have an application that runs on other mobile platforms; its main entry takes main() like arguments to folders that contain other "resources" (xml files and such). am porting this to android...

i was exploring using assets on android. while i can browse the assets folder through the asset manager, there does not seem to be a way to figure out the path to the asset file. meaning, if i have mydata as sub-dir under assets with hello.txt and hello1.txt, then:
File file = new File("/assets/mydata/hello.txt"); fails.

questions:
a) can one construct file paths to files within assets? if so, how?
b) if not, what are other means of deploying files with an apk (no i don't want these files to come from the net), in such a way that one could get the relative/absolute path to the files?

any help appreciated.

kindest regards,
S-
 
Back
Top Bottom