how to install text configuration files with app in apk file


Last Updated:

  1. DaveBowman

    DaveBowman New Member This Topic's Starter

    Joined:
    Aug 27, 2010
    Messages:
    3
    Likes Received:
    1
    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 VIP Member

    Joined:
    Feb 19, 2010
    Messages:
    32,920
    Likes Received:
    25,271
    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

    Joined:
    Aug 16, 2011
    Messages:
    2
    Likes Received:
    1
    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

    Joined:
    Aug 16, 2011
    Messages:
    2
    Likes Received:
    1
    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...