特定产品的Android资源 [英] Android resource for a specific product
问题描述
我是从这个设置code程序...
<字符串名称=about_settings产品=平板电脑>关于平板电脑< /串>
<字符串名称=about_settings产品=默认>关于手机和LT; /串>
那么我的问题是:
- 从哪里在运行时,系统加载正确的字符串资源?
-
我必须做什么添加一个新的产品?例如,
<字符串名称=about_settings产品=笔记本电脑>关于笔记本电脑< /串>
- 从哪里在运行时,系统加载正确的字符串资源?
该系统在运行时不加载此。正确的字符串资源是按照特定目标构建定义PRODUCT_CHARACTERISTICS ploaded $ P $。所以你不能用这个,而从日食建设。这仅用于ploaded上平台建筑应用$ P $
2。我必须做什么添加一个新的产品?例如,
您需要添加到PRODUCT_CHARACTERISTICS在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
这篇关于特定产品的Android资源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!