Android培训班(47)

<!-- @page { margin: 2cm } P { margin-bottom: 0.21cm } A:link { so-language: zxx } -->

在资源的目录res/values-zh-rCN,从目录的名称就可以看到这个是保存跟中文相关的资源的目录。现在来仔细地查看这个目录的文件strings.xml,内容如下:

<?xml version="1.0" encoding="UTF-8"?>

<!-- Copyright (C) 2009 The Android Open Source Project

Licensed under the Apache License, Version 2.0 (the "License");

you may not use this file except in compliance with the License.

You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software

distributed under the License is distributed on an "AS IS" BASIS,

WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

See the License for the specific language governing permissions and

limitations under the License.

-->

<resources xmlns:android="http://schemas.android.com/apk/res/android"

xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">

<string name="app_name" msgid="8095131950334945205">"计算器"</string>

<string name="error" msgid="9197457880925804499">"错误"</string>

<string name="digit0" msgid="8069590963464434135">"0"</string>

<string name="digit1" msgid="8535041374797804029">"1"</string>

<string name="digit2" msgid="8977354203154316247">"2"</string>

<string name="digit3" msgid="148544090755132760">"3"</string>

<string name="digit4" msgid="2199490603838247678">"4"</string>

<string name="digit5" msgid="7568514524384173087">"5"</string>

<string name="digit6" msgid="6705952561049362551">"6"</string>

<string name="digit7" msgid="658125644218958447">"7"</string>

<string name="digit8" msgid="3134686906411558886">"8"</string>

<string name="digit9" msgid="765379157698748031">"9"</string>

<string name="del" msgid="6248896117422989693">"删除"</string>

<string name="clear" msgid="895929542545793094">"清除"</string>

<string name="sin" msgid="6793866152659175277">"sin"</string>

<string name="cos" msgid="6901841853098114414">"cos"</string>

<string name="tan" msgid="7957459816738554960">"tan"</string>

<string name="e" msgid="1377847800971731483">"e"</string>

<string name="ln" msgid="6888500680285403344">"ln"</string>

<string name="lg" msgid="873623857385418182">"log"</string>

<string name="leftParen" msgid="4850643713953092099">"("</string>

<string name="rightParen" msgid="3177971166159324016">")"</string>

<string name="basic" msgid="7691469861698059753">"基本面板"</string>

<string name="advanced" msgid="7122495413742976492">"高级面板"</string>

<string name="clear_history" msgid="8458043980601165012">"清除历史记录"</string>

</resources>

//QQ: 9073204 EMAIL:9073204@qq.com

//蔡军生  2011-04-24

 

从上面的内容可以看到,其实就是一些字符串资源,当android的应用程序变换语言时,变换显示的字符串资源,就可以达到不同的语言显示,这是很方便维护国际化程序的。

到这里,就已经把计算器应用程序的资源分析完成,后面接着来分析它的代码框架和结构,以及具体实现。

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

caimouse

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值