When should I do clean operation when developing Android with Eclipse?

Source: Internet
Author: User

When we use eclipse to develop an Android APP, we'll use one clean (Project--clean ... Operation, this operation is simple to do, is to delete the contents of the bin directory in the project structure, such as the previous compiled Apk,dex, and then recompile to generate these content (of course, most of the time when we press the "Save" button, Eclipse will automatically recompile bin The contents of the directory, but also sometimes ecipse will not be automatically compiled, this time we need to do a manual clean operation, but in Android Studio Google has canceled the clean operation, but it is very simple, but it still brings us A lot of trouble and even hassle, we need to know exactly when to use the clean operation.

When do I use it?

In fact, after you have made any changes to the project (code changes, res resource file modifications, Androidmanifest.xml profile modifications, and so on), you should try the operation after you run it again, showing the old resource file and even the code logic. clean No, it is likely that you are running an unmodified version of the previous apk.

In the development of the project, I often encounter the project resources after the revision of the sample, after the run or display of the old picture or other resource files (especially when the picture is changed separately, this situation occurs most frequently), this is the clean perfect time to operate;

Another lesson I was impressed with was this: Because JSON was used in the project, I wrote a corresponding bean class to an interface, and later, because of the interface changes, the background returned data was increased by 2 and 3 fields, so I needed the bean Add the corresponding property, the problem occurs at this point, I modified the bean file, rerun the project, but always can not parse the background of a few new fields, after a lengthy project inspection, I finally found that the original is because Eclipse does not automatically generate a new APK package, Running in fact is still the old package, so parsing the background data will certainly not parse those new fields, the solution to this problem is  clean   a bit.

Note: One situation is the exception, when the project's start icon (that is, the icon placed on the desktop), the Xiaomi MIUI operating system will not be updated immediately, do not do the clean operation, this may be due to Xiaomi's own icon caching mechanism, but we do not need to worry too much, After installing the APK, the icon will be replaced by the new icon in a few days.

When do I not use it?

Executive  clean   operation, you should determine if there is an error (red X-labeled Code) in the project, especially the layout and res resource XML Whether the document is normal, the person will run  clean   operation will only cause  r.java   file missing, let the project overall error.

Over, that's what I'm going to say today, if I find anything wrong with my article, Welcome to face, look forward to the Exchange ~

When should I do clean operation when developing Android with Eclipse?

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.