Friday, July 8, 2016

My first Android App - Starting with Android Studio

Let's enter in the world of Android App Development, in this article we will learn How to create a new Android App and about some important parts of Android Studio. I hope you have already setup the Environment for Android App Development, if not go to Install Android Studio.


In previous post we have already learned about UI Layout and Controls and Android Event Handling which are important for Starting with Android App Development.

So Let's start

First open Android Studio (It will take some time to load) and Click on Start a new Android Studio project as shown in image below

New Android Studio Project, Android Studio

Now you will see a Create New Project window, In this window you have to fill Application name (Name of Application you want to create, Here it is My First Application) and Company Domain (Here I am using my domain 2techup.com, you can use any Domain you want) and click Next, as shown in image below.

Configure your Project in Android Studio

Now select Minimum SDK, here it is API 9: Android 2.3 (Gingerbread)
NOTE: By selecting lower Minimum SDK you can target more no. of Android Users.
Target Android Devices, Android Studio

 Now select Empty Activity and click Next as shown below



Add new Activity, Android Studio

Add Activity Name and Layout Name to your Activity and click Finish.



Customize the Activity, Android Studio

Voila ! you first Android Project is created



First Android Project, Android Studio

You can also watch this Video to know "How to Create Android Project"

Some Important parts of Android Studio

1. Android Project directories and files

In this you can find directories and files such as 

Android Project directories and files, Android Studio

Manifests file - AndroidManifest.xml file is a important file that every Android Application must have in its root directory. It stores all essential information of each component.

Java file - It contains .java source files.

Res file - It contains layout of your Application and many other file, you can read more about res file here ( Resources in Android).

Gradle Scripts - It is a build system.

2. Palette

Palette, Android Studio

Palette contains a list of Layouts, Widgets, Text Fields, Containers and many other thing. From palette you can directly drag the Widgets to your Device screen and easily create a new application.

3. Component Tree and Properties

Component Tree and Properties, Android Studio

In Component Tree you can find complete list of Layout and Widgets on your Device Screen and by selecting any Component from Component Tree or from Device Screen you can change its properties from the property menu.

Now your first Application is ready you can run this application using Android Virtual Device (Shift + F10) or you can create .apk file (Build >> Build APK).

Be updated with our next post to become great Android Developer.

If you face any difficulty in understanding this, you can contact me through Contact Us form or through Facebook, Twitter, Snapchat or Instagram @iVishalMalik.