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. question regarding home activity

Hello,  I'm new to the android platform, and I need to create a
background servicethat listens for actions from different
applications, the home activity, menu items in different apps, etc.
Is it enought to call several event listeners and pass the different
home activity events (and events from other activities) to the
listeners?

If so, what exactly to I pass to my event listener?  Is the home
activity an object that I can call?  What is it and how do I pass it?
Otherwise how to I listen for user interaction with variouse elements
of a given view/activity?

I need the listeners to trigger an activity that occurs before the
event they asked for.  For example.  1. They press the arrow button on
the homescreen.   Before it pops up, a picture pops up on the screen.

Thanks

Scott

-- 

2. unable to set system property

Hi all


I am trying to set system property so some value. like

# setprop net.eth0.dns1 9
# getprop net.eth0.dns1

#

if i follow above steps it is not setting system property. what may be
the reason for this?

How to make this to set the value?

Thanks
Gururaja

-- 
unsubscribe: android-porting+unsubscr...@googlegroups.com
website: 

3. Unable to launch Android application in console

4. Porting on Toshiba portege g900

5. create Hierarchical menu

6. Thin Java over C++ App

7. Greystripe experiences?