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

Apps how to install text configuration files with app in apk file

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

  1. DaveBowman

    DaveBowman Lurker
    Thread Starter
    Rank:
    None
    Points:
    26
    Posts:
    3
    Joined:
    Aug 27, 2010

    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
    Rank:
     #4
    Points:
    3,933
    Posts:
    32,959
    Joined:
    Feb 19, 2010

    Feb 19, 2010
    32,959
    25,351
    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 Lurker
    Rank:
    None
    Points:
    6
    Posts:
    2
    Joined:
    Aug 16, 2011

    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 Lurker
    Rank:
    None
    Points:
    6
    Posts:
    2
    Joined:
    Aug 16, 2011

    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...