Once you’ve finished installing the required packages, you can configure your development environment.
Android Studio Project Structure
To verify your settings in Android Studio, open an existing project or create a new one, and navigate to File > Settings > Project Structure > SDK Location.
If present, verify that the following properties are set to the appropriate values:
Android SDK location
Android NDK location
Make note of these locations, as you’ll use them to set your environment variables in the next section. If Android NDK location is missing, locate the ndk folder and its latest version, typically under C:\Users\[username]\AppData\Local\Android\Sdk\ndk\[versionnumber] as you will use that path too.
Environment Variables and Path
With the locations recorded in the previous step, set the following environment variables:
Set the environment variable JAVA_HOME to the JDK location, typically C:\Program Files\Android\Android Studio\jre.
Set the environment variable ANDROID_HOME to the Android SDK location, typically C:\Users\[username]\AppData\Local\Android\Sdk.
Set the environment variable ANDROID_NDK_HOME to the Android NDK location, typically C:\Users\[username]\AppData\Local\Android\Sdk\ndk\[versionnumber].
Add the JDK tools directory to your PATH, typically C:\Program Files\Android\Android Studio\jre\bin.
Add the Android SDK platform-tools directory to your PATH, typically C:\Users\[username]\AppData\Local\Android\Sdk\platform-tools.
Add the Android SDK tools directory to your PATH, typically C:\Users\<username>\AppData\Local\Android\Sdk\tools.
Setting up your System to Detect your Android Device (Windows Only)
You must set up your system to detect your Android device over USB in order to run, debug, and test your application on an Android device.
You may need to install a USB driver for ADB after installing the Android SDK. The driver and installation instructions can be found on the Downloads page.
Windows may automatically detect the correct device and install the appropriate driver when you connect your device to a USB port on your computer.
Access the Device Manager through the Windows Control Panel. If the device was automatically detected, it will show up under Portable Devices in the Device Manager. Otherwise, look under Other Devices in the Device Manager and select the device to manually update the driver.
To see the list of detected attached devices, enter the following at a command prompt:
adb devices
Note: You will need to successfully set up your Android development environment in order to use this command.
If the device does not show up, verify that the device is turned on with enough battery power and that the driver is installed properly.