I want to replace strings.xml
file which is embedded into the apk
, by a strings.xml
file downloaded from server and stored into my internal sd card
. Is it possible to reference external tags to TextView
. My clients want to have complete control over languages in the application. If i successfully download strings.xml
from server and stored it to sd card, how can i reference the tag element to respective TextViews
. I don't really need code but only ideas and critism about this method.
相关问题
- How can I create this custom Bottom Navigation on
- Bottom Navigation View gets Shrink Down
- How to make that the snackbar action button be sho
- Listening to outgoing sms not working android
- How to create Circular view on android wear?
相关文章
- android开发 怎么把图片放入drawable的文件夹下
- android上如何获取/storage/emulated/下的文件列表
- androidStudio有个箭头不认识
- SQLite不能创建表
- Windows - Android SDK manager not listing any plat
- Animate Recycler View grid when number of columns
- Why is the app closing suddenly without showing an
- Android OverlayItem.setMarker(): Change the marker
This is not possible. If you want to achieve this, you will have to set the language in runtime while creating your controls.
If you have complete layouts (not creating dynamic controls), you will have to recursively scan your layouts, looking for buttons, textviews, hints etc., recognize the control and set the text property from the downloaded file.
something like this:
put your language in a hashmap:
and set the tag property for each of your controls in your layout. Then you can find them like this:
I don't think this will work because your resources get compiled into the apk in a special way so that they can be accessed based on the device configuration. This happens at compile time. You can't simply swap out the strings.xml later while the app is installed.