For First To Get Advantage for Run Android lint for your Android Project You May Need To Download
Eclipse With Latest Update as Well Android ADT Plugins 16 For use of Lint in Eclipse with out Command Line .
First if you are Using Old Eclipse Like Eclipse Galileo (3.5) and Eclipse Helios (3.6) Then i Prefer You to Use Latest Eclipse Which you can Download From www.Eclipse.org Click Here is Link http://www.eclipse.org/downloads/packages/eclipse-ide-java-developers/indigosr1
After Getting Eclipse Version 3.7 you can Setup Android Application Development Environment By Getting Guide From Below Link:
http://developer.android.com/sdk/installing.html
Check Requirement From Below Link :
http://developer.android.com/sdk/requirements.html
ok now when you Done Will Eclipse Indigo and Set up ADT 16 Plugin and Your Android SDK with it You can see One new Tool in Eclipse that it Run Android lint .Now Let see What is Run Android Lint.
Eclipse With Latest Update as Well Android ADT Plugins 16 For use of Lint in Eclipse with out Command Line .
First if you are Using Old Eclipse Like Eclipse Galileo (3.5) and Eclipse Helios (3.6) Then i Prefer You to Use Latest Eclipse Which you can Download From www.Eclipse.org Click Here is Link http://www.eclipse.org/downloads/packages/eclipse-ide-java-developers/indigosr1
After Getting Eclipse Version 3.7 you can Setup Android Application Development Environment By Getting Guide From Below Link:
http://developer.android.com/sdk/installing.html
Check Requirement From Below Link :
http://developer.android.com/sdk/requirements.html
ok now when you Done Will Eclipse Indigo and Set up ADT 16 Plugin and Your Android SDK with it You can see One new Tool in Eclipse that it Run Android lint .Now Let see What is Run Android Lint.
Android Lint is a new tool for ADT 16 (and Tools 16) which scans Android project sources for potential bugs. It is available both as a command line tool, as well as integrated with Eclipse. The architecture is deliberately IDE independent so it will hopefully be integrated with other IDEs, with other build tools and with continuous integration systems as well.
Here are some examples of the types of errors that it looks for:
- Missing translations (and unused translations)
- Layout performance problems (all the issues the old
layoutopttool used to find, and more) - Unused resources
- Inconsistent array sizes (when arrays are defined in multiple configurations)
- Accessibility and internationalization problems (hardcoded strings, missing contentDescription, etc)
- Icon problems (like missing densities, duplicate icons, wrong sizes, etc)
- Usability problems (like not specifying an input type on a text field)
- Manifest errors
and many more.
Now Here Are Some Advantages You Will Get to Known When You Run Android Lint for You Android Project .Here are lint Checks .
$ lint --showAvailable issues:Correctness===========AdapterViewChildren-------------------Summary: Checks that AdapterViews do not define their children in XMLPriority: 10 / 10Severity: WarningCategory: CorrectnessAdapterViews such as ListViews must be configured with data from Java code,such as a ListAdapter.More information: http://developer.android.com/reference/android/widget/AdapterView.htmlMissingPrefix-------------Summary: Detect XML attributes not using the Android namespacePriority: 8 / 10Severity: WarningCategory: CorrectnessMost Android views have attributes in the Android namespace. When referencingthese attributes you *must* include the namespace prefix, or your attributewill be interpreted by aapt as just a custom attribute.MissingTranslation------------------Summary: Checks for incomplete translations where not all strings aretranslatedPriority: 8 / 10Severity: ErrorCategory: CorrectnessIf an application has more than one locale, then all the strings declared inone language should also be translated in all other languages.By default this detector allows regions of a language to just provide a subsetof the strings and fall back to the standard language strings. You can requireall regions to provide a full translation by setting the environment variableANDROID_LINT_COMPLETE_REGIONS.Proguard--------Summary: Looks for problems in proguard.cfg filesPriority: 8 / 10Severity: ErrorCategory: CorrectnessUsing -keepclasseswithmembernames in a proguard.cfg file is not correct; itcan cause some symbols to be renamed which should not be.Earlier versions of ADT used to create proguard.cfg files with the wrongformat. Instead of -keepclasseswithmembernames use -keepclasseswithmembers,since the old flags also implies "allow shrinking" which means symbols onlyreferred to from XML and not Java (such as possibly CustomViews) can getdeleted.More information: http://code.google.com/p/android/issues/detail?id=16384ScrollViewCount---------------Summary: Checks that ScrollViews have exactly one child widgetPriority: 8 / 10Severity: WarningCategory: CorrectnessScrollViews can only have one child widget. If you want more children, wrapthem in a container layout.DuplicateIds------------Summary: Checks for duplicate ids within a single layoutPriority: 7 / 10Severity: WarningCategory: CorrectnessWithin a layout, id's should be unique since otherwise findViewById() canreturn an unexpected view.InconsistentArrays------------------Summary: Checks for inconsistencies in the number of elements in arraysPriority: 7 / 10Severity: WarningCategory: CorrectnessWhen an array is translated in a different locale, it should normally have thesame number of elements as the original array. When adding or removingelements to an array, it is easy to forget to update all the locales, and thislint warning finds inconsistencies like these.Note however that there may be cases where you really want to declare adifferent number of array items in each configuration (for example where thearray represents available options, and those options differ for differentlayout orientations and so on), so use your own judgement to decide if this isreally an error.You can suppress this error type if it finds false errors in your project.NestedScrolling---------------Summary: Checks whether a scrolling widget has any nested scrolling widgetswithinPriority: 7 / 10Severity: WarningCategory: CorrectnessA scrolling widget such as a ScrollView should not contain any nestedscrolling widgets since this has various usability issuesScrollViewSize--------------Summary: Checks that ScrollViews use wrap_content in scrolling dimensionPriority: 7 / 10Severity: WarningCategory: CorrectnessScrollView children must set their layout_width or layout_height attributes towrap_content rather than fill_parent or match_parent in the scrollingdimensionDuplicateIncludedIds--------------------Summary: Checks for duplicate ids across layouts that are combined withinclude tagsPriority: 6 / 10Severity: WarningCategory: CorrectnessIt's okay for two independent layouts to use the same ids. However, if layoutsare combined with include tags, then the id's need to be unique within anychain of included layouts, or Activity#findViewById() can return an unexpectedview.ExtraTranslation----------------Summary: Checks for translations that appear to be unused (no default languagestring)Priority: 6 / 10Severity: WarningCategory: CorrectnessIf a string appears in a specific language translation file, but there is nocorresponding string in the default locale, then this string is probablyunused. (It's technically possible that your application is only intended torun in a specific locale, but it's still a good idea to provide a fallback.)ManifestOrder-------------Summary: Checks for manifest problems like <uses-sdk> after the <application>tagPriority: 5 / 10Severity: WarningCategory: CorrectnessThe <application> tag should appear after the elements which declare whichversion you need, which features you need, which libraries you need, and soon. In the past there have been subtle bugs (such as themes not gettingapplied correctly) when the <application> tag appears before some of theseother elements, so it's best to order your manifest in the logical dependencyorder.StateListReachable------------------Summary: Looks for unreachable states in a <selector>Priority: 5 / 10Severity: WarningCategory: CorrectnessIn a selector, only the last child in the state list should omit a statequalifier. If not, all subsequent items in the list will be ignored since thegiven item will match all.GridLayout----------Summary: Checks for potential GridLayout errors like declaring rows andcolumns outside the declared grid dimensionsPriority: 4 / 10Severity: ErrorCategory: CorrectnessDeclaring a layout_row or layout_column that falls outside the declared sizeof a GridLayout's rowCount or columnCount is usually an unintentional error.PxUsage-------Summary: Looks for use of the "px" dimensionPriority: 2 / 10Severity: WarningCategory: CorrectnessFor performance reasons and to keep the code simpler, the Android system usespixels as the standard unit for expressing dimension or coordinate values.That means that the dimensions of a view are always expressed in the codeusing pixels, but always based on the current screen density. For instance, ifmyView.getWidth() returns 10, the view is 10 pixels wide on the currentscreen, but on a device with a higher density screen, the value returned mightbe 15. If you use pixel values in your application code to work with bitmapsthat are not pre-scaled for the current screen density, you might need toscale the pixel values that you use in your code to match the un-scaled bitmapsource.More information: http://developer.android.com/guide/practices/screens_support.html#screen-independenceSecurity========ExportedService---------------Summary: Checks for exported services that do not require permissionsPriority: 5 / 10Severity: WarningCategory: SecurityExported services (services which either set exported=true or contain anintent-filter and do not specify exported=false) should define a permissionthat an entity must have in order to launch the service or bind to it. Withoutthis, any application can use this service.Performance===========UseCompoundDrawables--------------------Summary: Checks whether the current node can be replaced by a TextView usingcompound drawables.Priority: 6 / 10Severity: WarningCategory: PerformanceA LinearLayout which contains an ImageView and a TextView can be moreefficiently handled as a compound drawableMergeRootFrame--------------Summary: Checks whether a root <FrameLayout> can be replaced with a <merge>tagPriority: 4 / 10Severity: WarningCategory: PerformanceIf a <FrameLayout> is the root of a layout and does not provide background orpadding etc, it can be replaced with a <merge> tag which is slightly moreefficient.InefficientWeight-----------------Summary: Looks for inefficient weight declarations in LinearLayoutsPriority: 3 / 10Severity: WarningCategory: PerformanceWhen only a single widget in a LinearLayout defines a weight, it is moreefficient to assign a width/height of 0dp to it since it will absorb all theremaining space anyway. With a declared width/height of 0dp it does not haveto measure its own size first.UnusedResources---------------Summary: Looks for unused resourcesPriority: 3 / 10Severity: WarningCategory: PerformanceUnused resources make applications larger and slow down builds.LIMITATIONS:* If you are running lint from the command line instead of Eclipse, then theanalysis of Java files is pattern based rather than using an accurate parsetree, so the results may not be accurate. (This limitation will go awaysoon.)* The analysis does not consider dependencies between projects, so if you havea library project which defines resources and a project including the libraryproject referencing the resources, then the resources will still be reportedas unused.UselessLeaf-----------Summary: Checks whether a leaf layout can be removed.Priority: 2 / 10Severity: WarningCategory: PerformanceA layout that has no children or no background can often be removed (since itis invisible) for a flatter and more efficient layout hierarchy.UselessParent-------------Summary: Checks whether a parent layout can be removed.Priority: 2 / 10Severity: WarningCategory: PerformanceA layout with children that has no siblings, is not a scrollview or a rootlayout, and does not have a background, can be removed and have its childrenmoved directly into the parent for a flatter and more efficient layouthierarchy.TooDeepLayout-------------Summary: Checks whether a layout hierarchy is too deepPriority: 1 / 10Severity: WarningCategory: PerformanceLayouts with too much nesting is bad for performance. Consider using a flatterlayout (such as RelativeLayout or GridLayout).The default maximum depth is 10but can be configured with the environment variable ANDROID_LINT_MAX_DEPTH.TooManyViews------------Summary: Checks whether a layout has too many viewsPriority: 1 / 10Severity: WarningCategory: PerformanceUsing too many views in a single layout in a layout is bad for performance.Consider using compound drawables or other tricks for reducing the number ofviews in this layout.The maximum view count defaults to 80 but can be configured with theenvironment variable ANDROID_LINT_MAX_VIEW_COUNT.UnusedIds---------Summary: Looks for unused id'sPriority: 1 / 10Severity: WarningCategory: PerformanceNOTE: This issue is disabled by default!You can enable it by adding --enable UnusedIdsThis resource id definition appears not to be needed since it is notreferenced from anywhere. Having id definitions, even if unused, is notnecessarily a bad idea since they make working on layouts and menus easier, sothere is not a strong reason to delete these.Usability=========TextFields----------Summary: Looks for text fields missing inputType or hint settingsPriority: 5 / 10Severity: WarningCategory: UsabilityProviding an inputType attribute on a text field improves usability becausedepending on the data to be input, optimized keyboards can be shown to theuser (such as just digits and parentheses for a phone number). Similarly,ahint attribute displays a hint to the user for what is expected in the textfield.If you really want to keep the text field generic, you can suppress thiswarning by setting inputType="text".Usability:Icons===============IconNoDpi---------Summary: Finds icons that appear in both a -nodpi folder and a dpi folderPriority: 7 / 10Severity: WarningCategory: Usability:IconsBitmaps that appear in drawable-nodpi folders will not be scaled by theAndroid framework. If a drawable resource of the same name appears *both* in a-nodpi folder as well as a dpi folder such as drawable-hdpi, then the behavioris ambiguous and probably not intentional. Delete one or the other, or usedifferent names for the icons.GifUsage--------Summary: Checks for images using the GIF file format which is discouragedPriority: 5 / 10Severity: WarningCategory: Usability:IconsThe .gif file format is discouraged. Consider using .png (preferred) or .jpg(acceptable) instead.More information: http://developer.android.com/guide/topics/resources/drawable-resource.html#BitmapIconDipSize-----------Summary: Ensures that icons across densities provide roughly the samedensity-independent sizePriority: 5 / 10Severity: WarningCategory: Usability:IconsChecks the all icons which are provided in multiple densities, all compute toroughly the same density-independent pixel (dip) size. This catches errorswhere images are either placed in the wrong folder, or icons are changed tonew sizes but some folders are forgotten.IconDuplicatesConfig--------------------Summary: Finds icons that have identical bitmaps across various configurationparametersPriority: 5 / 10Severity: WarningCategory: Usability:IconsIf an icon is provided under different configuration parameters such asdrawable-hdpi or -v11, they should typically be different. This detectorcatches cases where the same icon is provided in different configurationfolder which is usually not intentional.IconExpectedSize----------------Summary: Ensures that launcher icons, notification icons etc have the correctsizePriority: 5 / 10Severity: WarningCategory: Usability:IconsNOTE: This issue is disabled by default!You can enable it by adding --enable IconExpectedSizeThere are predefined sizes (for each density) for launcher icons. You shouldfollow these conventions to make sure your icons fit in with the overall lookof the platform.More information: http://developer.android.com/guide/practices/ui_guidelines/icon_design_launcher.html#sizeIconLocation------------Summary: Ensures that images are not defined in the density-independentdrawable folderPriority: 5 / 10Severity: WarningCategory: Usability:IconsThe res/drawable folder is intended for density-independent graphics such asshapes defined in XML. For bitmaps, move it to drawable-mdpi and considerproviding higher and lower resolution versions in drawable-ldpi, drawable-hdpiand drawable-xhdpi. If the icon *really* is density independent (for example asolid color) you can place it in drawable-nodpi.More information: IconDensities-------------Summary: Ensures that icons provide custom versions for all supporteddensitiesPriority: 4 / 10Severity: WarningCategory: Usability:IconsIcons will look best if a custom version is provided for each of the majorscreen density classes (low, medium, high, extra high). This lint checkidentifies icons which do not have complete coverage across the densities.Low density is not really used much anymore, so this check ignores the ldpidensity. To force lint to include it, set the environment variableANDROID_LINT_INCLUDE_LDPI=true. For more information on current density usage,see http://developer.android.com/resources/dashboard/screens.htmlMore information: http://developer.android.com/guide/practices/screens_support.htmlIconDuplicates--------------Summary: Finds duplicated icons under different namesPriority: 3 / 10Severity: WarningCategory: Usability:IconsIf an icon is repeated under different names, you can consolidate and just useone of the icons and delete the others to make your application smaller.However, duplicated icons usually are not intentional and can sometimes pointto icons that were accidentally overwritten or accidentally not updated.IconMissingDensityFolder------------------------Summary: Ensures that all the density folders are presentPriority: 3 / 10Severity: WarningCategory: Usability:IconsIcons will look best if a custom version is provided for each of the majorscreen density classes (low, medium, high, extra high). This lint checkidentifies folders which are missing, such as drawable-hdpi.Low density is not really used much anymore, so this check ignores the ldpidensity. To force lint to include it, set the environment variableANDROID_LINT_INCLUDE_LDPI=true. For more information on current density usage,see http://developer.android.com/resources/dashboard/screens.htmlMore information: http://developer.android.com/guide/practices/screens_support.htmlAccessibility=============ContentDescription------------------Summary: Ensures that image widgets provide a contentDescriptionPriority: 3 / 10Severity: WarningCategory: AccessibilityNon-textual widgets like ImageViews and ImageButtons should use thecontentDescription attribute to specify a textual description of the widgetsuch that screen readers and other accessibility tools can adequately describethe user interface.Internationalization====================HardcodedText-------------Summary: Looks for hardcoded text attributes which should be converted toresource lookupPriority: 5 / 10Severity: WarningCategory: InternationalizationHardcoding text attributes directly in layout files is bad for severalreasons:* When creating configuration variations (for example for landscape orportrait)you have to repeat the actual text (and keep it up to date whenmaking changes)* The application cannot be translated to other languages by just adding newtranslations for existing string resources.