特定产品的Andr​​oid资源 [英] Android resource for a specific product

查看:116
本文介绍了特定产品的Andr​​oid资源的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是从这个设置code程序...

 <字符串名称=about_settings产品=平板电脑>关于平板电脑< /串>
<字符串名称=about_settings产品=默认>关于手机和LT; /串>
 

那么我的问题是:

  1. 从哪里在运行时,系统加载正确的字符串资源?
  2. 我必须做什么添加一个新的产品?例如,

     <字符串名称=about_settings产品=笔记本电脑>关于笔记本电脑< /串>
     

解决方案
  
      
  1. 从哪里在运行时,系统加载正确的字符串资源?
  2.   

该系统在运行时不加载此。正确的字符串资源是按照特定目标构建定义PRODUCT_C​​HARACTERISTICS ploaded $ P $。所以你不能用这个,而从日食建设。这仅用于ploaded上平台建筑应用$ P $

  

2。我必须做什么添加一个新的产品?例如,

您需要添加到PRODUCT_C​​HARACTERISTICS在device.mk文件

i got this code from Settings app...

<string name="about_settings" product="tablet">About tablet</string>
<string name="about_settings" product="default">About phone</string>

then my questions are:

  1. from where at runtime the system load the correct string resource ?
  2. What must I do to add a new product? e.g.

    <string name="about_settings" product="laptop">About laptop</string>
    

解决方案

  1. from where at runtime the system load the correct string resource ?

The system does not load this at runtime. The correct string resource is preloaded according to PRODUCT_CHARACTERISTICS defined for a specific target build. So you cannot use this while building from eclipse. This is used only for building apps preloaded on platform.

2 . What must I do to add a new product? e.g.

You need to add to PRODUCT_CHARACTERISTICS in device.mk file

这篇关于特定产品的Andr​​oid资源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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