1. Check out our app, Forums for Android! Download and leave feedback here!

how to install text configuration files with app in apk file

Discussion in 'Application Development' started by DaveBowman, Aug 27, 2010.

  1. DaveBowman

    DaveBowman New Member
    Thread Starter
    26

    Aug 27, 2010
    3
    1
    26
    Does anybody know how I can include in my new app's adk file/installation process a few text configuration files containing default app parameters (that can optionally be updated by the user running the app after app installation). I want to automatically include and install (in the directory structure shown below) these few text files along with my Java app and JNI "applibrary.so" which are currently installed via the current apk file.

    I need to install the default text files on the sdcard during app installation to a directory structure something like:

    /sdcard/myapp.datafiles/datafile1.txt
    /sdcard/myapp.datafiles/datafile2.txt

    During apk installation, the mechanism I am looking for would create the myapp.datafiles sub-dir under /sdcard and then copy my default datafile1.txt and datafile2.txt in the new /sdcard/myapp.datafiles directory on the /sdcard. Any way to do that?

    Currently, I have to use the Eclipse DDMS File Explorer "push a file onto the device" feature to manually install the files:

    /sdcard/myapp.datafiles/datafile1.txt
    /sdcard/myapp.datafiles/datafile2.txt

    and I would like to automate that process as part of apk installation.

    Thanks for any help.
     

    Advertisement

  2. Steven58

    Steven58 Reformed PH
    3,933

    Feb 19, 2010
    32,944
    25,330
    3,933
    Male
    Hi,

    This is the wrong place for your support issue. I will move your question for you.

    Welcome!

    Steven
     
    DaveBowman likes this.
  3. jamhops

    jamhops New Member
    6

    Aug 16, 2011
    2
    1
    6
    Just wondered if OP or anyone overcame this issue as I am looking to install a number of text files with the APK and would like to keep them as text files and not strings?

    Thanks
     
  4. jamhops

    jamhops New Member
    6

    Aug 16, 2011
    2
    1
    6
    ANSWER:

    Use "assets" folder to include your file in APK

    to reference it use;
    Activity.getAssets().open(*text file*)
     
    redcrab likes this.

Share This Page

Loading...