Is it possible to download files to an Android app’s asset’s directory?
I have some files under the app’s assets directory that could potentially be updated at a later date, I want to update these files with network download via the app.
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You cannot update assets. Full stop.
What you can do instead is unpack assets to internal memory or SD card and update them there.. I do that more or less in my android-menu-navigator: http://code.google.com/p/android-menu-navigator where I have menu of the simple menu-navigation based application. I can use the menu either from assets:
http://code.google.com/p/android-menu-navigator/source/browse/src/pl/polidea/navigator/retrievers/AssetMenuRetriever.java
(the test menu is here: http://code.google.com/p/android-menu-navigator/source/browse/#hg%2Fassets%2Ftestmenu )
or from downloaded menu:
http://code.google.com/p/android-menu-navigator/source/browse/src/pl/polidea/navigator/retrievers/RemoteZipMenuRetriever.java
Both are actually unpacking the menu and storing it on SD card.