Android Studio installation environment configuration

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

  1. File->Settings 或Ctrl + Alt +S
  2. Appearance & Behavior—>Appearance
  3. Check Override default fonts by (not recommended), then you can set the font style in Name and the font size in Size
    1. Code font settings

      1. File->Settings 或Ctrl + Alt +S
      2. Editor—>Color & Fonts—>Font

      not case sensitive

      1. File->Settings 或Ctrl + Alt +S
      2. Editor->General->Code Completion
      3. The default setting in the red box is First letter, just change it to None

      member variable m and static variable s

      1. File->Settings 或Ctrl + Alt +S
      2. Editor->Code Style->Java->Code Generation
      3. Fields->m
      4. Static field->s

      Java comment color

      |
      1. File->Settings 或Ctrl + Alt +S
      2. Editor -> Colors &Fonts ->java
      3. Reference color:
        name colour
        Block comment 1C8057
        Java ->Text 629755
        Line comment 2B800F

      Document Comment Shortcut Settings

      1. File->Settings 或Ctrl + Alt +S
      2. KeyMap
      3. Enter comment in the upper right corner
      4. Select Fix doc comment and right click
      5. 点击Add Keyboard Shortcut
      6. Enter the shortcut key, if there is a conflict, it will remind (personally shift+j)

      Logcat

      Logcat color settings

      1. File->Settings 或Ctrl + Alt +S
      2. Editor -> Colors &Fonts -> Android Logcat or enter Logcat in the search box above
      3. Verbose , Info, Debug and other options, and then uncheck Use Inberited attributes
      4. Then select the check box in front of Foreground, you can double-click the box behind to select the color

      Reference color:

      Log level colour
      Assert 8F0005
      Debug 0070BB
      Error FF0006
      Info 48BB31
      Verbose BBBBBB
      Warning BBBB23

      Logcat font size

      1. File->Settings 或Ctrl + Alt +S
      2. Editor->Color & Fonts->Console Font

      template

      class annotation

      1. File->Settings 或Ctrl + Alt +S
      2. Editor–>File and code Template
      3. Includes->File Header

      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

github Link

-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

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324671691&siteId=291194637