A, AndroidStudio Settings
Easy to download settting import directly
Link: pan.baidu.com/s/1kVMETON password: L96A including shortcut keys and so on is also my Settings oh… So be careful…
1. Configure environment variables
The JDK configuration
Right-click computer Properties
- Create a JAVA_HOME variable
- Enter the JDK installation path (remember not to include \bin)
- Configure to path %JAVA_HOME%\bin;
(must add “; “)
verify
The ADB configuration
Configure adb’s path directly into path; For example, D: \ Android_Sdk \ SDK \ platform – the tools)
verify
2, the configuration AndroidStudio
- Disallows Android Studio to detect updates on startup
Find \ bin \ idea. The properties file, open at the end of the line: disable. Android. First, the run = true
- Modify the theme, modify the global font
Change the theme. If you want a cool dark theme, change it to Darcula. Choose a font with Chinese, otherwise there will be a lot of mouth, I use Microsoft YaHei UI, very good.
- Disables automatic opening of last project
In this case, when opening AS, the interface stays in the project selection interface
- Disable automatic check for updates
- Mouse hover display document, formatting & guide package prompt
- Hover the mouse pointer for several times to display the document and change the time yourself.
- Is to format the code or guide the package, whether it will show a dialog box, if you feel annoying, cancel it, anyway I cancelled.
- Configure shortcut Keys
- Display line number, display method separator line
- Code folding,
Intellij IDEA has a lot of places where the code can automatically fold, but I don’t like it, so I cancel it. You can collapse and expand code
- Code intelligence hints
- Type All, None, and First letter. None, of course.
- Automatically pop up the document, time to do.
- Automatic guide package
- Create a personal code style configuration
- In order to protect the default code style configuration, the user can restore the configuration even if it is broken. IDEA does not allow the default configuration to be modified, and users need to create the configuration to modify.
Select the subject and Save As a copy.
-
Modify the code font
-
The Consolas font is recommended
- Modify console fonts
- Logcat font
If you want to change it, you have to uncheck 1
Log level ———– color value
VERBOSE ———–BBBBBB
DEBUG ———–0070BB
INFO ———– 48BB31
WARN ———–BBBB23
ERROR ———–FF0006
ASSERT ———–8F0005
- Modify comment location to disable “Statement heap One Line”
- Modify the prefix and suffix of a variable
- The static member is S, the ordinary member is M, which is kind of interesting
- Modify the new file header
/**
* @author (WJF)
* @datetime ${YEAR}-${MONTH}-${DAY} ${HOUR}:${MINUTE} GMT+8
* @email [email protected]
* @detail :
*/
Copy the code
Effect:
- Configure custom comment code:
- Creating a Template Group
2. Select the newly created template group — New
- Remove parameter preview in method
Android Studio wireless debugging
1, no plug-in, ADB command for wireless debugging
Use the mobile hotspot of windows10. After opening the hotspot, use the mobile phone to link the hotspot from the computer to ensure that the mobile phone and the computer are in the same network environment
Author debug environment
- 1, notebook (mine is ThinkPadT480 Win10)
- 2, mobile (mine is oneplus 6,android9.0)
- 3,Android development environment (configure environment ADB command variables)
- 4. Connect the phone with USB cable, open developer mode and agree to computer debugging (this step will not be explained too much)
After the phone is connected to the computer, execute the ADB command
1,adb tcpip 5555
Copy the code
Adb shell IP -f inet addr show wlan0Copy the code
Adb Connect Mobile PHONE IP:5555Copy the code
All right, unplug the cable and you can debug wirelessly
2,AndroidStudio install plugin to implement wireless debugging (recommended)
AndroidStudio plugin market search ** Android WiFiADB**
Follow the above method without plug-ins, use the own mobile hotspot, so that the mobile phone and computer in the same network segment
Tools–WIFI ADB in the AS main interface
Find an online device and unplug it
Three, AS commonly used plug-ins and shortcuts
1. Common plug-ins
- Wifi debugging plugin —-Android WiFiADB
- ButterKinif and FindViewById plugins –GenerateFindViewById
- Json string format — Gsonformat
- Android Parcelable Code Generator helps entity beans generate the Parcelable interface
2. Common shortcut keys
- Ctrl+Alt+Shift+F7 Finds where a method or resource is referenced
- Ctrl+Shift+Space Global search
- Ctrl + Alt + M (select some code) quickly extract into a method
- Alt+ Enter import package, automatic correction (conflict with system input method need to modify)
- Ctrl+U: View the implementation of the parent class
- Ctrl+Q: View the class description
- Ctrl + O: Quick overwrite method
- Ctrl + N find classes
- Ctrl+F12 view all methods of this class. Enter the corresponding method name to search
- Ctrl+F3 Quickly finds a variable or class (equivalent to Ctrl+O in Eclipse)
- Ctrl+Alt+V extract into a local variable
- Ctrl+Alt+F extract into a member variable
- Ctrl+Alt+C extract into a constant
- Ctrl+Alt+L formatting code (conflict with QQ hotkey)
- Ctrl+Alt+O optimize imported classes and packages (clear invalid package references)
- Ctrl+Shift+U Case conversion
- Ctrl+Alt+T quickly generate struct (generate if,if/else,try catch, etc.)
- Alt+Insert generates code (e.g. Get,set methods, constructors, etc.)
- Alt+F7 finds a reference to a variable
- Ctrl+F7 highlights a variable
- Ctrl+E or Alt+Shift+C code that was changed recently
- Ctrl+F finds text
- Ctrl+Shift+Space auto-complete code
- Ctrl+ space code prompt (conflicts with system shortcut key)
- Ctrl+Alt+Space Indicates the class name or interface name
- Ctrl+P method parameter prompt
- Ctrl+Shift+Alt+N finds a method or variable in a class
- Double Shift: global search, slightly different from Alt+H, this is global search, down to the file name level.
- Shift+F6 Refactoring – Rename
- Ctrl + Y delete rows
- Ctrl + D copy
- Ctrl + F find
- Ctrl + R find + replace
- Ctrl+E: View the most recently opened file
- Ctrl+Shift+E: View the most recently edited file
- Alt+Shift+D: Debug
- Ctrl+F9: Compile project
- F4: View the inheritance or implementation relationship of the class
- Ctrl+/ or Ctrl+Shift+/ comment (// or)
- Ctrl+J automatic code
- Ctrl+H displays the class inheritance structure diagram
- Alt+F1 finds where the code is
- Alt+ Up/Down moves position quickly between methods
- Ctrl+Shift+Up/Down code moves Up/Down.
- Alt + Shift + Up/Down to move code Up and Down
- F2 or Shift+F2 highlighting errors or warnings for quick location
- Alt+← : Move back to the previous view or edit location
- Alt+→ : To move forward. For example, if you want to go back to the last point, you can use this shortcut key
- Alt+↑ : Move up the line of code where the cursor is
- Alt+↓ : Moves the line of code at the cursor position down
- Ctrl+Alt+(=) equals expands the code for a method collapse
- Ctrl+Alt+(-) minus folds the code for a method
- Ctrl+Shift +(=) equals expands the fully folded code
- Ctrl+Shift +(-) minus folds the code for all methods
Debug shortcut key
-
F5: But do not debug inside the function.
-
F6: But no debugging does not go inside the function.
-
F7: returns from inside the function to the point of call.
-
F8: Execute to the next breakpoint, execute complete if there is no breakpoint.
-
Resolve Ctrl+ space conflict with system input method
- Set the global search shortcut key
AndroidStudio version control tool to use
1, use the SVN
In Android-studio, -SVN ignores file Settings
As shown in the figure
Add the ignore file as follows
<ignored path=".gradle/" />
<ignored path=".idea/" />
<ignored path="gradle/" />
<ignored path="xxx/build/" />
<ignored mask="*.iml" />
<ignored path="local.properties" />
<ignored path="gradle.properties" />
<ignored path="build/" />
<ignored mask="*.apk" />
Copy the code