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-windowsplatformtools>




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 platformtools.
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”
Android Project Components
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.
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/connectingmysql-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

androidstudio.pptx
androidstudio.pptxandroidstudio.pptx
androidstudio.pptx
SundaresanB5
 
PPT on Android
PPT on AndroidPPT on Android
PPT on Android
Subhadip Chakraborty
 
Android ppt
Android pptAndroid ppt
Android ppt
Ansh Singh
 
Eclipse IDE
Eclipse IDEEclipse IDE
Eclipse IDE
Anirban Majumdar
 
Android studio
Android studioAndroid studio
Android studio
Paresh Mayani
 
Android Security
Android SecurityAndroid Security
Android Security
Arqum Ahmad
 
Android Application Development Using Java
Android Application Development Using JavaAndroid Application Development Using Java
Android Application Development Using Java
amaankhan
 
Android Architecture.pptx
Android Architecture.pptxAndroid Architecture.pptx
Android Architecture.pptx
priya Nithya
 
Mobile application development ppt
Mobile application development pptMobile application development ppt
Mobile application development ppt
tirupathinews
 
Evolution of android operating system
Evolution of android operating systemEvolution of android operating system
Evolution of android operating system
Md. Abdullah Al Maruf
 
Basic android-ppt
Basic android-pptBasic android-ppt
Basic android-ppt
Srijib Roy
 
Introduction to Android Development
Introduction to Android DevelopmentIntroduction to Android Development
Introduction to Android Development
donnfelker
 
Android studio ppt
Android studio pptAndroid studio ppt
Android studio ppt
Swapanpreet Kaur
 
Android fundamentals and tutorial for beginners
Android fundamentals and tutorial for beginnersAndroid fundamentals and tutorial for beginners
Android fundamentals and tutorial for beginnersBoom Shukla
 
Intro To Android App Development
Intro To Android App DevelopmentIntro To Android App Development
Intro To Android App Development
Mike Kvintus
 
Mobile Application Development With Android
Mobile Application Development With AndroidMobile Application Development With Android
Mobile Application Development With Android
guest213e237
 
Introduction to Android
Introduction to Android Introduction to Android
Introduction to Android
Ranjith Kumar
 
Android Platform Architecture
Android Platform ArchitectureAndroid Platform Architecture
Android Platform Architecture
Naresh Chintalcheru
 
Android ppt
Android pptAndroid ppt
Android ppt
Govind Raj
 
Android UI
Android UIAndroid UI
Android UI
nationalmobileapps
 

What's hot (20)

androidstudio.pptx
androidstudio.pptxandroidstudio.pptx
androidstudio.pptx
 
PPT on Android
PPT on AndroidPPT on Android
PPT on Android
 
Android ppt
Android pptAndroid ppt
Android ppt
 
Eclipse IDE
Eclipse IDEEclipse IDE
Eclipse IDE
 
Android studio
Android studioAndroid studio
Android studio
 
Android Security
Android SecurityAndroid Security
Android Security
 
Android Application Development Using Java
Android Application Development Using JavaAndroid Application Development Using Java
Android Application Development Using Java
 
Android Architecture.pptx
Android Architecture.pptxAndroid Architecture.pptx
Android Architecture.pptx
 
Mobile application development ppt
Mobile application development pptMobile application development ppt
Mobile application development ppt
 
Evolution of android operating system
Evolution of android operating systemEvolution of android operating system
Evolution of android operating system
 
Basic android-ppt
Basic android-pptBasic android-ppt
Basic android-ppt
 
Introduction to Android Development
Introduction to Android DevelopmentIntroduction to Android Development
Introduction to Android Development
 
Android studio ppt
Android studio pptAndroid studio ppt
Android studio ppt
 
Android fundamentals and tutorial for beginners
Android fundamentals and tutorial for beginnersAndroid fundamentals and tutorial for beginners
Android fundamentals and tutorial for beginners
 
Intro To Android App Development
Intro To Android App DevelopmentIntro To Android App Development
Intro To Android App Development
 
Mobile Application Development With Android
Mobile Application Development With AndroidMobile Application Development With Android
Mobile Application Development With Android
 
Introduction to Android
Introduction to Android Introduction to Android
Introduction to Android
 
Android Platform Architecture
Android Platform ArchitectureAndroid Platform Architecture
Android Platform Architecture
 
Android ppt
Android pptAndroid ppt
Android ppt
 
Android UI
Android UIAndroid UI
Android UI
 

Similar to Android tutorial ppt

Android tutorial
Android tutorialAndroid tutorial
Android tutorial
Jagannath Das
 
Android tutorial
Android tutorialAndroid tutorial
Android tutorial
Danish_k
 
Android tutorial
Android tutorialAndroid tutorial
Android tutorial
master760
 
Android chapter02-setup1-sdk
Android chapter02-setup1-sdkAndroid chapter02-setup1-sdk
Android chapter02-setup1-sdkTran Le Hoan
 
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
 
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
 
Getting started with android dev and test perspective
Getting started with android   dev and test perspectiveGetting started with android   dev and test perspective
Getting started with android dev and test perspective
Gunjan Kumar
 
Mobile app development snovasys
Mobile app development   snovasysMobile app development   snovasys
Mobile app development snovasys
xamarindevelopment
 
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 installation guide
Android installation guideAndroid installation guide
Android installation guidemagicshui
 
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
 
Module-I_Introduction-to-Android.pptx
Module-I_Introduction-to-Android.pptxModule-I_Introduction-to-Android.pptx
Module-I_Introduction-to-Android.pptx
lancelotlaytan1996
 
Notes Unit2.pptx
Notes Unit2.pptxNotes Unit2.pptx
Notes Unit2.pptx
MIT Autonomous Aurangabad
 
9780134433646 annuzzi ch02 (1)
9780134433646 annuzzi ch02 (1)9780134433646 annuzzi ch02 (1)
9780134433646 annuzzi ch02 (1)
Peter Mburu
 
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
 
Android development beginners faq
Android development  beginners faqAndroid development  beginners faq
Android development beginners faq
Khirulnizam Abd Rahman
 
Mobile application and Game development
Mobile application and Game developmentMobile application and Game development
Mobile application and Game development
Women In Digital
 
How to create android applications
How to create android applicationsHow to create android applications
How to create android applications
TOPS Technologies
 

Similar to Android tutorial ppt (20)

Android tutorial
Android tutorialAndroid tutorial
Android tutorial
 
Android tutorial
Android tutorialAndroid tutorial
Android tutorial
 
Android tutorial
Android tutorialAndroid tutorial
Android tutorial
 
Android chapter02-setup1-sdk
Android chapter02-setup1-sdkAndroid chapter02-setup1-sdk
Android chapter02-setup1-sdk
 
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
 
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
 
Getting started with android dev and test perspective
Getting started with android   dev and test perspectiveGetting started with android   dev and test perspective
Getting started with android dev and test perspective
 
Mobile app development snovasys
Mobile app development   snovasysMobile app development   snovasys
Mobile app development snovasys
 
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 installation guide
Android installation guideAndroid installation guide
Android installation guide
 
Android app developers in bangalore- thorsignia
Android app developers in bangalore- thorsigniaAndroid app developers in bangalore- thorsignia
Android app developers in bangalore- thorsignia
 
Module-I_Introduction-to-Android.pptx
Module-I_Introduction-to-Android.pptxModule-I_Introduction-to-Android.pptx
Module-I_Introduction-to-Android.pptx
 
Notes Unit2.pptx
Notes Unit2.pptxNotes Unit2.pptx
Notes Unit2.pptx
 
9780134433646 annuzzi ch02 (1)
9780134433646 annuzzi ch02 (1)9780134433646 annuzzi ch02 (1)
9780134433646 annuzzi ch02 (1)
 
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
 
Android development beginners faq
Android development  beginners faqAndroid development  beginners faq
Android development beginners faq
 
Mobile application and Game development
Mobile application and Game developmentMobile application and Game development
Mobile application and Game development
 
How to create android applications
How to create android applicationsHow to create android applications
How to create android applications
 

Recently uploaded

GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
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
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
Abida Shariff
 
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
 
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
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
CatarinaPereira64715
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
RTTS
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
Fwdays
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
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
 
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
 
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
 
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
 
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
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
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
 

Recently uploaded (20)

GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
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
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
 
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...
 
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
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.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...
 
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
 
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...
 
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
 
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
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
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
 

Android tutorial ppt

  • 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-windowsplatformtools>   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 platformtools. 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. Android Project Components 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.
  • 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/connectingmysql-database ● Local light weight database system. http://developer.android.com/reference/android/d atabase/sqlite/SQLiteDatabase.html