特定产品的Andr​​oid资源资源、产品、Andr、oid

2023-09-06 09:03:06 作者:一杯敬自由

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

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

那么我的问题是:

从哪里在运行时,系统加载正确的字符串资源?

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

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

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

该系统在运行时不加载此。正确的字符串资源是按照特定目标构建定义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:

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

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

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

解决方案

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