Installation Of Android Studio
Step 1 – System Requirements
You can start your Android application development on following operating systems −
- Microsoft® Windows® 8/7/Vista/2003 (32 or 64-bit).
- Mac® OS X® 10.8.5 or higher, up to 10.9 (Mavericks)
- GNOME or KDE desktop
Following is the list of software’s you will need before you start your Android application programming.
- Java JDK5 or later version (Download from http://www.oracle.com/technetwork/java/javase/downloads/index.html)
- Java Runtime Environment (JRE) 6 (Download from http://www.oracle.com/technetwork/java/javase/downloads/index.html)
- Android Studio (Download from https://developer.android.com/studio/index.html)
Step 2 – Setup Android Studio
Installation
Before installing Android Studio, Our Machine should required installed Java JDK. So first of all download JDK and then open Android Studio.exe file and click on next button shown in below image
Once you launched Android Studio, it’s time to select JDK5 path or later version in android studio installer and then click on next button.
Below the image initiating JDK to android SDK
Now check the components, which are required to create applications, below the image has selected Android Studio, Android SDK, Android Virtual Machine and performance(Intel chip) click on next button.
Specify the location of local machine path for Android studio and Android SDK and then click on next button.
Now specify the ram space for Android emulator by default it would take 512MB of local machine RAM
It will extract SDK packages into our local machine, it will take a while time to finish the task and would take 2626MB of Hard disk space.
After done all above steps perfectly, you must get finish button and it gone be open android studio project with Welcome to android studio message as shown below
Create First Project in Android
Now you can start your application development by calling start a new android studio project. in a new installation frame it will ask Application name, package information and location of the project.
After entered application name, it going to be called select phone and Tablet on which your application will runs , here need to specify Minimum SDK, I have selected as API21: Android 5.0(Lollipop) now my app will run on only 1% devices shown in below image.
The next level contain selecting the activity to mobile, it specifies the default layout for Applications
At the final stage it going to be open development tool to write the application code.
Create Android Virtual Device
To test your Android applications, you will need a virtual Android device. So before we start writing our code, let us create an Android virtual device. Launch Android AVD Manager Clicking AVD Manager icon or click on View>AVD Manager as shown below
After Click on a virtual device icon, it going to be shown by default virtual devices which are present on your SDK, or else need to create a virtual device by clicking Create new Virtual device button
If your AVD is created successfully it means your environment is ready for Android application development. If you like, you can close this window using top-right cross button. Better you re-start your machine and once you are done with this last step, you are ready to proceed for your first Android example but before that we will see few more important concepts related to Android Application Development.
Hello Word Example
Before Writing a Hello word code, you must know about XML tags .To write hello word code, you should redirect to App>res>layout>Activity_main.xml
To show hello word, we need to call text view with layout ( about text view and layout, you must take references about Relative Layout and Text View ).
<RelativeLayout xmlns:android=”http://schemas.android.com/apk/res/android”
xmlns:tools=”http://schemas.android.com/tools”
android:layout_width=”match_parent”
android:layout_height=”match_parent”
tools:context=”.MainActivity”>
<TextView android:text=”@string/hello_world”
android:layout_width=”wrap_content”
android:layout_height=”wrap_content” />
</RelativeLayout>
Now run the program by clicking Run>Run App or else need to call shift+f10 key. Finally, result should be placed at Virtual devices as shown below or you can run it on your own android device.