Android Studio has gradually replaced eclipse as the mainstream IDE for Android, and now records the experience of using Android Studio.
Installation encountered problems:
-
The installation is simple, download it directly down run install on Android home mirror address Android Studio. First run after installation I've got a problem that always stuck on the boot screen.
Solution: first put the network disconnected, and then restart as can be, and then do not have to break the network can also start normally.
-
Ensure that you have installed the JDK and configured its environment variables before starting as. JDKJDK1 or JDK2
Configure environment variables: Right-click My Computer, select Properties, select Advanced System settings, select environment variables, and add the following environment variables to them:
JAVA_HOME--JDK installation path, for example: E:\Java\jdk1.7.9
The path to the Lib folder in Class_path--jdk, for example: E:\Java\jdk1.7.9\lib;.;
The path to the Bin folder in Path--jdk, for example: E:\Java\jdk1.7.9\bin
Detection is successful: Use Windows key +r to bring up the running window, enter CMD to bring up the DOS command line window, enter Java and javac two commands to see if it can run normally (there will be a large section of command prompt information).
-
I was installing as in July 15 when I was using JDK1.7, when I used JDK1.8 on other computers to start the Android studio times out of errors that the JDK could not find, and then started normally with JDK1.7.
Common shortcut keys (IntelliJ version):
Quick code Generation/hints:
logt--quickly generate the tag for this file
logd--Quick Build log.d ()
loge--Quick Build log.e ()
logm--Quick Build log.m ()
ctrl+alt+ Spaces-code hints (you can also hint when I use CTRL + SPACEBAR)
ctrl+alt+t--the selected area with If,try/catch,for and other statements
alt+insert--fast generation of constructor,getter,setter, etc.
ctrl+j--fast generation of code such as Toast,if,foreach,findviewbyid ()
code Edit/view:
ctrl+e--Opening Recent Files
ctrl+f--Find Code
ctrl+r--Replacement Code
ctrl+d--Copy the current line to the next line
ctrl+y--Delete When moving forward
ctrl+x--clipping the currently selected section
ctrl+c--Copy the selected section
ctrl+v--Paste the selected part
ctrl+s--Saving the current changes
ctrl+z--Recall Changes
ctrl+w--selects the code of the block in which the cursor is located, continuously expands the range of the selected block continuously
ctrl+n--Open a class
ctrl+b--view a declaration of a variable
ctrl+u--viewing the parent class of a class
ctrl+h--view the structure diagram of a class
ctrl+o--overriding a parent class method
Ctrl + "{" or "}"--to the beginning or end of curly braces
CTRL + F --Find a method in a class
ctrl+shift+alt+n--find a variable or method in a class
ctrl+alt+l--Formatting Code
Alt+ ← --– window back key
ctrl+alt+ ← --code return shortcut keys
ctrl+alt+h--viewing the invocation of a method
ctrl+shift+i--viewing the implementation of a method in a class
alt+up/down--jumps in the class's method
Double-press the SHIFT key two times--Global search
Of course, you can also modify the shortcut keys, using their own familiar shortcuts, but it may cause the conflict and inability to use the shortcut, we recommend using the default.
To Modify a shortcut key:
Use the problem encountered:
-
The first is the relationship between Project,module in as and Workspace,project in Eclipse. We can understand that for project in as, the corresponding workspace,moudle in eclipse corresponds to project.
-
There are two ways to find the Lib,assets folder when you just use as:
-
Method One: Right-click Module->new->folder->assets folder, where you can create a new favorite.
-
Method Two: Switch the view to Progect view and then open the module that needs to create the Lib folder, select Src->main-> Right-->new Directory, enter Jnilibs, Then switch back to Android view and there will be a Libs folder
-
Theme/font/style changes:
File--settings
-
Encountered a problem while learning NDK development:
In as, first download the NDK and configuration, select File, select Project Structure, if not previously downloaded, then the bottom of the Android NDK location should be blank, will prompt you to download. You can download it directly or download it yourself, then fill in the path here.
: Domestic Mirror website
After installation, remember to configure environment variables, right-click on My Computer, select Properties, select Advanced System settings, select environment variables, and add the path to the NDK behind path.
problems encountered:
However, when the configuration is complete, you are experiencing this problem when you are ready to learn:
Hint says yes: cannot resolve corresponding JNI function ....
Later found a solution, the plug-in Android NDK support canceled, restart as.
- Problems encountered while learning NDK development:
In the selection compile times out of such a mistake ERROR:NDK integration is deprecated in the current plugin. Consider trying the new experimental plugin. For details, Seehttp://tools.android.com/tech-docs/new-build-system/gradle-experimental. Set "Android.usedeprecatedndk=true" in gradle.properties to continue using the current NDK integration.
solution: As long as prompted, in the Gradle.properties file directly add the Android.usedeprecatedndk=true this sentence can be, and then recompile will not error.
Androidstudio Usage Summary