App Development

Our objective

Our objective is not to create a relevant application but we want to guide those who are not so geeky in programming and app development but want to start it from scratch. So here we have provided a tutorial of how can you setup android studio on your PC and start with your first project.

Introduction

Android OS is used in most of the smart phones. So we decided to find out how we can make an app for android platform. We are using android studio for developing an application but there are also some other software for making an application.

Why an application ?

As we know there are so many variety of apps available in Google play store which we can download. But those apps are built for general public use.

What we want to do is to get an basic idea that how an app is created so that in future we can create a really cool app which would would work according to one’s own need. Here in this project we are not going to create an app with versatile feature, rather we will focus on how to create even a very basic app.

So, to make an android app we will use a software named “Android Studio”
Android studio is an app developed by Google and is available for free. It is available for both linux, Mac and windows, written in Java, of IDE type.

An Android OS uses .apk file format for installing a application. After getting installed android sdk we will just create a new project. To test the app we will need an android virtual device and for that we can use AVD manager.

We will use some basic coding and simple technique to make an app.

Here we have shared a screenshot of android studio in which we have created a very basic app which will show the above animation on opening in an android phone.

shot.jpg

Getting Started

Prerequisites

To develop a simple application we need to have a basic knowledge of java and XML, however we can implement XML code by drag and drop feature in android studio.

INSTALLING ANDROID STUDIO ON UBUNTU

Download Android Studio from link given below:-
https://developer.android.com/sdk/index.htm

Unzipping the archive file:-
a)Navigate to the download folder using terminal with command cd <file_location>

b) Unzip the file by typing this command:-(Don’t Unzip now first read Note and step c))
sudo unzip <downloaded_file_filename> -d <installing_loaction>

Note:-
Every Time you want to start android studio you have to locate to the file manually <parent_ directory>/android-studio/bin /studio.sh. And to solve this we create an Path Environment variable.

What is Path Environment variable(PEV)?

PATH is an environment variable. It basically tells your machine where to search for programs, so when you run your android studio program you can just run this file
<parent_ directory>/android-studio/bin /studio.sh

c)To create PEV, the parent directory should be root/local directory. And to operate in root dir, we should be root user and to become root user type the command sudo -s then give your password(password will not be visible!!!) and press enter. Use this link to make PEV:-

http://askubuntu.com/questions/60218/how-to-add-a-directory-to-the-path

Installing Android Studio in Windows

1) Go to the page- https://developer.android.com/studio/index.html

2) Click on Download and download the setup.

3) Run the setup, do the formalities and install the studio.

SDK

Sdk stands for Software Development Kit, as its name suggest it is a type of kit which we will be needed for an application development. It has some sort of tools that allow us creating an application but it is software specific and the one which we are using is SDK for android studio. How to install it? We need not to worry so much about its installation as it automatically gets installed when we install the android studio.

For windows: In windows a directory will be created C:\Users\username\AppData\Local\Android\sdk.

For Linux: /lib64/Android/sdk

But the tools which will come with the default kit will not be sufficient to develop an simple application. So to install other kind of SDK you need to go to the official website of android studio and download from there.

Here is the code of a simple app we have developed -
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">

<ImageView
android:id="@+id/ImageView"
android:src="@drawable/grass"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="center" />
<TextView
android:id="@+id/hey"
android:text="Hey this our first app!"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="#ff0"
android:textSize="40sp"
android:background="#009688"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:textStyle="italic"/>
</RelativeLayout>

index.jpeg

Please click on image so that it become clear.

Group Members:-
Ashish Rana(2016022)
Deepak Malik(2016031)
Utkarsh Belwal(2016206)
Pankaj(2016176)
Mudit Goel(2016165)
Abhishek Tanwar(2016006)

[[size 1.5em]]
Credits:-
Maintaining the wiki dot page: Utkarsh Belwal
Introduction, Application on android studio(1st image): Ashish Rana
How to install android studio: Deepak Malik, Mudit Goel
JDK by Abhishek Tanwar
Last image and code by Ashish Rana and Utkarsh Belwal (Help taken from udacity)