SlideShare ist ein Scribd-Unternehmen logo
1 von 61
Ilias ahmed
EEL 6788- Advanced Topics in Wireless Networks
Objectives
 Android application development overview
 Getting started
Outline
 Background information
 Creating development environment
 “Hello, Android” tutorial/demo
 Install/Debug application on Android phone device
 “Sensors” API sample demo
What is Android?
 Android is a software stack for mobile devices that includes an operating
system, middleware, and key applications.
 Android Software Development Kit (SDK)
 Provides the tools and APIs necessary to begin developing applications on the
Android platform using the Java programming language.
 Includes a debugger, libraries, a handset emulator (based on QEMU),
documentation, sample code, and tutorials
 Android Market is an online software store developed by Google for Android
devices
 An application program ("app") called "Market" is preinstalled on most
Android devices and allows users to browse and download apps published by
third-party developers, hosted on Android Market
 As of December 2010, the Android Market had over 200,000 applications
History
 Android mobile operating system initially developed by
Android Inc, based in Palo Alto, CA.
 Android's co-founders
 Andy Rubin (co-founder of Danger),
 Rich Miner (co-founder of Wildfire Communications, Inc.)
 Nick Sears (once VP at T-Mobile)
 Chris White (headed design and interface development at
WebTV)
 Android was bought by Google in 2005.
 Its co-founders went to work for Google
 Google and other members of the Open Handset Alliance
collaborated on Android's development and release
 Android has been available under a free software / open source
license since October ,2008
Meet Android
Co-Founders
 Rick Miner Andy Rubin Nick Sears

Chris White picture not yet found
Operating System Overview
 Powered by the Linux kernel
 Consists of 12 million lines of code including:
3 million lines of XML
2.8 million lines of C
2.1 million lines of Java
1.75 million lines of C++
http://en.wikipedia.org/wiki/Android_(operating_system)
Current API Distribution
 Version 1.0 was released on 23rd September 2008
 Newest version, 3.0, was release on 26th January
2011.
 Distribution as of 01/04/11
Android Architecture
 5 major components: Applications, Application Frameworks, Libraries,
Android Runtime, and Linux Kernel
Platform Architecture Videos
 Presenter: Mike Cleron, Android development team
member.
 Video 1 of 3 (13 minute): architecture overview +
replacing and reusing components example
Application Components
 An activity presents a visual user interface
Present a list of menu items users can choose
Display photographs along with their captions
Activities work together to form a cohesive user
interface, however each activity is independent of the
others.
 Service doesn't have a visual user interface, runs in the
background for an indefinite period of time
Media player’s music playback service
Application Components
(Cont.)
 Broadcast receiver: is a component that receives and reacts to
broadcast announcements
 let other applications know that some data has been downloaded
to the device and is available for use.
 Content provider :
 Makes a specific set of the application's data available to other
applications
 Enables other applications to retrieve and store data of the type it
controls
http://developer.android.com/guide/topics/fundamentals.html
Activity Life Cycle
http://developer.android.com/guide/topics/fundamentals.html
Android Features
Part 1
 Application framework enabling reuse and replacement of components
 Dalvik virtual machine optimized for mobile devices
 Integrated browser based on the open source WebKit engine
 Optimized graphics powered by
 Custom 2D graphics library;
 3D graphics based on the OpenGL ES 1.0 specification (hardware
acceleration optional)
 SQLite for structured data storage
 http://developer.android.com/guide/basics/what-is-android.html
Android Features
Part 2
 Media support for common audio, video, and still image formats
(MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, GIF)
 GSM Telephony (hardware dependent)
 Bluetooth, EDGE, 3G, and WiFi (hardware dependent)
 Camera, GPS, compass, and accelerometer (hardware
dependent)
 Rich development environment including a device emulator,
tools for debugging, memory and performance profiling, and a plug-
in for the Eclipse IDE
 http://developer.android.com/guide/basics/what-is-android.html
Application Fundamentals
 Written in the Java programming language.
 Code along with any required data and resource files are
compiled into an Android package, .apk file.
 Installed on mobile devices
 Runs in its own Linux process
 Has its own virtual machine (VM),
 Is assigned a unique Linux user ID
Permissions are set so that the application's files are visible
only to that user and only to the application itself
 http://developer.android.com/guide/topics/fundamental
s.html
Android Central Feature
 Replace and Reuse
 One application can make use of elements of other applications provided
those applications permit it.
 One application doesn't incorporate the code of the other application or
link to it. Rather, it simply starts up that piece of the other application
when the need arises.
 For this to work, the system must be able to start an application process
when any part of it is needed, and instantiate the Java objects for that part.
 Unlike applications on most other systems, Android applications don't have
a single entry point for everything in the application (no main() function, for
example).
 Rather, they have essential components that the system can instantiate and
run as needed.
http://developer.android.com/guide/topics/fundamentals.html
Intents
 Is the 5th key class
 Objects that hold the content of the message
 Activities, services, and broadcast receivers — are activated by
intents
 For activities and services, it names the action being requested
and specifies the URI of the data to act on, among other things
 Request for an activity to present an image to the user or let the user
edit some text
 For broadcast receivers, it names the action being announced
 Announce to interested parties that the camera button has been
pressed
http://developer.android.com/guide/topics/fundamentals.html
Manifest file
 Before Android can start an application component, it
must learn that the component exists.
 Applications must declare their components in a manifest
file
 Is a structured XML file, named AndroidManifest.xml
for all applications.
 Declares the application's components
 Names any libraries the application needs to be linked
against (besides the default Android library)
 Identifies any permissions the application expects to be
granted
http://developer.android.com/guide/topics/fundamentals.html
Manifest File Example
 <?xml version="1.0" encoding="utf-8"?>
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
 package="com.example.helloandroidtoo"
 android:versionCode="1"
 android:versionName="1.0">
 <application android:icon="@drawable/icon" android:label="@string/app_name"
android:debuggable="true">
 <activity android:name=".HelloAndroid"
 android:label="@string/app_name">
 <intent-filter>
 <action android:name="android.intent.action.MAIN" />
 <category android:name="android.intent.category.LAUNCHER" />
 </intent-filter>
 </activity>
 android:debuggable="true"
 </application>
 <uses-sdk android:minSdkVersion="8" />
 </manifest>
http://developer.android.com/guide/topics/fundamentals.html
Supported Operating Systems
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
Supported Development
Environments
 Recommended: Eclipse
 Eclipse IDE 3.4 (Ganymede) or greater
 Eclipse IDE for Java Developers
 Eclipse Classic (versions 3.5.1 and higher)
 Eclipse IDE for Java EE Developers
 Eclipse JDT plug-in (included in most Eclipse IDE packages)
 JDK 5 or JDK 6 (JRE alone is not sufficient)
 Android Development Tools plug-in (recommended)
 Other development environments or IDEs
 JDK 5 or JDK 6 (JRE alone is not sufficient)
 Apache Ant 1.8 or later
 Not compatible with Gnu Compiler for Java (gcj)
Set up Development
Environment
 Review system requirements
 Installing Java SDK
 Download Eclipse IDE
 Install Android SDK
 Installing ADT plug-in for Eclipse
 Adding Platforms and Components
http://developer.android.com/sdk/installing.html
Installing Java SDK
 Website:
http://www.oracle.com/technetwork/java/javase/downloads/index.
html
 Takes about 5 minutes
 Latest version: 1.6.23
 Select the standard edition
 Select platform
 Check license agreement
 Select file in the “Available Files”
 Select “Run” to start installing
 Accept all default settings unless you want to customize.
 Don’t need immediate registration
 Java SDK will be installed on C drive by default
 For example: C:Program FilesJavajdk1.6.0_23
Java SDK Directory
Download Eclipse
 http://www.eclipse.org/downloads/
 Takes about 3 Minutes
 Select package
 Select zip file for your OS
 Click on “Download”
 On “File Download” dialog, select “Save” to save the .zip
file
 After zip file is completely downloaded, unzip it.
 Eclipse application is located under “eclipse” folder
 For example: C:UserschauDesktopeclipse-SDK-3.6.1-
win32eclipse
Eclipse Directory
Notes on Eclipse Tutorial
 Instructions written based on older version
 Missing steps
 HelloWorld tutorial: check on “Create public static
main ….”
 First time “Run as  Java application” is not available
 Other note: by default, Eclipse project is configured
to “Build Automatically” (Project->Build
Automatically)
Install Android SDK
 Website: http://developer.android.com/sdk/index.html
 Takes 10-15 minutes
 Installer will verify if Java has been installed and stop
installing if Java SDK is missing
 Accept most defaults
 Accept license agreement
 Optionally, install additional packages when Android
SDK and Android Virtual Device (AVD) Manager dialog
open.
 Select “Available Packages” and select package (s) to install
● AndroidSDKInstallation.pptx
Install ADT Plugin
For Eclipse
 Go to Android SDK Installing website for
instructions.
 2 main steps.
 Use Eclipse to download
 Download ADT Plugin.pptx
 Configure
 Configure ADT Plugin.pptx
Android Emulator
 Virtual mobile device that runs on computer.
 Can be used to prototype, develop, and test Android applications
without using a physical device.
 http://developer.android.com/guide/developing/tools/emulator.html
Create Android
Virtual Device (AVD)
 An Android Virtual Device (AVD) is a device
configuration for the emulator that allows you to model
real world devices.
 In order to run an instance of the emulator, you must
create an AVD.
 On Eclipse, select Window -> Android SDK and AVD
Manager
 Click New to create a new AVD.
 Fill in the details for the AVD. Give it a name, a platform
target, an SD card size (512), and a skin (HVGA is
default).
 Click Create AVD.
 Launch an emulator with the AVD by clicking Start
Hello Android Tutorial
Step 1
Create New Android Project
From Eclipse IDE: Select File -> New ->
Project to open “New File” dialog
 On “New File” dialog: expand “Android”
folder, then select “Android Project”, then
click on “Next” button
http://developer.android.com/guide/tutorials/hello-
world.html
Create Project
Select Android Project
Hello Android Tutorial
Step 2
Specify project properties
 Project name: HelloAndroid
Build target: 2.2
 Might need to create the target first (See Create AVD)
Application name: Hello, Android
Package name: com.example.HelloAndroid
Select “Create Activity” with “HelloAndroid” as
name
Min SDK Version: 8
Click on “Finish” button.
 http://developer.android.com/guide/tutorials/hello-world.html
Hello Android Tutorial
Step 3
Edit/Add code in the “onCreate” method
Comment out the following line
//setContentView(R.layout.main);
Add the following lines
TextView tv = new TextView(this);
tv.setText("Hello, Android!!!nWhat's up urban?");
setContentView(tv);
 Save the file , then Build the project if needed
*** Might need to import 2 new packages by clicking on the
red cross on the left hand side of that line
Newly added codeProject Files
Project Files
Hello Android Tutorial
Step 4
Run application using emulator
 Click “Run As” to open “Run As” dialog
 Might need to create an Android Virtual device.
 Select “Android Application
 Click on “OK”
 2 command prompts pop up and go away
 Emulator pop ups, then go through a few stages and displays.
 Wait for a few minutes for Activity Manager to complete launching the
activity. Console displays message below.
 “Activity Manager: Starting: Intent { act=an ….}”, click on “Menu” to see the
“Hello World Message”
 After Emulator “locked” screen appear.
 Click on “Menu” button, “Hello Android” message will display.
 Click “Home” button on emulator
 Click on “…” on screen, “Hello, Android” application icon display on screen.
 Double click on app icon to display the app message
“Run As” Dialog
Emulator Initializing
Console Messages
Emulator Startup Screen
Hello Android Running
Emulator Home
Applications Screen
Run On Device
 Must set up device, Android environment, and driver
first (see next slide)
 Connect USB cable from phone to PC
 Run
 Eclipse automatically install the application, .apk file,
and run it
Developing on a Device
 Declare your application as "debug-able" in your Android Manifest.
 Turn on "USB Debugging" on your device.
 Install USB driver
 If using Android Developer Phone (ADP): Nexus One, or Nexus S,
install Google Windows USB Driver
 Otherwise, find a link to the appropriate OEM driver in the OEM
USB Drivers document
 Install HTC Sync
 Make sure generic/incomparable driver has been removed
 Take about 5 minutes
 Choose “Complete” Set up type.
 Install HTC Sync.pptx
● Connect phone as “Disk Drive”, not “Charge Only” or “USB
Tethering”
 http://developer.android.com/guide/developing/device.html
Install APK File
via Android Market
 Copy the APK file to your Android’s memory card
and insert the card into your phone.
 Download and install the Apps Installer application
from the Android Market
 Once installed, run Apps Installer , browse to the
APK file on the memory card.
 Click and install your APK file.
Install APK File
Using Android SDK
 Android Debug Bridge is a tool that allows manage
the state of an emulator instance or Android-
powered device
 Install appropriate driver
 Connect phone to PC via USB data cable
 Run command line from SDK's platform-tools/
directory :
 adb -d install
C:UserschauworkspaceHelloFormStuffsbinHell
oFormStuffs.apk
Install APK File Result
Create Project From Existing
Source
 For example: platform ApiDemos
 Create a new project from existing source
 Browse to and select ApiDemos folder
 Select Build Target
 Click on “Finish”
Create ApiDemos Project
Android Phone Sensors
 Accelerometer
 Senses changes in orientation allowing the device to know when it
is tilted on its side
 Proximity sensor
 Deactivates the display and touch screen when the device is
brought near the face during a call
 Ambient light sensor
 Adjusts the display brightness which in turn saves battery power
 E-compass
 Provides orientation with respect to Earth's magnetic field
 Camera
 GPS
 Microphone
Sensing Related Packages
 Media
 http://developer.android.com/reference/android/med
ia/package-summary.html
 Location
 http://developer.android.com/reference/android/loca
tion/package-summary.html
 Hardware
 http://developer.android.com/reference/android/har
dware/Sensor.html
Sensor API Demo
 Package: com.example.android.apis.os;
 Displays the values of the acceleration sensor graphically.
 Get sensor manager
 mSensorManager = (SensorManager)
getSystemService(SENSOR_SERVICE);
 Register listener for 4 sensor types
 mSensorManager.registerListener(mGraphView,
SensorManager.SENSOR_ACCELEROMETER |
SensorManager.SENSOR_MAGNETIC_FIELD |
SensorManager.SENSOR_ORIENTATION,
SensorManager.SENSOR_DELAY_FASTEST);
 Override onSensorChanged(…) to display the changed value
Questions/Answers
Additional
Hardware Package Summary
Android SDK Disk Storage

Weitere ähnliche Inhalte

Was ist angesagt?

Android study jams 1
Android study jams 1Android study jams 1
Android study jams 1DSCBVRITH
 
Vit bhopal android study jams 2.0 session 1
Vit bhopal android study jams 2.0 session 1Vit bhopal android study jams 2.0 session 1
Vit bhopal android study jams 2.0 session 1ishik1
 
Android Study Jam - Info Session
Android Study Jam - Info SessionAndroid Study Jam - Info Session
Android Study Jam - Info SessionAITIKDANDAPAT
 
Android Study Jams Session 01
Android Study Jams Session 01Android Study Jams Session 01
Android Study Jams Session 01DSC BIT Mesra
 
Android Study Jam 1 Day 1 | December 2021 | GDSC BVCOENM
Android Study Jam 1 Day 1 | December 2021 | GDSC BVCOENMAndroid Study Jam 1 Day 1 | December 2021 | GDSC BVCOENM
Android Study Jam 1 Day 1 | December 2021 | GDSC BVCOENMGDSCBVCOENM
 
Android study jams 2021 [collab] [master]
Android study jams 2021 [collab] [master]Android study jams 2021 [collab] [master]
Android study jams 2021 [collab] [master]GDSCIIITBbsr
 
Info session on android study jams
Info session on android study jamsInfo session on android study jams
Info session on android study jamsArjavDesai3
 
Google I/O 2019 - what's new in Android Q and Jetpack
Google I/O 2019 - what's new in Android Q and JetpackGoogle I/O 2019 - what's new in Android Q and Jetpack
Google I/O 2019 - what's new in Android Q and JetpackSunita Singh
 
Android Workshop Part 1
Android Workshop Part 1Android Workshop Part 1
Android Workshop Part 1NAILBITER
 
ASJ Workshop - Introduction
ASJ Workshop - IntroductionASJ Workshop - Introduction
ASJ Workshop - IntroductionAmsavarthan Lv
 
Android – As a tool of innovation
Android – As a tool of innovation Android – As a tool of innovation
Android – As a tool of innovation Pallab Sarkar
 
Comparison between Eclipse and Android Studio for Android Development
Comparison between Eclipse and Android Studio for Android DevelopmentComparison between Eclipse and Android Studio for Android Development
Comparison between Eclipse and Android Studio for Android DevelopmentWillow Cheng
 
Exploring Android Studio
Exploring Android StudioExploring Android Studio
Exploring Android StudioAkshay Chordiya
 
How to configure monkey talk android agent
How to configure monkey talk android agentHow to configure monkey talk android agent
How to configure monkey talk android agentDasun Eranthika
 

Was ist angesagt? (20)

Intro session kotlin
Intro session kotlinIntro session kotlin
Intro session kotlin
 
Study Jam Session 2
Study Jam Session 2Study Jam Session 2
Study Jam Session 2
 
Android study jams 1
Android study jams 1Android study jams 1
Android study jams 1
 
Vit bhopal android study jams 2.0 session 1
Vit bhopal android study jams 2.0 session 1Vit bhopal android study jams 2.0 session 1
Vit bhopal android study jams 2.0 session 1
 
Android Study Jam - Info Session
Android Study Jam - Info SessionAndroid Study Jam - Info Session
Android Study Jam - Info Session
 
Android Study Jams Session 01
Android Study Jams Session 01Android Study Jams Session 01
Android Study Jams Session 01
 
Android Study Jam 1 Day 1 | December 2021 | GDSC BVCOENM
Android Study Jam 1 Day 1 | December 2021 | GDSC BVCOENMAndroid Study Jam 1 Day 1 | December 2021 | GDSC BVCOENM
Android Study Jam 1 Day 1 | December 2021 | GDSC BVCOENM
 
Android study jams 2021 [collab] [master]
Android study jams 2021 [collab] [master]Android study jams 2021 [collab] [master]
Android study jams 2021 [collab] [master]
 
Info session on android study jams
Info session on android study jamsInfo session on android study jams
Info session on android study jams
 
Google I/O 2019 - what's new in Android Q and Jetpack
Google I/O 2019 - what's new in Android Q and JetpackGoogle I/O 2019 - what's new in Android Q and Jetpack
Google I/O 2019 - what's new in Android Q and Jetpack
 
Android Workshop Part 1
Android Workshop Part 1Android Workshop Part 1
Android Workshop Part 1
 
ASJ Workshop - Introduction
ASJ Workshop - IntroductionASJ Workshop - Introduction
ASJ Workshop - Introduction
 
Android – As a tool of innovation
Android – As a tool of innovation Android – As a tool of innovation
Android – As a tool of innovation
 
Android Studio vs. ADT
Android Studio vs. ADTAndroid Studio vs. ADT
Android Studio vs. ADT
 
Android studio
Android studioAndroid studio
Android studio
 
Comparison between Eclipse and Android Studio for Android Development
Comparison between Eclipse and Android Studio for Android DevelopmentComparison between Eclipse and Android Studio for Android Development
Comparison between Eclipse and Android Studio for Android Development
 
Exploring Android Studio
Exploring Android StudioExploring Android Studio
Exploring Android Studio
 
Monkey Talk
Monkey TalkMonkey Talk
Monkey Talk
 
How to configure monkey talk android agent
How to configure monkey talk android agentHow to configure monkey talk android agent
How to configure monkey talk android agent
 
Webinar on Google Android SDK
Webinar on Google Android SDKWebinar on Google Android SDK
Webinar on Google Android SDK
 

Ähnlich wie Android development-tutorial

Introduction to android
Introduction to androidIntroduction to android
Introduction to androidzeelpatel0504
 
Android overview
Android overviewAndroid overview
Android overviewHas Taiar
 
architecture of android.pptx
architecture of android.pptxarchitecture of android.pptx
architecture of android.pptxallurestore
 
Intro To Android App Development
Intro To Android App DevelopmentIntro To Android App Development
Intro To Android App DevelopmentMike Kvintus
 
Android In A Nutshell
Android In A NutshellAndroid In A Nutshell
Android In A NutshellTed Chien
 
Android Overview
Android OverviewAndroid Overview
Android OverviewRaju Kadam
 
Android For Java Developers
Android For Java DevelopersAndroid For Java Developers
Android For Java DevelopersMike Wolfson
 
Google android white paper
Google android white paperGoogle android white paper
Google android white paperSravan Reddy
 
Android introduction&hello world
Android introduction&hello worldAndroid introduction&hello world
Android introduction&hello world葵慶 李
 
Ch1 hello, android
Ch1 hello, androidCh1 hello, android
Ch1 hello, androidJehad2012
 
Android 1-intro n architecture
Android 1-intro n architectureAndroid 1-intro n architecture
Android 1-intro n architectureDilip Singh
 
01 what is android
01 what is android01 what is android
01 what is androidC.o. Nieto
 

Ähnlich wie Android development-tutorial (20)

Introduction to android
Introduction to androidIntroduction to android
Introduction to android
 
Android overview
Android overviewAndroid overview
Android overview
 
architecture of android.pptx
architecture of android.pptxarchitecture of android.pptx
architecture of android.pptx
 
Android session-1-sajib
Android session-1-sajibAndroid session-1-sajib
Android session-1-sajib
 
Intro To Android App Development
Intro To Android App DevelopmentIntro To Android App Development
Intro To Android App Development
 
PPT Companion to Android
PPT Companion to AndroidPPT Companion to Android
PPT Companion to Android
 
Android In A Nutshell
Android In A NutshellAndroid In A Nutshell
Android In A Nutshell
 
Android Overview
Android OverviewAndroid Overview
Android Overview
 
IntroToAndroid
IntroToAndroidIntroToAndroid
IntroToAndroid
 
Android Anatomy
Android  AnatomyAndroid  Anatomy
Android Anatomy
 
Android For Java Developers
Android For Java DevelopersAndroid For Java Developers
Android For Java Developers
 
Aptech Apps
Aptech Apps Aptech Apps
Aptech Apps
 
Android
AndroidAndroid
Android
 
Google android white paper
Google android white paperGoogle android white paper
Google android white paper
 
Android introduction&hello world
Android introduction&hello worldAndroid introduction&hello world
Android introduction&hello world
 
Android
AndroidAndroid
Android
 
Ch1 hello, android
Ch1 hello, androidCh1 hello, android
Ch1 hello, android
 
Android dev o_auth
Android dev o_authAndroid dev o_auth
Android dev o_auth
 
Android 1-intro n architecture
Android 1-intro n architectureAndroid 1-intro n architecture
Android 1-intro n architecture
 
01 what is android
01 what is android01 what is android
01 what is android
 

Mehr von ilias ahmed

We need parallel or series connections of n mos and pmos with a nmos source t...
We need parallel or series connections of n mos and pmos with a nmos source t...We need parallel or series connections of n mos and pmos with a nmos source t...
We need parallel or series connections of n mos and pmos with a nmos source t...ilias ahmed
 
Signle assignmentforbciit
Signle assignmentforbciitSignle assignmentforbciit
Signle assignmentforbciitilias ahmed
 
Compiler design lab
Compiler design labCompiler design lab
Compiler design labilias ahmed
 
artificial intelligence
artificial intelligence artificial intelligence
artificial intelligence ilias ahmed
 
Compiler designs presentation final
Compiler designs presentation  finalCompiler designs presentation  final
Compiler designs presentation finalilias ahmed
 
Compiler designs presentation by group 2 final final
Compiler designs presentation by group 2 final finalCompiler designs presentation by group 2 final final
Compiler designs presentation by group 2 final finalilias ahmed
 
Assmemble langauge for slideshare.net
Assmemble langauge for slideshare.netAssmemble langauge for slideshare.net
Assmemble langauge for slideshare.netilias ahmed
 
Phpfundamnetalfromtutplus
PhpfundamnetalfromtutplusPhpfundamnetalfromtutplus
Phpfundamnetalfromtutplusilias ahmed
 
Assignment complier design (GROUP1)
Assignment complier design (GROUP1)Assignment complier design (GROUP1)
Assignment complier design (GROUP1)ilias ahmed
 
Lisp programming
Lisp programmingLisp programming
Lisp programmingilias ahmed
 
Lispprograaming excercise
Lispprograaming excerciseLispprograaming excercise
Lispprograaming excerciseilias ahmed
 
Assembly lab up to 6 up (1)
Assembly lab up to 6 up (1)Assembly lab up to 6 up (1)
Assembly lab up to 6 up (1)ilias ahmed
 
Data communications
Data communicationsData communications
Data communicationsilias ahmed
 
Microprocessor projec ts
Microprocessor projec tsMicroprocessor projec ts
Microprocessor projec tsilias ahmed
 
Oop features java presentationshow
Oop features java presentationshowOop features java presentationshow
Oop features java presentationshowilias ahmed
 

Mehr von ilias ahmed (20)

We need parallel or series connections of n mos and pmos with a nmos source t...
We need parallel or series connections of n mos and pmos with a nmos source t...We need parallel or series connections of n mos and pmos with a nmos source t...
We need parallel or series connections of n mos and pmos with a nmos source t...
 
Signle assignmentforbciit
Signle assignmentforbciitSignle assignmentforbciit
Signle assignmentforbciit
 
Compiler design lab
Compiler design labCompiler design lab
Compiler design lab
 
Labreportofai
LabreportofaiLabreportofai
Labreportofai
 
Ailabreport
AilabreportAilabreport
Ailabreport
 
artificial intelligence
artificial intelligence artificial intelligence
artificial intelligence
 
Compiler designs presentation final
Compiler designs presentation  finalCompiler designs presentation  final
Compiler designs presentation final
 
Compiler designs presentation by group 2 final final
Compiler designs presentation by group 2 final finalCompiler designs presentation by group 2 final final
Compiler designs presentation by group 2 final final
 
Assmemble langauge for slideshare.net
Assmemble langauge for slideshare.netAssmemble langauge for slideshare.net
Assmemble langauge for slideshare.net
 
Phpfundamnetalfromtutplus
PhpfundamnetalfromtutplusPhpfundamnetalfromtutplus
Phpfundamnetalfromtutplus
 
Assignment complier design (GROUP1)
Assignment complier design (GROUP1)Assignment complier design (GROUP1)
Assignment complier design (GROUP1)
 
Lisp programming
Lisp programmingLisp programming
Lisp programming
 
Lispprograaming excercise
Lispprograaming excerciseLispprograaming excercise
Lispprograaming excercise
 
Assembly lab up to 6 up (1)
Assembly lab up to 6 up (1)Assembly lab up to 6 up (1)
Assembly lab up to 6 up (1)
 
Event design
Event designEvent design
Event design
 
Vlan
VlanVlan
Vlan
 
Data communications
Data communicationsData communications
Data communications
 
Microprocessor projec ts
Microprocessor projec tsMicroprocessor projec ts
Microprocessor projec ts
 
Oop features java presentationshow
Oop features java presentationshowOop features java presentationshow
Oop features java presentationshow
 
Sql functions
Sql functionsSql functions
Sql functions
 

Kürzlich hochgeladen

Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...christianmathematics
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024Janet Corral
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...fonyou31
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...Sapna Thakur
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 

Kürzlich hochgeladen (20)

INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 

Android development-tutorial

  • 1. Ilias ahmed EEL 6788- Advanced Topics in Wireless Networks
  • 2. Objectives  Android application development overview  Getting started
  • 3. Outline  Background information  Creating development environment  “Hello, Android” tutorial/demo  Install/Debug application on Android phone device  “Sensors” API sample demo
  • 4. What is Android?  Android is a software stack for mobile devices that includes an operating system, middleware, and key applications.  Android Software Development Kit (SDK)  Provides the tools and APIs necessary to begin developing applications on the Android platform using the Java programming language.  Includes a debugger, libraries, a handset emulator (based on QEMU), documentation, sample code, and tutorials  Android Market is an online software store developed by Google for Android devices  An application program ("app") called "Market" is preinstalled on most Android devices and allows users to browse and download apps published by third-party developers, hosted on Android Market  As of December 2010, the Android Market had over 200,000 applications
  • 5. History  Android mobile operating system initially developed by Android Inc, based in Palo Alto, CA.  Android's co-founders  Andy Rubin (co-founder of Danger),  Rich Miner (co-founder of Wildfire Communications, Inc.)  Nick Sears (once VP at T-Mobile)  Chris White (headed design and interface development at WebTV)  Android was bought by Google in 2005.  Its co-founders went to work for Google  Google and other members of the Open Handset Alliance collaborated on Android's development and release  Android has been available under a free software / open source license since October ,2008
  • 6. Meet Android Co-Founders  Rick Miner Andy Rubin Nick Sears  Chris White picture not yet found
  • 7. Operating System Overview  Powered by the Linux kernel  Consists of 12 million lines of code including: 3 million lines of XML 2.8 million lines of C 2.1 million lines of Java 1.75 million lines of C++ http://en.wikipedia.org/wiki/Android_(operating_system)
  • 8. Current API Distribution  Version 1.0 was released on 23rd September 2008  Newest version, 3.0, was release on 26th January 2011.  Distribution as of 01/04/11
  • 9. Android Architecture  5 major components: Applications, Application Frameworks, Libraries, Android Runtime, and Linux Kernel
  • 10. Platform Architecture Videos  Presenter: Mike Cleron, Android development team member.  Video 1 of 3 (13 minute): architecture overview + replacing and reusing components example
  • 11. Application Components  An activity presents a visual user interface Present a list of menu items users can choose Display photographs along with their captions Activities work together to form a cohesive user interface, however each activity is independent of the others.  Service doesn't have a visual user interface, runs in the background for an indefinite period of time Media player’s music playback service
  • 12. Application Components (Cont.)  Broadcast receiver: is a component that receives and reacts to broadcast announcements  let other applications know that some data has been downloaded to the device and is available for use.  Content provider :  Makes a specific set of the application's data available to other applications  Enables other applications to retrieve and store data of the type it controls http://developer.android.com/guide/topics/fundamentals.html
  • 14. Android Features Part 1  Application framework enabling reuse and replacement of components  Dalvik virtual machine optimized for mobile devices  Integrated browser based on the open source WebKit engine  Optimized graphics powered by  Custom 2D graphics library;  3D graphics based on the OpenGL ES 1.0 specification (hardware acceleration optional)  SQLite for structured data storage  http://developer.android.com/guide/basics/what-is-android.html
  • 15. Android Features Part 2  Media support for common audio, video, and still image formats (MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, GIF)  GSM Telephony (hardware dependent)  Bluetooth, EDGE, 3G, and WiFi (hardware dependent)  Camera, GPS, compass, and accelerometer (hardware dependent)  Rich development environment including a device emulator, tools for debugging, memory and performance profiling, and a plug- in for the Eclipse IDE  http://developer.android.com/guide/basics/what-is-android.html
  • 16. Application Fundamentals  Written in the Java programming language.  Code along with any required data and resource files are compiled into an Android package, .apk file.  Installed on mobile devices  Runs in its own Linux process  Has its own virtual machine (VM),  Is assigned a unique Linux user ID Permissions are set so that the application's files are visible only to that user and only to the application itself  http://developer.android.com/guide/topics/fundamental s.html
  • 17. Android Central Feature  Replace and Reuse  One application can make use of elements of other applications provided those applications permit it.  One application doesn't incorporate the code of the other application or link to it. Rather, it simply starts up that piece of the other application when the need arises.  For this to work, the system must be able to start an application process when any part of it is needed, and instantiate the Java objects for that part.  Unlike applications on most other systems, Android applications don't have a single entry point for everything in the application (no main() function, for example).  Rather, they have essential components that the system can instantiate and run as needed. http://developer.android.com/guide/topics/fundamentals.html
  • 18. Intents  Is the 5th key class  Objects that hold the content of the message  Activities, services, and broadcast receivers — are activated by intents  For activities and services, it names the action being requested and specifies the URI of the data to act on, among other things  Request for an activity to present an image to the user or let the user edit some text  For broadcast receivers, it names the action being announced  Announce to interested parties that the camera button has been pressed http://developer.android.com/guide/topics/fundamentals.html
  • 19. Manifest file  Before Android can start an application component, it must learn that the component exists.  Applications must declare their components in a manifest file  Is a structured XML file, named AndroidManifest.xml for all applications.  Declares the application's components  Names any libraries the application needs to be linked against (besides the default Android library)  Identifies any permissions the application expects to be granted http://developer.android.com/guide/topics/fundamentals.html
  • 20. Manifest File Example  <?xml version="1.0" encoding="utf-8"?>  <manifest xmlns:android="http://schemas.android.com/apk/res/android"  package="com.example.helloandroidtoo"  android:versionCode="1"  android:versionName="1.0">  <application android:icon="@drawable/icon" android:label="@string/app_name" android:debuggable="true">  <activity android:name=".HelloAndroid"  android:label="@string/app_name">  <intent-filter>  <action android:name="android.intent.action.MAIN" />  <category android:name="android.intent.category.LAUNCHER" />  </intent-filter>  </activity>  android:debuggable="true"  </application>  <uses-sdk android:minSdkVersion="8" />  </manifest> http://developer.android.com/guide/topics/fundamentals.html
  • 21. Supported Operating Systems 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
  • 22. Supported Development Environments  Recommended: Eclipse  Eclipse IDE 3.4 (Ganymede) or greater  Eclipse IDE for Java Developers  Eclipse Classic (versions 3.5.1 and higher)  Eclipse IDE for Java EE Developers  Eclipse JDT plug-in (included in most Eclipse IDE packages)  JDK 5 or JDK 6 (JRE alone is not sufficient)  Android Development Tools plug-in (recommended)  Other development environments or IDEs  JDK 5 or JDK 6 (JRE alone is not sufficient)  Apache Ant 1.8 or later  Not compatible with Gnu Compiler for Java (gcj)
  • 23. Set up Development Environment  Review system requirements  Installing Java SDK  Download Eclipse IDE  Install Android SDK  Installing ADT plug-in for Eclipse  Adding Platforms and Components http://developer.android.com/sdk/installing.html
  • 24. Installing Java SDK  Website: http://www.oracle.com/technetwork/java/javase/downloads/index. html  Takes about 5 minutes  Latest version: 1.6.23  Select the standard edition  Select platform  Check license agreement  Select file in the “Available Files”  Select “Run” to start installing  Accept all default settings unless you want to customize.  Don’t need immediate registration  Java SDK will be installed on C drive by default  For example: C:Program FilesJavajdk1.6.0_23
  • 26. Download Eclipse  http://www.eclipse.org/downloads/  Takes about 3 Minutes  Select package  Select zip file for your OS  Click on “Download”  On “File Download” dialog, select “Save” to save the .zip file  After zip file is completely downloaded, unzip it.  Eclipse application is located under “eclipse” folder  For example: C:UserschauDesktopeclipse-SDK-3.6.1- win32eclipse
  • 28. Notes on Eclipse Tutorial  Instructions written based on older version  Missing steps  HelloWorld tutorial: check on “Create public static main ….”  First time “Run as  Java application” is not available  Other note: by default, Eclipse project is configured to “Build Automatically” (Project->Build Automatically)
  • 29. Install Android SDK  Website: http://developer.android.com/sdk/index.html  Takes 10-15 minutes  Installer will verify if Java has been installed and stop installing if Java SDK is missing  Accept most defaults  Accept license agreement  Optionally, install additional packages when Android SDK and Android Virtual Device (AVD) Manager dialog open.  Select “Available Packages” and select package (s) to install ● AndroidSDKInstallation.pptx
  • 30. Install ADT Plugin For Eclipse  Go to Android SDK Installing website for instructions.  2 main steps.  Use Eclipse to download  Download ADT Plugin.pptx  Configure  Configure ADT Plugin.pptx
  • 31. Android Emulator  Virtual mobile device that runs on computer.  Can be used to prototype, develop, and test Android applications without using a physical device.  http://developer.android.com/guide/developing/tools/emulator.html
  • 32. Create Android Virtual Device (AVD)  An Android Virtual Device (AVD) is a device configuration for the emulator that allows you to model real world devices.  In order to run an instance of the emulator, you must create an AVD.  On Eclipse, select Window -> Android SDK and AVD Manager  Click New to create a new AVD.  Fill in the details for the AVD. Give it a name, a platform target, an SD card size (512), and a skin (HVGA is default).  Click Create AVD.  Launch an emulator with the AVD by clicking Start
  • 33. Hello Android Tutorial Step 1 Create New Android Project From Eclipse IDE: Select File -> New -> Project to open “New File” dialog  On “New File” dialog: expand “Android” folder, then select “Android Project”, then click on “Next” button http://developer.android.com/guide/tutorials/hello- world.html
  • 36. Hello Android Tutorial Step 2 Specify project properties  Project name: HelloAndroid Build target: 2.2  Might need to create the target first (See Create AVD) Application name: Hello, Android Package name: com.example.HelloAndroid Select “Create Activity” with “HelloAndroid” as name Min SDK Version: 8 Click on “Finish” button.  http://developer.android.com/guide/tutorials/hello-world.html
  • 37.
  • 38. Hello Android Tutorial Step 3 Edit/Add code in the “onCreate” method Comment out the following line //setContentView(R.layout.main); Add the following lines TextView tv = new TextView(this); tv.setText("Hello, Android!!!nWhat's up urban?"); setContentView(tv);  Save the file , then Build the project if needed *** Might need to import 2 new packages by clicking on the red cross on the left hand side of that line
  • 39. Newly added codeProject Files Project Files
  • 40. Hello Android Tutorial Step 4 Run application using emulator  Click “Run As” to open “Run As” dialog  Might need to create an Android Virtual device.  Select “Android Application  Click on “OK”  2 command prompts pop up and go away  Emulator pop ups, then go through a few stages and displays.  Wait for a few minutes for Activity Manager to complete launching the activity. Console displays message below.  “Activity Manager: Starting: Intent { act=an ….}”, click on “Menu” to see the “Hello World Message”  After Emulator “locked” screen appear.  Click on “Menu” button, “Hello Android” message will display.  Click “Home” button on emulator  Click on “…” on screen, “Hello, Android” application icon display on screen.  Double click on app icon to display the app message
  • 48. Run On Device  Must set up device, Android environment, and driver first (see next slide)  Connect USB cable from phone to PC  Run  Eclipse automatically install the application, .apk file, and run it
  • 49. Developing on a Device  Declare your application as "debug-able" in your Android Manifest.  Turn on "USB Debugging" on your device.  Install USB driver  If using Android Developer Phone (ADP): Nexus One, or Nexus S, install Google Windows USB Driver  Otherwise, find a link to the appropriate OEM driver in the OEM USB Drivers document  Install HTC Sync  Make sure generic/incomparable driver has been removed  Take about 5 minutes  Choose “Complete” Set up type.  Install HTC Sync.pptx ● Connect phone as “Disk Drive”, not “Charge Only” or “USB Tethering”  http://developer.android.com/guide/developing/device.html
  • 50. Install APK File via Android Market  Copy the APK file to your Android’s memory card and insert the card into your phone.  Download and install the Apps Installer application from the Android Market  Once installed, run Apps Installer , browse to the APK file on the memory card.  Click and install your APK file.
  • 51. Install APK File Using Android SDK  Android Debug Bridge is a tool that allows manage the state of an emulator instance or Android- powered device  Install appropriate driver  Connect phone to PC via USB data cable  Run command line from SDK's platform-tools/ directory :  adb -d install C:UserschauworkspaceHelloFormStuffsbinHell oFormStuffs.apk
  • 53. Create Project From Existing Source  For example: platform ApiDemos  Create a new project from existing source  Browse to and select ApiDemos folder  Select Build Target  Click on “Finish”
  • 55. Android Phone Sensors  Accelerometer  Senses changes in orientation allowing the device to know when it is tilted on its side  Proximity sensor  Deactivates the display and touch screen when the device is brought near the face during a call  Ambient light sensor  Adjusts the display brightness which in turn saves battery power  E-compass  Provides orientation with respect to Earth's magnetic field  Camera  GPS  Microphone
  • 56. Sensing Related Packages  Media  http://developer.android.com/reference/android/med ia/package-summary.html  Location  http://developer.android.com/reference/android/loca tion/package-summary.html  Hardware  http://developer.android.com/reference/android/har dware/Sensor.html
  • 57. Sensor API Demo  Package: com.example.android.apis.os;  Displays the values of the acceleration sensor graphically.  Get sensor manager  mSensorManager = (SensorManager) getSystemService(SENSOR_SERVICE);  Register listener for 4 sensor types  mSensorManager.registerListener(mGraphView, SensorManager.SENSOR_ACCELEROMETER | SensorManager.SENSOR_MAGNETIC_FIELD | SensorManager.SENSOR_ORIENTATION, SensorManager.SENSOR_DELAY_FASTEST);  Override onSensorChanged(…) to display the changed value
  • 61. Android SDK Disk Storage

Hinweis der Redaktion

  1. Most code: XML, least code: C++
  2. Video 2 of 3 (8 minutes): application life cycle + example Video 3 of 3 (7 minutes): major API including Location Manager, Notification Manager, and Views. Good info
  3. While connected, you can communicate with the service through an interface that the service exposes. For the music service, this interface might allow users to pause, rewind, stop, and restart the playback.
  4. A text messaging application might have: 1. one activity that shows a list of contacts to send messages to, 2. second activity to write the message to the chosen contact, 3. other activities to review old messages or change settings.
  5. Android starts the process when any of the application's code needs to be executed, and shuts down the process when it's no longer needed and system resources are required by other applications. Application code runs in isolation from the code of all other applications.
  6. Note: Be sure to define a target for your AVD that satisfies your application's build target (the AVD platform target must have an API Level equal to or greater than the API Level that your application compiles against).
  7. Error: device not found, already installed, etc.