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.



Other Threads

1. Hola

Halo semuanya,
Salam kenal saya anggota baru nih, mo ijin mantau dulu sambil tunggu  
"pesulap" saya dateng minggu depan.

Sent from my iPhone

Google Groups "Indonesian Android Community [id-android]" group.

To post to this group, send email to

To request to subscribe to this group, please visit the following page:

2. Video problem - How to use a surface for both canvas and mediaplayer

Hii All

I have a requirement in my application where i need to do 2 things :
1.use canvas to display a bitmap
2.use mediaplayer class to display a video.

I tried using "getHolder().setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);"
and could see the video alone followed by an exception for  canvas.
This is expected as i am using "SURFACE_TYPE_PUSH_BUFFERS".

But if i dont use 'SURFACE_TYPE_PUSH_BUFFERS' then the video will not
be seen but everythign that i have given for 'canvas' works.

But i need to use both canvas and mediaplayer(for video) in my app.
How can i achieve this?

Or is it possible to create 2 surfaceviews, one for canvas and the
other for mediaplayer.setDisplay() ??

can anybody please share with me the code if they have tried something
like this?

Please show me some path out of this. Any help is greatly appreciated.

thanks in advance,


3. can anybody tell pls....

4. Archos 5 Android: new firmware w/ ADB support

5. u can run but u can't hide

6. Custom ANR messages

7. Touchscreen Input event processing in Android