Android的:如何生成运行时XML的资源? [英] Android: How to generate xml resources on runtime?
本文介绍了Android的:如何生成运行时XML的资源?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在我的资源文件夹不同的strings.xml文件(值,values_fr,values_de ...),我想在运行时加载额外的翻译。是有可能的新字符串添加到这些文件,即使它已经编译?还是有什么解决办法?
I have different strings.xml files in my resources folders (values, values_fr, values_de...) and I would like to load additional translations during runtime. Is it possible to add the new strings to those files even if it has already been compiled ? Or is there any workaround ?
感谢
推荐答案
答案很简单,你不能。您不能修改硬件codeD插入APK资源。
Simple answer you can't. You can't modify hard-coded into APK resources.
但也有一些选择。例如,您可以:
But there are some options. For instance you can:
- 让说阅读资源,然后修改并保存到另一个外部文件夹(SD卡或左右)
- 创建<一个href="http://developer.android.com/reference/android/content/res/AssetManager.html"><$c$c>AssetManager$c$c>对这些文件(S)
- 然后创建<一个href="http://developer.android.com/reference/android/content/res/Resources.html"><$c$c>Resources$c$c>稍后可以作为存储在APK普通机器人资源
这篇关于Android的:如何生成运行时XML的资源?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文