How to pack a config file into my apk package

by Ke Wu » Wed, 21 Apr 2010 18:21:42 GMT


Sponsored Links
 Hi all
     As you know, an app often has some configurations, I need to save these
configurations into a file, and in my app I could change these
configurations. In other words, I need a file to take all my config data,
and in my app, I could read/write this file as I want.

I've searched document and mailing list archive, and have not found the
exact solution.
1. SharedPreferences could not solve : It could only do with simple
key/value pairs, my configuration data is more complex .
2. file in /assets , /res/raw  could not solve: It seems that the file in
these position would be read only

I've found a way, it almost solved my problem, but still not.
Our code could deal with the file in /data/data/package-name/files on the
target file system, this is good to me, but how could I put my file in this
directory after my app has been installed? My app need to read these
configurations when it starts.

So, my question is how could I pack my data file into my apk package, and
then my app could read/write this file when it is run.

Thanks in advance.

kerlw

--



Other Threads

1. Layout File (tabs/maps)

Hello,
I'm new to Android (and XML, but not Java), and was wondering how I
would create a layout file for a tabbed application, with one of the
tabs having a map in them, and the other tabs having check boxes or
something else. I noticed in order to incorporate a map in an
application, it must be addressed in the layout file with your given
ID. I can make layout files for tabs,and i can make layout files for
google maps, but I can't seem to bring the two together. Any help on
this would be much appreciated!

Michael

-- 

2. Astdroid - An Android phone in space - Kickstarter project

Hey Android developers,

Thought some of you may be interested on a project I just launched on
Kickstarter called Astdroid.  I'm hoping to write an Android App that
will aid in getting a HTC Evo attached to a weather balloon into
space, taking pictures and video along the way, then returning to
earth where it can be recovered.

http://kck.st/dujciJ

Would love to hear any and all feedback from the developer community.
I intend on making this a community oriented project, so if you have
any interested in being involved, please let me know.

I think if the project gets funded it could be a nice bit of publicity
for Android, highlighting the openness and accessibility of the
platform and showing just how versatile it can be!

-dp

-- 

3. Which way is better for an app to support multiple screens?

4. AlarmManager on droids

5. ga bisa install apk dari market setelah install samdroid mod --> was : [WTA] Spica jadi usb modem

6. One of my application is invisible now on the market (Pure messenger / not copy protected)

7. com.cooliris.media/cache keeps growing