Search code examples
androidandroid-resourcesandroid-x86

Android resource for a specific product


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>
    

Solution

    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