Getting Started with Android Studio



Hey all! If you are familiar with my articles, until now I have posted articles on PHP, CodeIgniter, Node.js and Angular.js . For a change I decided to give a fresh start on Android Studio as well. So lets get started. Hope you have installed Android Studio in to your computer.

To start Android app development, go to your Android Studio and start a new project.


Give a suitable name and location to your project. Select API 17 from the Minimum SDK in the window which you get next.



Then click next and you will get a window of various interface designs. As we are creating a basic application I choose Empty activity as my template.Then click Finish.Then a Project  will be created . This may take couple of minitues based on the PC you are using.


Click the project tab which I have highlighted in the left corner to get the whole project. Then go through each and every component in it. Go to app>src>main>res>layout>activity_main.xml to get the working area.There you will get a palette of all the components that you can use when continuing the development.



Always to get the preview of what you are doing you can click the preview button which is in the right side.To edit the code click the text button in the bottom. Then you will get a view as below.


Similar as HTML, the interface has been created by using XML. So lets change the text and see.


I have made some changes to the code as below.

<?xml version="1.0" encoding="utf-8"?><RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="com.example.user.myandroidapp.MainActivity">

    <TextView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:gravity="center"
        android:text="Hello World!. This is my first Project"
    />

</RelativeLayout>

Also you can make changes using the properties window in the right side by clicking the text view.



Hope you got a good understanding on the Android Studio Environment.

Comments

Popular posts from this blog

Java Part 2 :How to Install Java

Working with Buttons in Android Studio

Ruby - Dynamic, Open source programming language