Overlook the localization of resource in compiling

When we compile android project, it is recommend that the resoureces should be localized, for instance:

<View android:id="@+id/my_text"

    android:layout_width="wrap_content"

    android:lahyout_height="wrap_content"

    android:text="Hello Text View"/>


the android:text should not be directly assigned with "Hello Text View", instead, we should first define string item in strings.xml, and use id in TextView, as below:

In strings.xml

<string name="hello">Hello Text View</string>

In layout.xml

<View android:id="@+id/my_text"

    android:layout_width="wrap_content"

    android:lahyout_height="wrap_content"

    android:text="@string/hello"/>


However, when we compile projects from other individuals, we can not modify every reference of local resource, so we should try to ingore this restriction.


Since we know 'aapt' tool can be used to package resources in android, there is a argument used for localization of resources.


aapt -pakcage -z...

If you wan't ignore localization, please DON'T add -z as argument.


你可能感兴趣的:(Overlook the localization of resource in compiling)