Eclipse Usage Tips Summary

Source: Internet
Author: User

Recently encountered some problems when developing Android with Eclipse, and share with you.

1. ADB exception: ADB server didn ' t Ack

First reset, the result is still abnormal;

Next task manager ends all ADB processes, and the results remain abnormal;

Finally the port of the ADB service and the port of the system service conflict, need to modify the ADB port, the general ADB default port is 5037, so you can use the following command to view all 5037 port processes:

Netstat-ano | Findstr "5037"

Execution results you will find that there are multiple processes using this port, so you need to modify the ADB port:

ADB forward tcp:5037 tcp:7777

If there is no successful modification, try adding environment variables:

android_adb_server_port=7777

2. When you right-click the Eclipse Project, Eclipse is stuck.

The situation I encountered was because I manually deleted the. Metadata caused by workspace, the solution is:

Window->general->startup and Shutdown->workspace to the right of your workspace, then remove the restart.

3. Import formatter format

Sometimes we need our own code format, we need to import our own format file:

window->java->codestyle->formatter-> Right Import

4. Save Automatic Formatting

The above 3 days add their own formatting, the first of the following 5 is the use of formatting, but sometimes we forget to execute the shortcut, so upload svn, resulting in a large area of conflict. To solve this problem, we can set eclipse to automatically format when saving the code, and even automatically adjust the import package:

window->java->editor->saveactions-> Right Select the desired action

5. Some shortcut keys

CTRL+SHIFT+F to format the code, just as in the above 3 format

Ctrl+shift+o adjusting import, including additions and deletions

Ctrl+shift+ Left/Right button to select a single word

Ctrl+alt+shift+ Left/Right click to select a row

ctrl+/Add double slash//comment to the selected code

ctrl+alt+/adding/**/comments to the selected code

Ctrl+1 Popup Modify Suggestions Box

Alt+shift+j add comments to the selected properties and methods

Alt+shift+r globally modifies the name of properties and methods, modifying multiple changes at once

Alt+shift+c Global Modification Method structure

Alt+shift+m to extract the selected code as a method

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.