download and replace resource files
my application is designed with many xml resource file. they contain some value about road and city ... 1st version is now done, but when i want to update my app, how 开发者_开发问答can i download xml files from my webservice and replace in my phone hope u guy can help me soon thanks!
If the XML files are in your resources then why bother? Why not just update your package completely and upload the update to the Android Market?
As Robert says, one option is to update the resource files with an updated APK, and let customers download the new version from the market. That works if you will update your files every now and then.
If you need constant updates (i.e., every day), you can download the files from your server somewhere and save them to your application data folder (/data/data/YOUR_APP/
). You will then need to parse the data and add it on real time to your app. Those files won't be resource files, but data in any format you require (xml is one example).
Here is how you write data to the internal storage: http://developer.android.com/guide/topics/data/data-storage.html#filesInternal
精彩评论