Android Optimizer clears invalid code ucdetector

Source: Internet
Author: User

Android under optimization clears invalid unused code Ucdetector


official: http://www.ucdetector.org/index.html


Ucdetector is an eclipse tool that can review unused, redundant, variable-spec code in a program

Need to note:

Reflection , configuration injection in XML , application of third-party engineering, JAR-package invocation, etc. need to be judged by hand

We recommend that you delete the class by searching globally to see if there are other places calling Eclipse Global Search shortcut keys (windows:ctrl+g , mac:control+g)



The version I'm using is Org.ucdetector_1.10.0.jar


(i) Installation

Place the downloaded jar package in the Eclipse folder under the \eclipse\dropins folder, then restart Eclipse

:



(ii) operational use

Open Eclipse after installation is complete

The operation flow is as follows: Right click project → select ucdetector→ Select Detect unnecessary code and wait to run

(It may be a bit long if the project is relatively large)


:




(iii) operational results

Reports that run the results are generated in the workspace folder ucdetector_reports of the current eclipse open


There will be 2 files in the Ucdetector_reports folder





The results of the operation are also shown in Eclipse's problem.

:



(iv) Screening

To make it easy to find the filter categories for the results in problem


Select inverted triangle → pop-up window →group By→type

:


(v) Optimization

Follow the prompts to find the corresponding class to delete

For example, in the class baseactivity


:



Double-click the entry in the problem to enter the appropriate class:




(vi) Closure



plug-in use to note :


Reflection , configuration injection in XML , application of third-party engineering, JAR-package invocation, etc. need to be judged by hand

We recommend that you delete the class by searching globally to see if there are other places calling Eclipse Global Search shortcut keys (windows:ctrl+g , mac:control+g)


Attached references:

lint Classification and common mistakes

http://mikewang.blog.51cto.com/3826268/1003276

44 Java Code Quality management tools:

http://blog.csdn.net/qbg19881206/article/details/8757026


With the beast, I wish you every daily diligence.

┏┓┏┓//┏┛┻━━━┛┻┓//┃┃//┃━┃//┃┳┛┗┳┃//┃┃//┃┻┃//┃┃//┗━┓┏━┛//  ┃┃   god beast bless  ┃┃   Code no bug!  ┃┗━━━┓//  ┃┣┓//  ┃┏┛//  ┗┓┓┏━┳┓┏┛//    ┃┫┫┃┫┫//    ┗┻┛┗┻┛


Next Android resource files optimized for Android lint use

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Android Optimizer clears invalid code ucdetector

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.