1. Check out our companion app, Forums for Android! Download from Google Play

using File on things under assets...

Discussion in 'Application Development' started by smantha, Jun 22, 2010.

  1. smantha

    smantha New Member
    Thread Starter

    Jun 22, 2010
    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.

    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,


Share This Page