android studio development (1) configuration

1. Download

Address: http://www.android-studio.org


2. Installation configuration:
Tips: Before installing Android Studio, it is recommended to prepare a separate Android SDK in advance, which can be downloaded from the AndroidDevTools website. People who have done Android development with Eclipse before can use the off-the-shelf Android SDK.
After Android Studio is installed, before starting the AS for the first time, in order to avoid re-downloading the new version of the SDK , you need to do the following:
Before starting the AS, open the installation directory, and add a line to the idea.properties file in the bin directory: disable .android.first.run=true is enough to avoid automatically re-downloading the SDK when the AS is opened for the first time. Right-click the installation package on the mac platform -> Show Package Contents to find the bin directory.
When you open Android Studio for the first time, you need to configure JDK and SDK:

In the above picture, select "Project Structure", and the following interface will pop up: (select the path of JDK and Android SDK)

 Note: Don't ask me how JDK and Android SDK came from ? The JDK needs to be installed in advance, and the Android SDK needs to be prepared in advance. Search a lot of such posts, and you can find them by yourself. 
Of course, when we use Android Studio in the future, we can also modify the paths of JDK and Android SDK at any time. Select "File-->Other Settings-->Default Sructure" to make the same modification.


The settings in the opened project are generally specific settings for the opened project. To take effect for all projects, you need to open:

File——Other Setting to set.


So I chose "Default Project Structure" and set the default stuff. So I found that the NDK path could not be set. No response when clicked. wipe. or so weird:




Clicking does not respond, and writing the path directly does not work. So look at the prompt text:


The directory where Android NDK is loaded. This location will be saved ndk.dir property in the local.properties file.


Meaning, this is the directory where the Android NDK is loaded. Setting this location will save properties of the form "ndk.dir" in the local.properties file.


chapped. It's useless. So see if the settings for specific projects will take effect. First select the open project in the project view, and then open: File - Project Structure. I found that it can be set up and can be used. So set:





Then check the project file and find that there are: local.properties file under the project, the content is:


[plain] view plaincopy 
  1. ## This file is automatically generated by Android Studio.  
  2. # Do not modify this file -- YOUR CHANGES WILL BE ERASED!  
  3. #  
  4. # This file must *NOT* be checked into Version Control Systems,  
  5. # as it contains information specific to your local configuration.  
  6. #  
  7. # Location of the SDK. This is only used by Gradle.  
  8. # For customization when using a Version Control System, please read the  
  9. # header note.  
  10. #Wed Mar 22 00:09:09 CST 2017  
  11. ndk.dir = D \: \\ Programming \\ Android \\ android-sdk \\ ndk-bundle  
  12. sdk.dir=D\:\\Programming\\Android\\android-sdk  





Guess you like

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