SlideShare a Scribd company logo
Android Application
Development Session-1
From Beginner to Advanced
By : Ahesanali Suthar
email: ahesanali.suthar@gmail.com
Topics to be Covered
1.

Introduction of Android.

2.

Android SDK.

3.

Setting Up Development Environment (Windows,Linux).

4.

Creating Project in Eclipse.

5.

Tutorial-1: Hello World

6.

Android Project Directory Structure.
1. Introduction of Android
●

Android is a Linux-based operating system designed primarily for
touchscreen mobile devices such as smartphones and tablet computers,
developed by Google in conjunction with the Open Handset Alliance.

●

Initially developed by Android Inc, whom Google financially backed and
later purchased in 2005.

●

Android has a large community of developers writing applications ("apps")
that extend the functionality of devices, written primarily in a customized
version of Java.They are available for download through Google Play or
third-party sites.

●

The first Android-powered phone was sold in October 2008, and by the
end of 2010 Android had become the world's leading smartphone platform,
overtaking Symbian which held its record for years
2. Android SDK
●

The Android SDK (SDK refers to Software Development KIT)provides you
the API libraries and developer tools necessary to build, test, and debug
apps for Android.

●

Like in windows we have .NET Framework as a SDK for developing the
Softwares for windows platform.Similarly java provide JDK(Java Dev. Kit).
But java provide kit for Linux as well as for windows.

●

To Download SDK: http://developer.android.com/sdk/index.html

●

To know more about Android SDK: http://developer.android.
com/sdk/exploring.html
3. Dev Environment
System Requirements.(OS) (http://developer.android.com/sdk/index.html)
●
●
●

Windows XP (32-bit), Vista (32- or 64-bit), or Windows 7 (32- or 64-bit)
Mac OS X 10.5.8 or later (x86 only)
Linux (tested on Ubuntu Linux, Lucid Lynx)
GNU C Library (glibc) 2.7 or later is required.
On Ubuntu Linux, version 8.04 or later is required.
64-bit distributions must be capable of running 32-bit applications.

Eclipse IDE
●
●
●
●

Eclipse 3.6.2 (Helios) or greate ()
Android SDK
JDK 6 (JRE alone is not sufficient)
Android Development Tools plugin (ADT)
3. Dev Environment (Cont.)
●

After Downloading Android SDK,We have to download platform packages.
3. Dev Environment (Cont.)
●

Once we are done with downloading platform packages either we are
developing on Windows or Linux or Mac we need to install ADT (Android
Development Toolkit) in Eclipse IDE.

To Install ADT into the Eclipse IDE follow below steps.
1. Open Eclipse IDE.
2. Click on Help->Install New Software from the menu bar.
3. Then install window is open then Click on Add Button
3. Dev Environment (Cont.)
●

Now when you click on Add button,you will found below window.

Insert the Name as ADT(any name can be given) and Location of ADT zip file.
Location can be given by clicking on Archive button and then press Ok.
3. Dev Environment (Cont.)
Setting up SDK path into Eclipse IDE
● Open Preferences window by clicking Window -> Preferences.
●

If we have properly installed ADT in Eclipse we have Android option in
Preferences window.

●

As you can see on above image by Clicking on Android in preferences
window we have option available for SDK path.

●

So by clicking Browse button please select android-sdk-window folder
from your computer.so SDK location field have complete path of Android
SDK.So finally you have a setup ready for Android Development.
4.Creating Project in Eclipse
●
●

Open Eclipse IDE.
Click on File->New->Android Project
from file menu.

●

Application Name is the app name that
appears to users. For this project, use "My
First App."
Project Name is the name of your project
directory and the name visible in Eclipse.
Package Name is the package
namespace for your app.
Minimum Required SDK is the lowest
version of Android that your app supports,
indicated using the API level.
Target SDK indicates the highest version
of Android (also using the API level) with
which you have tested with your
application.
Compile With is the platform version
against which you will compile your app.
Click on Next button.

●
●
●

●

●
●
4.Creating Project in Eclipse
●
●
●

The next screen can help you create a launcher icon for your app.Click
Next.
Now you can select an activity template from which to begin building your
app. For this project, select BlankActivity and click Next
Finally click on the Finish.
5.Tutorial-1: Hello World
●

After creating project in eclipse ,run the project by right click on the project
name and Runs As -> Android Application.

●

If simulator is created previously project will run in that other wise it eclipse
will ask for create new simulator.
6.Android Project Directory
Structure.
●

Now we are learning how this hello world is printed
on the screen.

●

Following Image shows android project directory
structure.

●

src: This is the directory where all java files for the
project will reside. In java there is a concept of
package so here files are maintained in packages.
Like in our case there is one package called com.
maktabah which we have entered at the time of
project creation.

●

gen: In this folder the files which are generated by
android-sdk.We are not changing any of the files
here,Because this is the internal reference to sdk.
6.Android Project Directory
Structure.
●

assets: Here resource type information will goes.Like
fonts file,web-pages(when we are developing android
app in HTML5)

●

bin: When are compiling the project all class files are
generated here by java compiler.

●

res: This is important folder we are discussing each
inner directory in detail.

●

drawable-hdpi,drawable-ldpi,drawable-mdpi,
drawable-xhdpi: These are the directories where we
are putting images that are used in projects.
○ But we have question like why these many
directories(4 directories).So the answer is these
are the directory dedicated for different screen
density(in Desktop computer terminology we call
it resolution of the Monitor).
6.Android Project Directory
Structure.
○

●

How android app decide which image to talk
when it is referenced from code we will see it
when we see implementation of the sample
tutorial.

To read more about for these directories please follow
the link:
http://developer.android.
com/guide/practices/screens_support.html

●

Consider following image for example.
6.Android Project Directory
Structure.
i.
ii.
iii.
iv.

xlarge screens are at least 960dp x 720dp
large screens are at least 640dp x 480dp
normal screens are at least 470dp x 320dp
small screens are at least 426dp x 320dp

●

layout: This is the directory where we are putting all design
files in xml format.As we can see from right side image
when we create new project default main.xml file is there.

●

These layout xmls files are responsible for the userinterface and look and feel of the app.

●

Like in windows application when we are working in visual
studio IDE we have two files one for design and one for
code.Whenever we place button in design and double click
on it and button_click function in different file and button
User interface is in design file
6.Android Project Directory
Structure.
●

Sample Layout code:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello" />
</LinearLayout>
6.Android Project Directory
Structure.
●

values: It contains all xml file for values like styles xml,
string constants and other.

●

As we can see im right side image the when we create a
new android project it only contains string.xml which
contains strings values in xml format for whole project.

●

Strings for lable,error message and titles etc are stored in
string.xml files.We can also write strings at lable in
layout.xml, but it is good practice to declare strings in
string.xml for managing resource in project and
reusability
6.Android Project Directory
Structure.
●

Example of basic string.xml:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="hello">Hello World, HelloWorldActivity!</string>
<string name="app_name">HelloWorld</string>
</resources>
6.Android Project Directory
Structure.
AndroidManifest.xml:
●

This is the file where we declaring application components like Activities,
Services,Broadcast-Receivers.

●

Allowing permissions to application

●

We can also call it is a configuration file for the app.
6.Android Project Directory
Structure.
Sample of Manifest for HelloWord App:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.maktabah"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="8" />
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name" >
<activity
android:name=".HelloWorldActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
Questions ?
Android session 1

More Related Content

What's hot

Android Fundamental
Android FundamentalAndroid Fundamental
Android Fundamental
Arif Huda
 
Android application-component
Android application-componentAndroid application-component
Android application-component
Ly Haza
 
Ppt 2 android_basics
Ppt 2 android_basicsPpt 2 android_basics
Ppt 2 android_basics
Headerlabs Infotech Pvt. Ltd.
 
Introduction to android
Introduction to androidIntroduction to android
Introduction to android
Shrijan Tiwari
 
Day 15: Working in Background
Day 15: Working in BackgroundDay 15: Working in Background
Day 15: Working in BackgroundAhsanul Karim
 
Android UI Fundamentals part 1
Android UI Fundamentals part 1Android UI Fundamentals part 1
Android UI Fundamentals part 1
Marcos Paulo Souza Damasceno
 
Android development orientation for starters v4 seminar
Android development orientation for starters v4   seminarAndroid development orientation for starters v4   seminar
Android development orientation for starters v4 seminar
Joemarie Amparo
 
Getting started with android studio
Getting started with android studioGetting started with android studio
Getting started with android studio
Reham Maher El-Safarini
 
android layouts
android layoutsandroid layouts
android layoutsDeepa Rani
 
What is Android?
What is Android?What is Android?
What is Android?
ndalban
 
Android tutorial
Android tutorialAndroid tutorial
Android tutorial
katayoon_bz
 
Android tutorial
Android tutorialAndroid tutorial
Android tutorial
Ed Zel
 
Android Development Made Easy - With Sample Project
Android Development Made Easy - With Sample ProjectAndroid Development Made Easy - With Sample Project
Android Development Made Easy - With Sample Project
Joemarie Amparo
 
Android Development: Build Android App from Scratch
Android Development: Build Android App from ScratchAndroid Development: Build Android App from Scratch
Android Development: Build Android App from Scratch
Taufan Erfiyanto
 
View groups containers
View groups containersView groups containers
View groups containersMani Selvaraj
 
Android Development project
Android Development projectAndroid Development project
Android Development projectMinhaj Kazi
 
Day 3: Getting Active Through Activities
Day 3: Getting Active Through ActivitiesDay 3: Getting Active Through Activities
Day 3: Getting Active Through ActivitiesAhsanul Karim
 

What's hot (20)

Android Fundamental
Android FundamentalAndroid Fundamental
Android Fundamental
 
Android development module
Android development moduleAndroid development module
Android development module
 
Android application-component
Android application-componentAndroid application-component
Android application-component
 
Ppt 2 android_basics
Ppt 2 android_basicsPpt 2 android_basics
Ppt 2 android_basics
 
Introduction to android
Introduction to androidIntroduction to android
Introduction to android
 
Day 15: Working in Background
Day 15: Working in BackgroundDay 15: Working in Background
Day 15: Working in Background
 
Android UI Fundamentals part 1
Android UI Fundamentals part 1Android UI Fundamentals part 1
Android UI Fundamentals part 1
 
Android development orientation for starters v4 seminar
Android development orientation for starters v4   seminarAndroid development orientation for starters v4   seminar
Android development orientation for starters v4 seminar
 
Getting started with android studio
Getting started with android studioGetting started with android studio
Getting started with android studio
 
Android
AndroidAndroid
Android
 
android layouts
android layoutsandroid layouts
android layouts
 
What is Android?
What is Android?What is Android?
What is Android?
 
Android tutorial
Android tutorialAndroid tutorial
Android tutorial
 
Android tutorial
Android tutorialAndroid tutorial
Android tutorial
 
Android tutorial
Android tutorialAndroid tutorial
Android tutorial
 
Android Development Made Easy - With Sample Project
Android Development Made Easy - With Sample ProjectAndroid Development Made Easy - With Sample Project
Android Development Made Easy - With Sample Project
 
Android Development: Build Android App from Scratch
Android Development: Build Android App from ScratchAndroid Development: Build Android App from Scratch
Android Development: Build Android App from Scratch
 
View groups containers
View groups containersView groups containers
View groups containers
 
Android Development project
Android Development projectAndroid Development project
Android Development project
 
Day 3: Getting Active Through Activities
Day 3: Getting Active Through ActivitiesDay 3: Getting Active Through Activities
Day 3: Getting Active Through Activities
 

Similar to Android session 1

Introduction to Android and Java.pptx
Introduction to Android and Java.pptxIntroduction to Android and Java.pptx
Introduction to Android and Java.pptx
GandhiMathy6
 
Day: 2 Environment Setup for Android Application Development
Day: 2 Environment Setup for Android Application DevelopmentDay: 2 Environment Setup for Android Application Development
Day: 2 Environment Setup for Android Application DevelopmentAhsanul Karim
 
Java Meetup - 12-03-15 - Android Development Workshop
Java Meetup - 12-03-15 - Android Development WorkshopJava Meetup - 12-03-15 - Android Development Workshop
Java Meetup - 12-03-15 - Android Development Workshop
Kasun Dananjaya Delgolla
 
ANDROID PPT 1.pdf
ANDROID PPT 1.pdfANDROID PPT 1.pdf
ANDROID PPT 1.pdf
Siva Krishna Prasad
 
Seminar on android app development
Seminar on android app developmentSeminar on android app development
Seminar on android app development
AbhishekKumar4779
 
Android app development ppt
Android app development pptAndroid app development ppt
Android app development ppt
saitej15
 
Android Basic
Android BasicAndroid Basic
Android Basic
Nirav Ranpara
 
Android app development lesson 1
Android app development lesson 1Android app development lesson 1
Android app development lesson 1
Kalluri Vinay Reddy
 
Creating the first app with android studio
Creating the first app with android studioCreating the first app with android studio
Creating the first app with android studio
Parinita03
 
Android from A to Z
Android from A to ZAndroid from A to Z
Android from A to Z
BADR
 
Android deep dive
Android deep diveAndroid deep dive
Android deep dive
AnuSahniNCI
 
Android from A to Z
Android from A to ZAndroid from A to Z
Android from A to Z
Hazem Hagrass
 
How to create android applications
How to create android applicationsHow to create android applications
How to create android applications
TOPS Technologies
 
Android application development
Android application developmentAndroid application development
Android application developmentslidesuren
 
Android by LAlitha
Android by LAlithaAndroid by LAlitha
Android by LAlitha
Lally Lalitha
 
Android App Development Overview- HKInfoway Technologies.pdf
Android App Development Overview- HKInfoway Technologies.pdfAndroid App Development Overview- HKInfoway Technologies.pdf
Android App Development Overview- HKInfoway Technologies.pdf
hkinfowaytech hkinfowaytech
 

Similar to Android session 1 (20)

Introduction to Android and Java.pptx
Introduction to Android and Java.pptxIntroduction to Android and Java.pptx
Introduction to Android and Java.pptx
 
Day: 2 Environment Setup for Android Application Development
Day: 2 Environment Setup for Android Application DevelopmentDay: 2 Environment Setup for Android Application Development
Day: 2 Environment Setup for Android Application Development
 
Java Meetup - 12-03-15 - Android Development Workshop
Java Meetup - 12-03-15 - Android Development WorkshopJava Meetup - 12-03-15 - Android Development Workshop
Java Meetup - 12-03-15 - Android Development Workshop
 
ANDROID PPT 1.pdf
ANDROID PPT 1.pdfANDROID PPT 1.pdf
ANDROID PPT 1.pdf
 
Seminar on android app development
Seminar on android app developmentSeminar on android app development
Seminar on android app development
 
Android app development ppt
Android app development pptAndroid app development ppt
Android app development ppt
 
Android Basic
Android BasicAndroid Basic
Android Basic
 
Android
Android Android
Android
 
Android app development lesson 1
Android app development lesson 1Android app development lesson 1
Android app development lesson 1
 
Android dev o_auth
Android dev o_authAndroid dev o_auth
Android dev o_auth
 
Creating the first app with android studio
Creating the first app with android studioCreating the first app with android studio
Creating the first app with android studio
 
Android from A to Z
Android from A to ZAndroid from A to Z
Android from A to Z
 
Android deep dive
Android deep diveAndroid deep dive
Android deep dive
 
Android from A to Z
Android from A to ZAndroid from A to Z
Android from A to Z
 
Internship presentation
Internship presentationInternship presentation
Internship presentation
 
How to create android applications
How to create android applicationsHow to create android applications
How to create android applications
 
Android application development
Android application developmentAndroid application development
Android application development
 
Android by LAlitha
Android by LAlithaAndroid by LAlitha
Android by LAlitha
 
Google Android
Google AndroidGoogle Android
Google Android
 
Android App Development Overview- HKInfoway Technologies.pdf
Android App Development Overview- HKInfoway Technologies.pdfAndroid App Development Overview- HKInfoway Technologies.pdf
Android App Development Overview- HKInfoway Technologies.pdf
 

Recently uploaded

Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Product School
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
Elena Simperl
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Product School
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Tobias Schneck
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
Product School
 

Recently uploaded (20)

Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 

Android session 1

  • 1. Android Application Development Session-1 From Beginner to Advanced By : Ahesanali Suthar email: ahesanali.suthar@gmail.com
  • 2. Topics to be Covered 1. Introduction of Android. 2. Android SDK. 3. Setting Up Development Environment (Windows,Linux). 4. Creating Project in Eclipse. 5. Tutorial-1: Hello World 6. Android Project Directory Structure.
  • 3. 1. Introduction of Android ● Android is a Linux-based operating system designed primarily for touchscreen mobile devices such as smartphones and tablet computers, developed by Google in conjunction with the Open Handset Alliance. ● Initially developed by Android Inc, whom Google financially backed and later purchased in 2005. ● Android has a large community of developers writing applications ("apps") that extend the functionality of devices, written primarily in a customized version of Java.They are available for download through Google Play or third-party sites. ● The first Android-powered phone was sold in October 2008, and by the end of 2010 Android had become the world's leading smartphone platform, overtaking Symbian which held its record for years
  • 4. 2. Android SDK ● The Android SDK (SDK refers to Software Development KIT)provides you the API libraries and developer tools necessary to build, test, and debug apps for Android. ● Like in windows we have .NET Framework as a SDK for developing the Softwares for windows platform.Similarly java provide JDK(Java Dev. Kit). But java provide kit for Linux as well as for windows. ● To Download SDK: http://developer.android.com/sdk/index.html ● To know more about Android SDK: http://developer.android. com/sdk/exploring.html
  • 5. 3. Dev Environment System Requirements.(OS) (http://developer.android.com/sdk/index.html) ● ● ● Windows XP (32-bit), Vista (32- or 64-bit), or Windows 7 (32- or 64-bit) Mac OS X 10.5.8 or later (x86 only) Linux (tested on Ubuntu Linux, Lucid Lynx) GNU C Library (glibc) 2.7 or later is required. On Ubuntu Linux, version 8.04 or later is required. 64-bit distributions must be capable of running 32-bit applications. Eclipse IDE ● ● ● ● Eclipse 3.6.2 (Helios) or greate () Android SDK JDK 6 (JRE alone is not sufficient) Android Development Tools plugin (ADT)
  • 6. 3. Dev Environment (Cont.) ● After Downloading Android SDK,We have to download platform packages.
  • 7. 3. Dev Environment (Cont.) ● Once we are done with downloading platform packages either we are developing on Windows or Linux or Mac we need to install ADT (Android Development Toolkit) in Eclipse IDE. To Install ADT into the Eclipse IDE follow below steps. 1. Open Eclipse IDE. 2. Click on Help->Install New Software from the menu bar. 3. Then install window is open then Click on Add Button
  • 8. 3. Dev Environment (Cont.) ● Now when you click on Add button,you will found below window. Insert the Name as ADT(any name can be given) and Location of ADT zip file. Location can be given by clicking on Archive button and then press Ok.
  • 9. 3. Dev Environment (Cont.) Setting up SDK path into Eclipse IDE ● Open Preferences window by clicking Window -> Preferences. ● If we have properly installed ADT in Eclipse we have Android option in Preferences window. ● As you can see on above image by Clicking on Android in preferences window we have option available for SDK path. ● So by clicking Browse button please select android-sdk-window folder from your computer.so SDK location field have complete path of Android SDK.So finally you have a setup ready for Android Development.
  • 10. 4.Creating Project in Eclipse ● ● Open Eclipse IDE. Click on File->New->Android Project from file menu. ● Application Name is the app name that appears to users. For this project, use "My First App." Project Name is the name of your project directory and the name visible in Eclipse. Package Name is the package namespace for your app. Minimum Required SDK is the lowest version of Android that your app supports, indicated using the API level. Target SDK indicates the highest version of Android (also using the API level) with which you have tested with your application. Compile With is the platform version against which you will compile your app. Click on Next button. ● ● ● ● ● ●
  • 11. 4.Creating Project in Eclipse ● ● ● The next screen can help you create a launcher icon for your app.Click Next. Now you can select an activity template from which to begin building your app. For this project, select BlankActivity and click Next Finally click on the Finish.
  • 12. 5.Tutorial-1: Hello World ● After creating project in eclipse ,run the project by right click on the project name and Runs As -> Android Application. ● If simulator is created previously project will run in that other wise it eclipse will ask for create new simulator.
  • 13. 6.Android Project Directory Structure. ● Now we are learning how this hello world is printed on the screen. ● Following Image shows android project directory structure. ● src: This is the directory where all java files for the project will reside. In java there is a concept of package so here files are maintained in packages. Like in our case there is one package called com. maktabah which we have entered at the time of project creation. ● gen: In this folder the files which are generated by android-sdk.We are not changing any of the files here,Because this is the internal reference to sdk.
  • 14. 6.Android Project Directory Structure. ● assets: Here resource type information will goes.Like fonts file,web-pages(when we are developing android app in HTML5) ● bin: When are compiling the project all class files are generated here by java compiler. ● res: This is important folder we are discussing each inner directory in detail. ● drawable-hdpi,drawable-ldpi,drawable-mdpi, drawable-xhdpi: These are the directories where we are putting images that are used in projects. ○ But we have question like why these many directories(4 directories).So the answer is these are the directory dedicated for different screen density(in Desktop computer terminology we call it resolution of the Monitor).
  • 15. 6.Android Project Directory Structure. ○ ● How android app decide which image to talk when it is referenced from code we will see it when we see implementation of the sample tutorial. To read more about for these directories please follow the link: http://developer.android. com/guide/practices/screens_support.html ● Consider following image for example.
  • 16. 6.Android Project Directory Structure. i. ii. iii. iv. xlarge screens are at least 960dp x 720dp large screens are at least 640dp x 480dp normal screens are at least 470dp x 320dp small screens are at least 426dp x 320dp ● layout: This is the directory where we are putting all design files in xml format.As we can see from right side image when we create new project default main.xml file is there. ● These layout xmls files are responsible for the userinterface and look and feel of the app. ● Like in windows application when we are working in visual studio IDE we have two files one for design and one for code.Whenever we place button in design and double click on it and button_click function in different file and button User interface is in design file
  • 17. 6.Android Project Directory Structure. ● Sample Layout code: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/hello" /> </LinearLayout>
  • 18. 6.Android Project Directory Structure. ● values: It contains all xml file for values like styles xml, string constants and other. ● As we can see im right side image the when we create a new android project it only contains string.xml which contains strings values in xml format for whole project. ● Strings for lable,error message and titles etc are stored in string.xml files.We can also write strings at lable in layout.xml, but it is good practice to declare strings in string.xml for managing resource in project and reusability
  • 19. 6.Android Project Directory Structure. ● Example of basic string.xml: <?xml version="1.0" encoding="utf-8"?> <resources> <string name="hello">Hello World, HelloWorldActivity!</string> <string name="app_name">HelloWorld</string> </resources>
  • 20. 6.Android Project Directory Structure. AndroidManifest.xml: ● This is the file where we declaring application components like Activities, Services,Broadcast-Receivers. ● Allowing permissions to application ● We can also call it is a configuration file for the app.
  • 21. 6.Android Project Directory Structure. Sample of Manifest for HelloWord App: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.maktabah" android:versionCode="1" android:versionName="1.0" > <uses-sdk android:minSdkVersion="8" /> <application android:icon="@drawable/ic_launcher" android:label="@string/app_name" > <activity android:name=".HelloWorldActivity" android:label="@string/app_name" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application> </manifest>