1. Download our Official Android App: Forums for Android!

Apps using File on things under assets...

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

  1. smantha

    smantha Lurker
    Thread Starter
    Rank:
    None
    Points:
    5
    Posts:
    1
    Joined:
    Jun 22, 2010

    Jun 22, 2010
    1
    0
    5
    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-
     

    Advertisement

Share This Page

Loading...