FAQs about Android lint tool check

Source: Internet
Author: User

FAQs about Android lint tool check

1. correctness 1) the id in DuplicatedIds Layout should be unique. 2) Some APIs used in NewApi code are higher than the Min SDK in Manifest. 3) InconsistentArrays string is internationalized, the item values of the String-Array with the same name are different. 4) Registered Activity/Service/ContentProvider is not Registered through AndroidManifest. 5) Deprecated uses obsolete APIs. 6) PxUsage avoids using px, use dp 2. correctness: Messeges 1) MissingTranslation string internationalization is not complete 2) ExtraTranslation internationalization string, in the default position (defaultlocale), not defined 3. security 1) SetJavaScript Enabled is not sure that you need JavaScript in your program, so do not execute SetJavaScriptEnabled. 2) When the ExportedContentProvider/ExportedReceiver/ExportedService/ExportedActivity ContentProvider/Explorer/Service/Activity exported is true, a Permission is set for the user to obtain the Permission. 3) do not set android: debuggable in manifest in HardcodedDebugMode. Set it. Any compiled version must adopt the specified debug mode. If this parameter is not set, compile the Eng version in debug mode. Compile the User version in release mode. 4. Performance 1) DrawAllocation avoids assigning objects when drawing or parsing a layout (draw/layout. E. g., instantiate the Paint object in Ondraw. 2) useless parameters in ObsoleteLayoutParam Layout. 3) UseCompoundDrawables: for example, a linear layout containing an Imageview and a TextView can be replaced by a TextView of CompoundDrawable. 4) UseSparseArrays use Android SparseArray instead of Hashmap 5) DisableBaselineAlignment if LinearLayout is used for nested layout space computing, its android: baselineAligned attribute should be set to false to accelerate layout computing. 6) FloatMath uses FloatMath instead of Math. 7) NestedWeights avoid nesting weight, which will drag down the execution efficiency 8) UnusedResources/UnusedIds unused resources will increase the program and reduce the compilation speed. 9) If Overdraw specifies a background Drawable for RootView, it will first draw the background of Theme and then use the specified background. This is the so-called "Overdraw ". You can set theme's background to null to avoid this. 10) the father of UselessLeaf/UselessParent View or view is useless. usability: Typography 1) special characters of TypographyDashes need to be replaced by encoding: "-" needs to be replaced by "-"; "-" needs to be replaced by "-" 2) special characters of TypographyEllipsis need to be replaced by encoding: "…" You need to use "…" 3) TypographyOther problem: "(c)" needs to use"©"6. Usability: Icons 1) The IconNoDpi Icon appears under both the nodpi and specified dpi directories. 2) GifUsage images do not use GIF. It is best to use PNG or JPG. 7. Usability 1) do not design Back buttons in BackButton Android. Generally, Back buttons are used in Android. 2) The "OK"/"Cancel" of the ButtonCase Button must be case-sensitive. Do not use uppercase or lowercase letters. Strings with standard resources should not be defined by yourself, but should be defined by the system: @ android: string/OK and @ android: string/cancel 8. accessibility 1) ContentDescription ImageView and ImageButton should provide contentDescription 9. internationalization 1) The HardcodeText hardcoded string should be defined in the resource 2) EnforceUTF8 all XML resource files should be encoded in UTF-8


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.