Tuesday, June 30, 2015

Creating your first android application using Android Studio Part 1

This lesson shows how to create a new project using Android Studio.

Below screen show the options on starting Android Studio.

Select Start a new Android Studio Project. New screen as shown below will open. Enter all the fields - Application name, project location ( package name is also editable) then Click Next.
Choose the Android version for your target audience. After selecting API versions click Next
Next select the Activity Home screen for your application. Android studio provides in built code sample for various home screen layouts. Please choose the basic one - blank activity for learning purpose for now.


Next give proper name to your activity default one is MainActivity and we will continue with this only and select Finish.

After this Android studio will create all necessary folders and files for your project and open the below window for working on your project.


Lets first understand the project structure before working on project.

An Android project contains everything that defines your Android app, from app source code to build configurations and test code. The SDK tools require that your projects follow a specific structure so it can compile and package your application correctly.  Below screenshot 
.idea
Directory for IntelliJ IDEA settings.
app
Application module directories and files.
build
This directory stories the build output for all project modules.
gradle
Contains the gradler-wrapper files.
.gitignore
Specifies the untracked files that Git should ignore.
build.gradle
Customizable properties for the build system. You can edit this file to specify the default build settings used by the application modules and also set the location of your keystore and key alias so that the build tools can sign your application when building in release mode. This file is integral to the project, so maintain it in a source revision control system.
gradle.properties
Project-wide Gradle settings.
gradlew
Gradle startup script for Unix.
gradlew.bat
Gradle startup script for Windows.
local.properties
Customizable computer-specific properties for the build system, such as the path to the SDK installation. Because the content of the file is specific to the local installation of the SDK, the local.properties should not be maintained in a source revision control system.
.iml
Module file created by the IntelliJ IDEA to store module information.
settings.gradle
Specifies the sub-projects to build.

We will continue in next Part...