Summary: Recently, for some reasons, the computer was replaced. After reinstalling Android studio, the previous configuration files had to be searched online. Here is a record, the system is window 10, Android studio 3.0.1
JAVA environment configuration
JDK download address: Java SE Development Kit 8 Downloads
JAVA_HOME : JDK installed on the computer
CLASSPATH : .;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.jar
Note: the first. Don't forget the
path : C:\Program Files\Java\jdk1.8.0_162\bin
C:\Program Files\Java\jdk1.8.0_162\jre\bin
Note: When configuring paths, list each one as a line
set up
studio software font settings
- File->Settings 或Ctrl + Alt +S
- Appearance & Behavior—>Appearance
- Check Override default fonts by (not recommended), then you can set the font style in Name and the font size in Size
- File->Settings 或Ctrl + Alt +S
- Editor—>Color & Fonts—>Font
- File->Settings 或Ctrl + Alt +S
- Editor->General->Code Completion
- The default setting in the red box is First letter, just change it to None
- File->Settings 或Ctrl + Alt +S
- Editor->Code Style->Java->Code Generation
- Fields->m
- Static field->s
- File->Settings 或Ctrl + Alt +S
- Editor -> Colors &Fonts ->java Reference color:
- File->Settings 或Ctrl + Alt +S
- KeyMap
- Enter comment in the upper right corner
- Select Fix doc comment and right click
- 点击Add Keyboard Shortcut
- Enter the shortcut key, if there is a conflict, it will remind (personally shift+j)
- File->Settings 或Ctrl + Alt +S
- Editor -> Colors &Fonts -> Android Logcat or enter Logcat in the search box above
- Verbose , Info, Debug and other options, and then uncheck Use Inberited attributes
- Then select the check box in front of Foreground, you can double-click the box behind to select the color
- File->Settings 或Ctrl + Alt +S
- Editor->Color & Fonts->Console Font
- File->Settings 或Ctrl + Alt +S
- Editor–>File and code Template
- Includes->File Header
Code font settings
not case sensitive
member variable m and static variable s
Java comment color
|name | colour |
---|---|
Block comment | 1C8057 |
Java ->Text | 629755 |
Line comment | 2B800F |
Document Comment Shortcut Settings
Logcat
Logcat color settings
Reference color:
Log level | colour |
---|---|
Assert | 8F0005 |
Debug | 0070BB |
Error | FF0006 |
Info | 48BB31 |
Verbose | BBBBBB |
Warning | BBBB23 |
Logcat font size
template
class annotation
A simple template for my own use
/** * ======================================= * Created by: Hu Yulin * Date: ${DATE} - ${TIME} * Description: * ======================================= */
Live Templates define templates
This stuff is too much, hee hee. Leave the connection (mainly lazy, not limited to copy)
Android Studio uses Live Templates to define templates
Edit Template Variables Dialog
jks
jks create
Android Studio generates jks keys and Gradle multi-channel packaging
jks modification
1. Modify the keystore password
keytool -storepasswd -keystore xxxx.jks
2. Modify the alias password
keytool -keypasswd -keystore xxxx.jks -alias alias name
3. Modify alias name
keytool -changealias -keystore xxxx.jks -alias alias name -destalias new alias name
4. View keystore signature
keytool -list -v -keystore app-release.jks
Common confusion
Butter Knife
github Link
version greater than 7
#butterknife
-keep class butterknife.** { *; }
-dontwarn butterknife.internal.**
-keep class **$$ViewBinder { *; }
-keepclasseswithmembernames class * {
@butterknife.* <fields>;
}
-keepclasseswithmembernames class * {
@butterknife.* <methods>;
}
version less than
#butterknife
-keep class butterknife.** { *; }
-dontwarn butterknife.internal.**
-keep class **$$ViewInjector{ *; }
-keepclasseswithmembernames class * {
@butterknife.* <fields>;
}
-keepclasseswithmembernames class * {
@butterknife.* <methods>;
}
okgo
github Link
okgo, okrx, okrx2, okserver All codes can be obfuscated, but since the bottom layer uses okhttp, it cannot be obfuscated, so just add the following obfuscated code.
#okhttp
-dontwarn okhttp3.**
-keep class okhttp3.**{*;}
#okio
-dontwarn okio.**
-keep class okio.**{*;}
Of course, if you really don't need to obfuscate okgo's code, you can continue to add the following code
#okgo
-dontwarn com.lzy.okgo.**
-keep class com.lzy.okgo.**{*;}
#okrx
-dontwarn com.lzy.okrx.**
-keep class com.lzy.okrx.**{*;}
#okrx2
-dontwarn com.lzy.okrx2.**
-keep class com.lzy.okrx2.**{*;}
#okserver
-dontwarn com.lzy.okserver.**
-keep class com.lzy.okserver.**{*;}
glide
-keep public class * implements com.bumptech.glide.module.GlideModule
-keep public class * extends com.bumptech.glide.module.AppGlideModule
-keep public enum com.bumptech.glide.load.ImageHeaderParser$** {
**[] $VALUES;
public *;
}
# for DexGuard only
-keepresourcexmlelements manifest/application/meta-data@value=GlideModule