ANDROID:什么是使用的strings.xml背后的主要思想? [英] ANDROID: What is the main idea behind of using strings.xml?

查看:172
本文介绍了ANDROID:什么是使用的strings.xml背后的主要思想?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人请解释什么是使用的主要思想的strings.xml ? 我认为这将是对多语言的支持很有用,但我们如何能组织它是什么? 我需要它,如果我不希望使用多国语言支持,我的Andr​​oid应用程序?

Someone please explain what is the main idea of using strings.xml? I think it would be useful for multi-language support but how can we organise it for that? Do I need it if I don't want to use multi-language support in my android application?

推荐答案

我们的想法是,它重新presents各种串一个位置,让您的code未穿插着字符串。除此之外,你获得轻松定位的能力。本地化文件的组织正在这里介绍:

The idea is that it represents a single location for various strings, so your code isn't peppered with string literals. In addition to that, you gain the ability to easily localize. Organization of files for localization is covered here:

<一个href="http://developer.android.com/guide/topics/resources/localization.html#creating-alternatives">http://developer.android.com/guide/topics/resources/localization.html#creating-alternatives

你需要它,如果你不本地化?不可以,但它可能使事情从长远来看更容易,我会建议使用它只是因为这个原因。

Do you need it if you're not localizing? No. But it may make things easier in the long run, and I would recommend using it just for that reason.

这篇关于ANDROID:什么是使用的strings.xml背后的主要思想?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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