FAQ for Android Lint tool check

Source: Internet
Author: User
Tags deprecated

 1. Correctness 1) Duplicatedids layout ID should be unique 2) Newapi some APIs used in the code are higher than the Min SDK 3 in manifest) Inconsistentarrays string internationalization  , the String-array corresponding item value of the same name is not the same as 4) registered Activity/service/contentprovider not registered via Androidmanifest 5) Deprecated Use deprecated API 6) Pxusage avoid using PX, use DP 2. Correctness:messeges 1) Missingtranslation string internationalization not complete 2) extratranslation internationalized string, in default position (defaultlocale), no definition 3.  Security 1) setjavascriptenabled Not sure if you really need JavaScript in your program to do setjavascriptenabled. 2) exportedcontentprovider/exportedreceiver/exportedservice/exportedactivity contentprovider/receiver/service/  When the activity's exported is true, a permission is set so that the user gets the permission to use.  3) Hardcodeddebugmode do not set the android:debuggable in the manifest. Set it to the specified debug mode for any compiled version.     Do not set, compile Eng version with debug mode, compile user version with Release mode. 4. Performance 1) Drawallocation avoid assigning objects when plotting or parsing layouts (draw/layout).  E.g.,ondraw () to instantiate the Paint object.  2) Obsoletelayoutparam The unused parameters in layout. 3) Usecompounddrawables optimized layouts: such as a linear layout with a imageview and a textview, can be used CompounddrawaBLE's textview instead. 4) Usesparsearrays try to use Android Sparsearray instead of HashMap 5) disablebaselinealignment If LinearLayout is used for nested layout space calculations,  Its Android:baselinealigned property should be set to false to speed up layout calculations.  6) Floatmath use Floatmath instead of math.  7) Nestedweights Avoid nesting weight, that will drag the execution efficiency 8) Unusedresources/unusedids unused resources will be the program becomes larger, and the compilation speed is reduced.  9) Overdraw If you specify a background drawable for Rootview, you will first draw it with the background of the theme before using the specified background, which is called "Overdraw".  You can set the theme background to NULL to avoid. Uselessleaf/uselessparent view or view of the father did not use 5.  Usability:typography 1) typographydashes special characters need to be encoded instead of: "–" needs to use "–"; "-" need to use "-" 2 "to typographyellipsis special characters required to use code instead:" ... "Need" ... " 3) Typographyother question: "(c)" need to use "©" 6.  Usability:icons 1) iconnodpi icon appears in both NODPI and the specified DPI directory.     2) Gifusage image do not use GIF, preferably with PNG, you can use JPG.  7. Usability 1) Backbutton Android does not have the back button, Android generally have back hard keys. 2) buttoncase button "OK"/"Cancel" display case must be, not all uppercase or lowercase. A string of standard resources, not to be defined by itself, but to be defined by the system: @android: String/ok and @android:string/cancel 8. Accessibility 1) contentdescription ImageView and ImagebutThe ton should provide contentdescription 9.   Internationalization 1) Hardcodetext hard-coded strings should be defined in the resource 2) EnforceUTF8 all XML resource files should be encoded in UTF-8


FAQ for Android Lint tool check

Related Article

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.