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