1. Downloading Android Studio
Android Studio is the official integrated development environment (IDE) for the Android platform. It is developed by Google. Android Studio makes Android development much easier. You can download Android Studio from here: https://developer.android.com/studio/index.html
When you click on “Download Android Studio” you will be shown with a popup containing Terms and Conditions. Read the terms and conditions and check “I have read and agree with the above terms and conditions” checkbox and click on “Download Android Studio for Windows”. Now Android Studio will start downloading.
2. Installing Android Studio
Once the download is finished,
- Run the exe file and Click next.
- Choose “Standard” in type of setup and click Next until the installation finishes
Once the installation is finished the application would look like this
3. Creating first Android Project
Click on “Start a new Android Studio project”. Give name as “My First Android App” and domain as androiddeft.com
Now Choose the minimum SDK as API 15: Android 4.0.3 (IceCreamSandwitch). Most of the features on Android requires Android API 15 or above and Choosing API level 15 will allow your app to run on 97.4% of Android devices. Click Next.
Select Blank Activity and Click Next.
Click on Finish.
4. Creating Android Virtual Device (AVD)
Android Virtual Device helps in running the android app by emulating a virtual device. To create an AVD, choose Tools ► Android ► AVD Manager.
Click on Create Virtual Device. Choose any Phone of your favorite! and Click Next.
Select one of the installed System Image. If your desired API level is not installed, download it by clicking on Download.
Give a name to the AVD and Click Finish.
Now Click on Run (►) button against the newly created AVD in the AVD Manager.
Wait till the virtual device boots.
5. Running the Android Application in Android Virtual Device (AVD)
Select Run ►Run ‘app’, to install and run your application. Now a dialogue box will appear to select the target where you wish to run the application. Select the AVD you created (Nexus 4 API 24 in my case) and click OK.
Wait till the project is built and app is installed in the AVD. After successful installation the AVD would look as follows:
7. Installing Google USB Driver
In order to run Android application a mobile device you need to install Google USB driver on your desktop. To install Google USB Driver in Android Studio,
- Click Tools ► Android ► SDK Manager
- Click the SDK Tools tab
- Select Google USB Driver and click OK.
8. Enabling developer option in your Android phone
You need to enable developer option in your Android device in order to install and debug your apps via USB. To enable developer option in your Android phone, go to Settings ► About Phone ► Tap 7 times on “Build Number”. Once you have tapped7 times, a toast will appear saying that “You are now a Developer!”.
Now go to Settings ► Developer Options in your Android phone and check USB debugging
9. Running android application on Android phone
To run Android application on an Android phone you need to connect your phone to desktop via a USB. Go to Android Studio select Run ► Run ‘app’
From the dialogue box which shows up, select the device you have connected (Redmi Note 3 in my case) and click OK. Wait till the project is built and application gets installed in your phone. Below is the screenshot after successful installation.
If you face any issues do post in the comment section. We will try our best to suggest you appropriate solution.