SlideShare a Scribd company logo
Android Development Tutorial
Nikhil Yadav
CSE40816/60816 - Pervasive Health
Fall 2011
Outline

Setting up the Android Development
Environment (Windows)

Starters Android “Hello World” empty project

Android project components

Example: Tabbed application project

Accessing Sensors on an Android Device:
GPS, accelerometers and the Google API

Database connections – Local SQLite and
remote access
Android Development Environment

Download the latest JDK (Java distribution)

Download the Eclipse IDE (e.g. Galileo) from:
www.eclipse.org/downloads/

Install the Android SDK starter package from:
http://developer.android.com/sdk/index.html

In Eclipse, install the ADT (Android Developer
Tools) plugin:
http://developer.android.com/sdk/eclipse-adt.html

Instructions on setting up the SDK and
development Environment can be found on:
http://developer.android.com/sdk/installing.html
The Android SDK starter package

Not the full development environment, includes
the core SDK tools

Keep track of where you have downloaded this
it is required for the ADT plugin setup, e.g.
C:Program Filesandroid-sdk-windowsplatform-
tools>

Useful for “adb” commands
The ADT plugin

Gives access to Android development tools
from within the Eclipse IDE

Automates the process of building a new
Android project by setting up all the basic files
needed for development

Allows code signing of your app so it can be
distributed
Installing the ADT plugin
(Link: http://developer.android.com/sdk/eclipse-adt.html#installing)
To simplify ADT setup, it is recommend installing the Android SDK prior to installing ADT
.Eclipse 3.5 (Galileo) and 3.6 (Helios)
1.Start Eclipse, then select Help>Install New Software....
2.Click Add, in the top-right corner.
3.In the Add Repository dialog that appears, enter "ADT Plugin" for the Name and
the following URL for the Location:
https://dl-ssl.google.com/android/eclipse/
Note: If you have troubles try using "http" instead of "https”Click OK.
4.In the Available Software dialog, select the checkbox next to Developer Tools
and click Next.
5.In the next window, you'll see a list of the tools to be downloaded. Click Next.
6.Read and accept the license agreements, then click Finish.
7.When the installation completes, restart Eclipse.
Configuring the ADT plugin
1.Select Window>Preferences...to open the Preferences panel (Mac OS
X:Eclipse>Preferences).
2.Select Android from the left panel.
3.For the SDK Location in the main panel, click Browse...and locate your
downloaded SDK directory (e.g. C:Program Filesandroid-sdk-windows)
4.Click Apply, then OK
Android SDK and AVD manager

Add your virtual development devices using this

AVD is a target device simulator: no sensors
Android SDK and AVD Manager

Used for updating Android SDK tools etc.
Pointers
Update the system’s PATH variable to recognize two folders inside your
android-sdk-winwows. The first is: tools and the second is platform-
tools.
1.Windows > Start > Control Panel > System > Advanced > Environment
Variables > System Variables > PATH > Edit
2.Add references to the sub-folders mentioned above. In this example:
c:android-sdk-windowstools;C:android-sdk-windowsplatform-tools;
3.OK
Make sure Java and Eclipse Environments and path variables are setup
correctly:
Some interesting tutorials on Android projects can be found on:
http://www.hometutorials.com/google-android.html
Starters: “Hello World”
Once you complete the New Project Wizard, ADT creates the following
folders and files in your new project:
•src/ Includes your stub Activity Java file. All other Java files for your
application go here.
•<Android Version>/ (e.g., Android 1.5/) Includes the android.jar file
that your application will build against.
•gen/ This contains the Java files generated by ADT, such as your
R.java file and interfaces created from AIDL files.
•assets/This is empty. You can use it to store raw asset files.
•res/A folder for your application resources, such as drawable files,
layout files, string values, etc.
•AndroidManifest.xml The Android Manifest for your project.
•default.propertiesThis file contains project settings, such as the build
target.
Android Project Components
A Tabbed application
mainmenu.java
main.xml
Android Manifest.xml
tabs.java
Accessing Sensors
There are various sensors on the Android
phones, e.g. GPS, camera, accelerometer
 Cannot be tested on Simulator
 Tutorial and sample source code to use GPS
and accelerometer sensors available soon
● Using the Wi-Fi and Bluetooth Interfaces
instructions on:
http://www.tutorialforandroid.com/2009/10/turn-off-turn-on-wifi-in-android-using.html
http://developer.android.com/guide/topics/wireless/bluetooth.html
GPS Sensor Access
● To use GPS functionality in your Android application, you'll
need to add the ACCESS_FINE_LOCATION permission to
the AndroidManifest.xml file.
<uses-permission
android:name="android.permission.ACCESS_FINE_LOCATION" />
●In Android, location-based services are provided by the
LocationManager class located in the android.location
package.
● Using the LocationManager class, your application can
obtain periodic updates of the device's geographical locations
as well as fire an intent when it enters the proximity of a
certain location.
Accelerometer and Access to other
Sensors
● An instance of the SensorManager is required in order to
retrieve informations about the supported sensors.
● No permission is required to access the sensor service. It is
then possible to retrieve the list of available sensors of a
certain type.
● For an accelerometer sensor, the type to use is given by the
Sensor.TYPE_ACCELEROMETER constant.
● If at least one Sensor exists, it is possible to register a
SensorEventListener for a Sensor of the list.
● It is possible to specify the delivering rate for sensor
events. Specified rate must be one of :
SensorManager.SENSOR_DELAY_FASTEST : as fast as
possible
SensorManager.SENSOR_DELAY_GAME : rate suitable for
game
SensorManager.SENSOR_DELAY_NORMAL : normal rate
SensorManager.SENSOR_DELAY_UI : rate suitable for UI
Thread
Android and Databases
● Access to remote database e.g. MySQL can
occur using a PHP script hosted on the server
performing the query and JSON formatting for
data exchange for reference check out the
example at:
http://www.helloandroid.com/tutorials/connecting-
mysql-database
● Local light weight database system.
http://developer.android.com/reference/android/d
atabase/sqlite/SQLiteDatabase.html
Questions?
http://developer.android.com/index.html

More Related Content

What's hot

Android development beginners faq
Android development  beginners faqAndroid development  beginners faq
Android development beginners faq
Khirulnizam Abd Rahman
 
android-tutorial-for-beginner
android-tutorial-for-beginnerandroid-tutorial-for-beginner
android-tutorial-for-beginnerAjailal Parackal
 
Day1 before getting_started
Day1 before getting_startedDay1 before getting_started
Day1 before getting_started
Ahsanul Karim
 
Introduction to android coding
Introduction to android codingIntroduction to android coding
Introduction to android coding
Hari Krishna
 
Industrial Training in Android Application
Industrial Training in Android ApplicationIndustrial Training in Android Application
Industrial Training in Android Application
Arcadian Learning
 
Android chapter02-setup2-emulator
Android chapter02-setup2-emulatorAndroid chapter02-setup2-emulator
Android chapter02-setup2-emulator
guru472
 
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
 
Android Development
Android DevelopmentAndroid Development
Android Development
John Mark ジョンマーク
 
Android 6.0 Marshmallow - Everything you need to know !
Android 6.0 Marshmallow - Everything you need to know !Android 6.0 Marshmallow - Everything you need to know !
Android 6.0 Marshmallow - Everything you need to know !
Edureka!
 
Getting Started with Android Development
Getting Started with Android DevelopmentGetting Started with Android Development
Getting Started with Android Development
Edureka!
 
Android tutorial
Android tutorialAndroid tutorial
Android tutorial
master760
 
Android installation guide
Android installation guideAndroid installation guide
Android installation guidemagicshui
 
Week 1 - Android Study Jams
Week 1 - Android Study JamsWeek 1 - Android Study Jams
Week 1 - Android Study Jams
JoannaCamille2
 
Android Development Training
Android Development TrainingAndroid Development Training
Android Development Training
chandutata
 
Android Development Workshop
Android Development WorkshopAndroid Development Workshop
Android Development Workshop
Peter Robinett
 
Android, Gradle & Dependecies
Android, Gradle & DependeciesAndroid, Gradle & Dependecies
Android, Gradle & Dependecies
Édipo Souza
 
Android Studio Overview
Android Studio OverviewAndroid Studio Overview
Android Studio Overview
Salim Hosen
 
Android installation guide
Android installation guideAndroid installation guide
Android installation guide
Mohamed_Mubarak_Ali
 

What's hot (19)

Android development beginners faq
Android development  beginners faqAndroid development  beginners faq
Android development beginners faq
 
android-tutorial-for-beginner
android-tutorial-for-beginnerandroid-tutorial-for-beginner
android-tutorial-for-beginner
 
Day1 before getting_started
Day1 before getting_startedDay1 before getting_started
Day1 before getting_started
 
Introduction to android coding
Introduction to android codingIntroduction to android coding
Introduction to android coding
 
Industrial Training in Android Application
Industrial Training in Android ApplicationIndustrial Training in Android Application
Industrial Training in Android Application
 
Android chapter02-setup2-emulator
Android chapter02-setup2-emulatorAndroid chapter02-setup2-emulator
Android chapter02-setup2-emulator
 
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
 
Android Development
Android DevelopmentAndroid Development
Android Development
 
Android 6.0 Marshmallow - Everything you need to know !
Android 6.0 Marshmallow - Everything you need to know !Android 6.0 Marshmallow - Everything you need to know !
Android 6.0 Marshmallow - Everything you need to know !
 
Getting Started with Android Development
Getting Started with Android DevelopmentGetting Started with Android Development
Getting Started with Android Development
 
Android tutorial
Android tutorialAndroid tutorial
Android tutorial
 
AndroidManifest
AndroidManifestAndroidManifest
AndroidManifest
 
Android installation guide
Android installation guideAndroid installation guide
Android installation guide
 
Week 1 - Android Study Jams
Week 1 - Android Study JamsWeek 1 - Android Study Jams
Week 1 - Android Study Jams
 
Android Development Training
Android Development TrainingAndroid Development Training
Android Development Training
 
Android Development Workshop
Android Development WorkshopAndroid Development Workshop
Android Development Workshop
 
Android, Gradle & Dependecies
Android, Gradle & DependeciesAndroid, Gradle & Dependecies
Android, Gradle & Dependecies
 
Android Studio Overview
Android Studio OverviewAndroid Studio Overview
Android Studio Overview
 
Android installation guide
Android installation guideAndroid installation guide
Android installation guide
 

Viewers also liked

Confi - What is Gender
Confi - What is GenderConfi - What is Gender
Confi - What is Gender
Tess Brooks
 
Joan Paylor Resume 7-2014
Joan Paylor Resume 7-2014Joan Paylor Resume 7-2014
Joan Paylor Resume 7-2014Joan Paylor
 
Prezentacja suchecka
Prezentacja sucheckaPrezentacja suchecka
Prezentacja suchecka
agatasuchecka
 
23 pastoralepistles
23 pastoralepistles23 pastoralepistles
23 pastoralepistles
Zărnescu Mădălina
 
Curriculum Vitae v10
Curriculum Vitae v10Curriculum Vitae v10
Curriculum Vitae v10Lee Turner
 
Jornada: es posible internacionalizar el mercado de alimentos? | speakers
Jornada: es posible internacionalizar el mercado de alimentos? | speakersJornada: es posible internacionalizar el mercado de alimentos? | speakers
Jornada: es posible internacionalizar el mercado de alimentos? | speakers
BIB 360 - Agencia de Inbound Marketing
 
Emag SOE, Tezpur University Edition II
Emag SOE, Tezpur University Edition IIEmag SOE, Tezpur University Edition II
Emag SOE, Tezpur University Edition II
Shuvam Das Choudhury
 
Joan Paylor Resume 7-2014
Joan Paylor Resume 7-2014Joan Paylor Resume 7-2014
Joan Paylor Resume 7-2014Joan Paylor
 
Emag SOE, Tezpur University Edition I
Emag SOE, Tezpur University Edition IEmag SOE, Tezpur University Edition I
Emag SOE, Tezpur University Edition I
Shuvam Das Choudhury
 
Confi - What is Gender Intro
Confi - What is Gender IntroConfi - What is Gender Intro
Confi - What is Gender Intro
Tess Brooks
 
Relacioni
RelacioniRelacioni
Relacioniazradr
 
Renzo Piano
Renzo PianoRenzo Piano
Renzo Piano
azradr
 
Presentacion de la Academia de Inbound Marketing 2016 - BIB 360 / DOTZERO
Presentacion de la Academia de Inbound Marketing 2016 - BIB 360 / DOTZEROPresentacion de la Academia de Inbound Marketing 2016 - BIB 360 / DOTZERO
Presentacion de la Academia de Inbound Marketing 2016 - BIB 360 / DOTZERO
BIB 360 - Agencia de Inbound Marketing
 

Viewers also liked (15)

Confi - What is Gender
Confi - What is GenderConfi - What is Gender
Confi - What is Gender
 
Joan Paylor Resume 7-2014
Joan Paylor Resume 7-2014Joan Paylor Resume 7-2014
Joan Paylor Resume 7-2014
 
Prezentacja suchecka
Prezentacja sucheckaPrezentacja suchecka
Prezentacja suchecka
 
23 pastoralepistles
23 pastoralepistles23 pastoralepistles
23 pastoralepistles
 
amt
amtamt
amt
 
Curriculum Vitae v10
Curriculum Vitae v10Curriculum Vitae v10
Curriculum Vitae v10
 
Jornada: es posible internacionalizar el mercado de alimentos? | speakers
Jornada: es posible internacionalizar el mercado de alimentos? | speakersJornada: es posible internacionalizar el mercado de alimentos? | speakers
Jornada: es posible internacionalizar el mercado de alimentos? | speakers
 
Emag SOE, Tezpur University Edition II
Emag SOE, Tezpur University Edition IIEmag SOE, Tezpur University Edition II
Emag SOE, Tezpur University Edition II
 
Joan Paylor Resume 7-2014
Joan Paylor Resume 7-2014Joan Paylor Resume 7-2014
Joan Paylor Resume 7-2014
 
Emag SOE, Tezpur University Edition I
Emag SOE, Tezpur University Edition IEmag SOE, Tezpur University Edition I
Emag SOE, Tezpur University Edition I
 
Confi - What is Gender Intro
Confi - What is Gender IntroConfi - What is Gender Intro
Confi - What is Gender Intro
 
Relacioni
RelacioniRelacioni
Relacioni
 
Powerpoint msdm
Powerpoint msdmPowerpoint msdm
Powerpoint msdm
 
Renzo Piano
Renzo PianoRenzo Piano
Renzo Piano
 
Presentacion de la Academia de Inbound Marketing 2016 - BIB 360 / DOTZERO
Presentacion de la Academia de Inbound Marketing 2016 - BIB 360 / DOTZEROPresentacion de la Academia de Inbound Marketing 2016 - BIB 360 / DOTZERO
Presentacion de la Academia de Inbound Marketing 2016 - BIB 360 / DOTZERO
 

Similar to Android tutorial

Android tutorial ppt
Android tutorial pptAndroid tutorial ppt
Android tutorial pptRehna Renu
 
Android tutorial for beginners-traininginbangalore.com
Android tutorial for beginners-traininginbangalore.comAndroid tutorial for beginners-traininginbangalore.com
Android tutorial for beginners-traininginbangalore.com
TIB Academy
 
Android Training in Chandigarh | Industrial Training in Android Apps Development
Android Training in Chandigarh | Industrial Training in Android Apps DevelopmentAndroid Training in Chandigarh | Industrial Training in Android Apps Development
Android Training in Chandigarh | Industrial Training in Android Apps Development
Big Boxx Animation Academy
 
Mobile app development snovasys
Mobile app development   snovasysMobile app development   snovasys
Mobile app development snovasys
xamarindevelopment
 
Methods to set up android app development environment
Methods to set up android app development environmentMethods to set up android app development environment
Methods to set up android app development environment
astoria0128
 
Easy steps to develop android application (tutorial)
Easy steps to develop android application (tutorial)Easy steps to develop android application (tutorial)
Easy steps to develop android application (tutorial)
Dewan Razib
 
Android app developers in bangalore- thorsignia
Android app developers in bangalore- thorsigniaAndroid app developers in bangalore- thorsignia
Android app developers in bangalore- thorsignia
charan Teja
 
Synapseindia android application development tutorial
Synapseindia android application development tutorialSynapseindia android application development tutorial
Synapseindia android application development tutorial
Synapseindiappsdevelopment
 
Synapseindia android apps development tutorial
Synapseindia android apps  development tutorialSynapseindia android apps  development tutorial
Synapseindia android apps development tutorial
Synapseindiappsdevelopment
 
Notes Unit2.pptx
Notes Unit2.pptxNotes Unit2.pptx
Notes Unit2.pptx
MIT Autonomous Aurangabad
 
Module-I_Introduction-to-Android.pptx
Module-I_Introduction-to-Android.pptxModule-I_Introduction-to-Android.pptx
Module-I_Introduction-to-Android.pptx
lancelotlaytan1996
 
Mobile application and Game development
Mobile application and Game developmentMobile application and Game development
Mobile application and Game development
Women In Digital
 
Android
AndroidAndroid
Android
BVP GTUG
 
Android Application Development
Android Application DevelopmentAndroid Application Development
Android Application Development
onkar_bhosle
 
How to create android applications
How to create android applicationsHow to create android applications
How to create android applications
TOPS Technologies
 
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 studio
Android studioAndroid studio
Android studio
Andri Yabu
 

Similar to Android tutorial (20)

Android tutorial ppt
Android tutorial pptAndroid tutorial ppt
Android tutorial ppt
 
Android tutorial
Android tutorialAndroid tutorial
Android tutorial
 
Android tutorial for beginners-traininginbangalore.com
Android tutorial for beginners-traininginbangalore.comAndroid tutorial for beginners-traininginbangalore.com
Android tutorial for beginners-traininginbangalore.com
 
Android Training in Chandigarh | Industrial Training in Android Apps Development
Android Training in Chandigarh | Industrial Training in Android Apps DevelopmentAndroid Training in Chandigarh | Industrial Training in Android Apps Development
Android Training in Chandigarh | Industrial Training in Android Apps Development
 
Mobile app development snovasys
Mobile app development   snovasysMobile app development   snovasys
Mobile app development snovasys
 
Methods to set up android app development environment
Methods to set up android app development environmentMethods to set up android app development environment
Methods to set up android app development environment
 
Easy steps to develop android application (tutorial)
Easy steps to develop android application (tutorial)Easy steps to develop android application (tutorial)
Easy steps to develop android application (tutorial)
 
Android app developers in bangalore- thorsignia
Android app developers in bangalore- thorsigniaAndroid app developers in bangalore- thorsignia
Android app developers in bangalore- thorsignia
 
Synapseindia android application development tutorial
Synapseindia android application development tutorialSynapseindia android application development tutorial
Synapseindia android application development tutorial
 
Synapseindia android apps development tutorial
Synapseindia android apps  development tutorialSynapseindia android apps  development tutorial
Synapseindia android apps development tutorial
 
Notes Unit2.pptx
Notes Unit2.pptxNotes Unit2.pptx
Notes Unit2.pptx
 
Module-I_Introduction-to-Android.pptx
Module-I_Introduction-to-Android.pptxModule-I_Introduction-to-Android.pptx
Module-I_Introduction-to-Android.pptx
 
Mobile application and Game development
Mobile application and Game developmentMobile application and Game development
Mobile application and Game development
 
Android tutorial1
Android tutorial1Android tutorial1
Android tutorial1
 
Android
AndroidAndroid
Android
 
Anveshan android
Anveshan androidAnveshan android
Anveshan android
 
Android Application Development
Android Application DevelopmentAndroid Application Development
Android Application Development
 
How to create android applications
How to create android applicationsHow to create android applications
How to create android applications
 
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 studio
Android studioAndroid studio
Android studio
 

Recently uploaded

Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
DeeptiGupta154
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
Jisc
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
joachimlavalley1
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
Tamralipta Mahavidyalaya
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
Thiyagu K
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
Jisc
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
JosvitaDsouza2
 
Basic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumersBasic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumers
PedroFerreira53928
 
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptxMARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
bennyroshan06
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
Celine George
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
TechSoup
 
Sectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdfSectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdf
Vivekanand Anglo Vedic Academy
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
beazzy04
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
ESC Beyond Borders _From EU to You_ InfoPack general.pdf
ESC Beyond Borders _From EU to You_ InfoPack general.pdfESC Beyond Borders _From EU to You_ InfoPack general.pdf
ESC Beyond Borders _From EU to You_ InfoPack general.pdf
Fundacja Rozwoju Społeczeństwa Przedsiębiorczego
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
Balvir Singh
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
BhavyaRajput3
 
How to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS ModuleHow to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS Module
Celine George
 

Recently uploaded (20)

Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 
Basic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumersBasic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumers
 
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptxMARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
 
Sectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdfSectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdf
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
ESC Beyond Borders _From EU to You_ InfoPack general.pdf
ESC Beyond Borders _From EU to You_ InfoPack general.pdfESC Beyond Borders _From EU to You_ InfoPack general.pdf
ESC Beyond Borders _From EU to You_ InfoPack general.pdf
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
 
How to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS ModuleHow to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS Module
 

Android tutorial

  • 1. Android Development Tutorial Nikhil Yadav CSE40816/60816 - Pervasive Health Fall 2011
  • 2. Outline  Setting up the Android Development Environment (Windows)  Starters Android “Hello World” empty project  Android project components  Example: Tabbed application project  Accessing Sensors on an Android Device: GPS, accelerometers and the Google API  Database connections – Local SQLite and remote access
  • 3. Android Development Environment  Download the latest JDK (Java distribution)  Download the Eclipse IDE (e.g. Galileo) from: www.eclipse.org/downloads/  Install the Android SDK starter package from: http://developer.android.com/sdk/index.html  In Eclipse, install the ADT (Android Developer Tools) plugin: http://developer.android.com/sdk/eclipse-adt.html  Instructions on setting up the SDK and development Environment can be found on: http://developer.android.com/sdk/installing.html
  • 4. The Android SDK starter package  Not the full development environment, includes the core SDK tools  Keep track of where you have downloaded this it is required for the ADT plugin setup, e.g. C:Program Filesandroid-sdk-windowsplatform- tools>  Useful for “adb” commands
  • 5. The ADT plugin  Gives access to Android development tools from within the Eclipse IDE  Automates the process of building a new Android project by setting up all the basic files needed for development  Allows code signing of your app so it can be distributed
  • 6. Installing the ADT plugin (Link: http://developer.android.com/sdk/eclipse-adt.html#installing) To simplify ADT setup, it is recommend installing the Android SDK prior to installing ADT .Eclipse 3.5 (Galileo) and 3.6 (Helios) 1.Start Eclipse, then select Help>Install New Software.... 2.Click Add, in the top-right corner. 3.In the Add Repository dialog that appears, enter "ADT Plugin" for the Name and the following URL for the Location: https://dl-ssl.google.com/android/eclipse/ Note: If you have troubles try using "http" instead of "https”Click OK. 4.In the Available Software dialog, select the checkbox next to Developer Tools and click Next. 5.In the next window, you'll see a list of the tools to be downloaded. Click Next. 6.Read and accept the license agreements, then click Finish. 7.When the installation completes, restart Eclipse.
  • 7. Configuring the ADT plugin 1.Select Window>Preferences...to open the Preferences panel (Mac OS X:Eclipse>Preferences). 2.Select Android from the left panel. 3.For the SDK Location in the main panel, click Browse...and locate your downloaded SDK directory (e.g. C:Program Filesandroid-sdk-windows) 4.Click Apply, then OK
  • 8. Android SDK and AVD manager  Add your virtual development devices using this  AVD is a target device simulator: no sensors
  • 9.
  • 10. Android SDK and AVD Manager  Used for updating Android SDK tools etc.
  • 11. Pointers Update the system’s PATH variable to recognize two folders inside your android-sdk-winwows. The first is: tools and the second is platform- tools. 1.Windows > Start > Control Panel > System > Advanced > Environment Variables > System Variables > PATH > Edit 2.Add references to the sub-folders mentioned above. In this example: c:android-sdk-windowstools;C:android-sdk-windowsplatform-tools; 3.OK Make sure Java and Eclipse Environments and path variables are setup correctly: Some interesting tutorials on Android projects can be found on: http://www.hometutorials.com/google-android.html
  • 13.
  • 14.
  • 15. Once you complete the New Project Wizard, ADT creates the following folders and files in your new project: •src/ Includes your stub Activity Java file. All other Java files for your application go here. •<Android Version>/ (e.g., Android 1.5/) Includes the android.jar file that your application will build against. •gen/ This contains the Java files generated by ADT, such as your R.java file and interfaces created from AIDL files. •assets/This is empty. You can use it to store raw asset files. •res/A folder for your application resources, such as drawable files, layout files, string values, etc. •AndroidManifest.xml The Android Manifest for your project. •default.propertiesThis file contains project settings, such as the build target. Android Project Components
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 24.
  • 29. Accessing Sensors There are various sensors on the Android phones, e.g. GPS, camera, accelerometer  Cannot be tested on Simulator  Tutorial and sample source code to use GPS and accelerometer sensors available soon ● Using the Wi-Fi and Bluetooth Interfaces instructions on: http://www.tutorialforandroid.com/2009/10/turn-off-turn-on-wifi-in-android-using.html http://developer.android.com/guide/topics/wireless/bluetooth.html
  • 30. GPS Sensor Access ● To use GPS functionality in your Android application, you'll need to add the ACCESS_FINE_LOCATION permission to the AndroidManifest.xml file. <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> ●In Android, location-based services are provided by the LocationManager class located in the android.location package. ● Using the LocationManager class, your application can obtain periodic updates of the device's geographical locations as well as fire an intent when it enters the proximity of a certain location.
  • 31. Accelerometer and Access to other Sensors ● An instance of the SensorManager is required in order to retrieve informations about the supported sensors. ● No permission is required to access the sensor service. It is then possible to retrieve the list of available sensors of a certain type. ● For an accelerometer sensor, the type to use is given by the Sensor.TYPE_ACCELEROMETER constant. ● If at least one Sensor exists, it is possible to register a SensorEventListener for a Sensor of the list. ● It is possible to specify the delivering rate for sensor events. Specified rate must be one of :
  • 32. SensorManager.SENSOR_DELAY_FASTEST : as fast as possible SensorManager.SENSOR_DELAY_GAME : rate suitable for game SensorManager.SENSOR_DELAY_NORMAL : normal rate SensorManager.SENSOR_DELAY_UI : rate suitable for UI Thread
  • 33. Android and Databases ● Access to remote database e.g. MySQL can occur using a PHP script hosted on the server performing the query and JSON formatting for data exchange for reference check out the example at: http://www.helloandroid.com/tutorials/connecting- mysql-database ● Local light weight database system. http://developer.android.com/reference/android/d atabase/sqlite/SQLiteDatabase.html