Android的:如何生成运行时XML的资源? [英] Android: How to generate xml resources on runtime?

查看:139
本文介绍了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对这些文件(S)
  • 然后创建<一个href="http://developer.android.com/reference/android/content/res/Resources.html"><$c$c>Resources稍后可以作为存储在APK普通机器人资源

这篇关于Android的:如何生成运行时XML的资源?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆