开发者

How to find and to remove string resources with duplicate values

开发者 https://www.devze.com 2023-03-03 18:27 出处:网络
What i mean: <string name=\"str1\">That is a string</string> <string name=\"str2\">That is a string</string>

What i mean:

<string name="str1">That is a string</string>
<string name="str2">That is a string</string>

Both str开发者_开发知识库ings have the same value, so one of them is in most cases redundant.

Is there the way to find and to remove such string resources with duplicate values in Android.


You could write a parser to do it yourself. The file should be valid xml, so it should not be too difficult to do with the various tools available to you.

DOM, SAX, StAX just to name a few.


use lint command, it will provide you list of duplicates, errors, warnings, optimization, against your ui resources. simple type lint %project_path%

edit
lint is found in the sdk directory tools subdirectory. In Android Studio, at least, You can find your sdk directory by looking for the sdk.dir property in your project's local.properties file in your project root.

0

精彩评论

暂无评论...
验证码 换一张
取 消