Some experience with Android studio
1、 Mac or win 7 configuration environment, taking gradle as an example
(1) , you can find gradle to download here, or go to the official website
Add environment variables to MAC:
Is the test successful
(2) . win 7 configuration environment, taking gradle as an example
My computer (computer) - > right mouse button -- > properties -- > advanced system settings -- > Advanced -- > environment variables. Add variables and values as follows
2、 Add code annotation function
Configuration path: files -- > settings -- > file and code templates -- > includes
Modify the file header:
Myname fill in your name
This automatically adds header files when creating java files
How to reference file header? When creating a class, the template will be referenced automatically. The path is in files -- > settings -- > file and code templates -- > Templates -- > class
Let's try to automatically add a tag in the class file and change the code
Click apply to save. OK, now you can create a class file and try it
3、 Path to download jar from gradle
The path to download jars is similar to this path: C: \ users \ administrator.win-20150423yct \. Gradle \ caches.
Find the path for yourself, such as svnkit-1.7.12.jar and svnkit-1.7.12-sources.jar
C:\Users\Administrator.WIN-20150423YCT\.gradle\caches\modules-2\files-2.1\org.tmatesoft.svnkit\svnkit\1.7.12
What to do if the download is slow? Download it with your browser or FQ, copy it in, and restart Android studio
4、 Some configurations of Android studio
1. Android studio encoding settings
Settings -- > file encoding -- > Project encoding can be set to UTF-8.
2. Set the gradle path for manual installation
Settings -- > search gradle to find gradle -- > use local gradle Distribution -- > set the local gradle path. My path is D: \ Java \ gradle-2.2.1
3. Set the font and font size of the theme and editor itself
Set theme: settings -- > Theme -- > set your favorite theme. For example, I prefer darcula
Font of the editor itself: settings -- > override default fonts by (not recommended): -- > name -- > Microsoft YaHei
Font size: settings -- > override default fonts by (not recommended): -- > size -- > mine is 13
4. Sets the font size for java files
First copy a customized scheme:: settings -- > search font -- > scheme -- > Save as... -- > save a copy, and then do the following operations
Font of java file: settings -- > search font -- > font -- > primary font -- > select the font you like
Font size of java files: settings -- > search font -- > font -- > size -- > select the font size you like
5. Turn on SVN
Enable SVN function: VCs -- > enable version control integration... -- > Subversion -- > OK
Then you can see the update down arrow and submit up arrow
6. Android studio cannot submit files such as. So
Open the root directory of the file, select the file, right-click -- > TortoiseSVN -- > add, click the gradle syn project, and then submit it with Android studio
7. Where is the package downloaded by Android studio using grade's dependencies / compile?
It is usually placed in the. Gradle folder. For example, my is C: \ users \ administrator \. Gradle \ caches \ modules-2 \ files-2.1
For example, I want to use Facebook's fresco, add the code compile 'com. Facebook. Fresco: fresco: 0.6.0', and put the downloaded package in
C:\Users\Administrator\.gradle\caches\modules-2\files-2.1\com.facebook.fresco
8. The MAC simulator cannot be started. It is likely that it does not have permission. Use the command line to change the permissions of folders and files
For example, my android studio is installed in the Android folder
4、 Some problems encountered
1、mac android studio Server SSL certificate rejected
Open the terminal and enter the command SVN Co https://XXXX
For example: SVN Co https://192.136.1.70:433
Confirm the input at the terminal: P
So you can connect to SVN