Android optimization clears Invalid code UCDetector and androiducdetector

Source: Internet
Author: User

Android optimization clears Invalid code UCDetector and androiducdetector

Optimized clearing of unused code UCDetector in android


Http://www.ucdetector.org/index.html


UCDetector is an eclipse tool that can review unused, redundant, and variable-less code in a program.

Note:

Manual judgment is required for reflection, xml injection configuration, third-party engineering applications, jar package calls, etc.

We recommend that you search for the eclipse global search shortcut key (windows: ctrl + G, mac: control + G) somewhere else before deleting the class)



The version I used is org. ucdetector_1.10.0.jar.

: Http://download.csdn.net/detail/aaawqqq/8851445


(1) Installation

Put the downloaded jar package in the eclipse folder and place it in the \ eclipse \ dropins folder. Then restart eclipse.

:



(2) Run and use

After the installation is complete, open eclipse

The procedure is as follows: Right-click the project, select UCDetector, select Detect unnecessary code, and wait for running.

(If the project is relatively large, the running time may be a little long)


:




(3) running results

The running result report is generated in the ucdetector_reports folder of the workspace opened by eclipse.


The ucdetector_reports folder contains two files.





The running result is also displayed in problem of eclipse.

:



(4) Screening

To facilitate searching and classifying results in problem


Select inverted triangle> pop-up window> Group By> Type

:


 

(5) Optimization

Find the corresponding class as prompted to delete it

For example, the class BaseActivity


:



Double-click entries in problem to enter the corresponding class:




(6) End



Pay attention to the use of plug-ins:


Manual judgment is required for reflection, xml injection configuration, third-party engineering applications, jar package calls, etc.

We recommend that you search for the eclipse global search shortcut key (windows: ctrl + G, mac: control + G) somewhere else before deleting the class)


Attached references:

Lint classification and Common Errors

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

44 JAVA code quality management tools:

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


Attach the beast and wish everyone a daily Improvement

// Please wait until then // zookeeper // zookeeper without any bugs! // Zookeeper has been completed before // zookeeper has been executed before being executed ┛ ┗ ┻ ┛


Next article: optimize the use of Android lint in Android resource files

Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.

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.