Вопрос

In assets folder in my Android project, i have .dat and .xml files. They must be updated periodically. I don't want to update them by myself, there is a web service that i will store new .dat and .xml files as .json objects. How may i make the application update assets folder by itself?

Thanks.

Это было полезно?

Решение

As Siddharth Lele mentions in the comments, you cannot update assets/ at runtime, except by upgrading the app to one that contains a newer assets/.

You can, however, download your .dat and .xml files to internal storage. Then, when you need to use one of these files, check internal storage first. If there is a file there, use it. If not, fall back to the copy in assets/.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top