这里的每一个
当我将我的 ADT 插件更新到 ADT 16 时,我得到一个新的(工具)东西,它运行 android Lint 当我在选择我的 android 项目后运行它时,它会给我更多与 android 项目相关的 550 警告。我应该吗遵循 Lint 对我的资源(如 String.xml)和我的活动中使用的一些布局的建议。
要了解有关 Lint 的更多信息,我参考这里的提示 单击此处
它还给我警告,如下所示:
硬编码字符串“AnyThing”,应该使用@string资源
所以我认为Lint将有助于解决android中的资源问题。
如果您对 android lint 有更多了解,请告诉我。
我应该做什么来将此 xml 用于 lint,以及我应该将此 xml 放在项目根目录或任何其他目录中的位置。
<?xml version="1.0" encoding="UTF-8"?>
<lint>
</lint>
我还收到了 ImageView
的警告“[Accessibility] 图像上缺少 contentDescription
属性”。在使用 android lint 时,
我认为通过提供以下内容到图像:
android:contentDescription="@string/desc"
这定义了简要描述视图内容的文本。该属性主要用于辅助功能。由于某些视图没有文本表示,因此该属性可用于提供此类表示。
像 ImageViews
和 ImageButtons
这样的非文本小部件应该使用 contentDescription
属性来指定小部件的文本描述,以便屏幕阅读器和其他辅助工具能够充分描述用户界面。
Every One Here
When i update my ADT plugin to ADT 16 i get One new (Tool)thing which is run android Lint when i run it after select my android project it give me more 550 warning related to project for android .should i have to follow advise by Lint for my resource like String.xml and some of layout use in my activity .
For Knowing more about Lint i refer this tips here is Click here
It also Give me Warning Like Below :
Hardcoded string "AnyThing", should use @string resource
So what i think is Lint will help for resource problem in android.
If you have more thing about android lint then let me known .
and what should i do will This xml for lint and where should i put this xml in project root or any other directory.
<?xml version="1.0" encoding="UTF-8"?>
<lint>
</lint>
and i also getting This Warning "[Accessibility] missing contentDescription
attribute on image" for ImageView
. while using android lint
I think by giving following things like below To Images:
android:contentDescription="@string/desc"
This defines text that briefly describes content of the view. This property is used primarily for accessibility. Since some views do not have textual representation this attribute can be used for providing such.
Non-textual widgets like ImageViews
and ImageButtons
should use the contentDescription
attribute to specify a textual description of the widget such that screen readers and other accessibility tools can adequately describe the user interface.
发布评论
评论(1)
我尝试过 lint 只是为了好玩。我能说什么。它是一种专门为Android开发的静态分析工具。因此,Android 应用程序开发人员可以在他/她的代码中运行自动静态测试。
您可以在 Eclipse 中运行 lint,只需按面板中的按钮(在我的例子中,该按钮位于 AVD Manager 按钮附近。之后 Eclipse 将打开一个窗口,其中显示所有违反 lint 规则的情况。您可以双击错误并作为静态分析工具,它可能会出现误报。lint
工具已经提供了许多嵌入规则,您可以在 this lint 页面。
至于 lint xml 文件,我不知道如何处理它。
I've tried lint just for fun. What I can say. It's a type of static analysis tool that is developed specifically for Android. Thus, a developer of Android applications can run automatic static tests across his/her code.
You can run lint in Eclipse simply pressing on button in the panel (this button in my case is near the button of AVD Manager. After that Eclipse opens a window where all violations of lint rules are displayed. You can double click on the error and correct it. As a static analysis tool it can have false positives.
The lint tool has been already supplied with the number of embedded rules. You can read about them on this lint page.
As for lint xml file, I don't know what to do with it.