Android Studio experience, androidstudio
1. Configure the Mac or Windows 7 environment. Use gradle as an example.
(1) You can download gradle from here or go to the official website.
Add environment variables:
1. Start Terminal 2. Input cd ~ /Enter the home directory of the current user 3. Create. bash_profile file: touch. bash_profile4. open and edit: open. bash_profile5, add environment variable: export PATH =$ {PATH}:/Users/bill/Documents/software/gradle-2.2.1/bin
Test successful
Reload the environment variable: source. bash_profile to view the gradle: gradle-versino information.
(2) configure the environment in Win 7. Use gradle as an example.
My computer --> right-click --> properties --> advanced system settings --> advanced --> environment variables, add variables and values as follows
ANDROID_HOMEE:\android\android-sdk-windowsCLASSPATH%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.jar;GRADLE_HOMEE:\android\gradle-2.2.1JAVA_HOMEC:\Program Files\Java\jdk1.7.0_60PATH%JAVA_HOME%\bin;%JAVA_HOME%\jre\bin;%GRADLE_HOME%/bin;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;
Ii. Add code annotation
Configuration path: Files --> Settings --> File and Code Templates --> des
Modify the File Header:
/*** Write purpose here * @ FileName: * $ {PACKAGE_NAME }. $ {NAME }. java * @ author: myName * @ date: $ {YEAR}-$ {MONTH}-$ {DAY }$ {HOUR }: $ {MINUTE} * @ version V1.0 <describe the current version function> */
Enter your name for myName
In this way, the header file is automatically added when a java file is created.
How to reference File Header? When you create a class, the template is automatically referenced. The path is Files> Settings> File and Code Templates --> class
When creating the class file, we will automatically add a TAG in it and change the code.
#if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "")package ${PACKAGE_NAME};#end#parse("File Header.java")public class ${NAME} { private static final String TAG = "${NAME}";}
Click Apply to save the file. Now you can create a class file.
Package cn;/*** write purpose here ** @ version V1.0 <description of current version function> * @ FileName: cn. goods. java * @ author: myName * @ date: */public class Goods {private static final String TAG = "Goods ";}
Iii. Path for gradle to download jar
The download jar path is similar to this path: C: \ Users \ Administrator. WIN-20150423YCT \. gradle \ caches.
Find your own, such as: svnkit-1.7.12.jar, svnkit-1.7.12-sources.jar path
C: \ Users \ Administrator. WIN-20150423YCT \. gradle \ caches \ modules-2 \ files-2.1 \ org. tmatesoft. svnkit \ 1.7.12
What if the download is slow? Download it in your browser or FQ, copy it in, and restart Android Studio.
Iv. configuration of Android Studio
1. android studio encoding settings
Settings --> File Encodings --> Project Encoding is set to UTF-8.
2. Set the Gradle path for manual Installation
Settings --> Search Gradle to find Gradle --> Use local gradledistribution --> set the local Gradle path, my path is D: \ Java \ gradle-2.2.1
3. Set the font and font size of the subject and editor.
Set a topic: Settings --> Theme --> set a topic that you like, for example, Darcula.
Font of the editor itself: Settings --> Override default fonts by (not recommended): --> Name -->
Font Size: Settings --> Override default fonts by (not recommended): --> Size --> my Size is 13
4. Set the font size of the Java File
Copy a custom Scheme: Settings --> Search for Font --> Scheme --> Save As... --> Save one and then perform the operation.
Java file Font: Settings --> Search Font --> font --> Primary Font --> select the Font you like
Java file Font Size: Settings --> Search Font --> Size --> select the Font Size you like
5. Enable svn
Enable svn: VCS --> Enable Version Control Integration... --> Subversion --> OK
In this way, you can see the update down arrow and the submit up arrow.