Android Application Development TutorialTopicsIntroduction to AndroidBackgroundUpdate HistoryPlatform VersionsAndroid and the HardwareAndroid FeaturesAndroid ArchitectureApplication FundamentalsApplication ComponentsInstallationOverview of SensorsOpen Source PlatformHardware-oriented FeaturesSensor and SensorManagerProgramming TutorialPreparing for the TutorialGet a Google Maps API KeyCreate an Android Virtual Device (AVD)Create the Android ProjectThe New Android ProjectModify the AndroidManifest.xml FileAdd LocationManager to get UpdatesAdd MyLocationListenerTest the GPSSimulatorAdd ability to use Google MapsAdd MapView to main.xmlModify GPSSimulator to use Google MapsView the Location on the MapInternet LayersClient-Server CommunicationProgramming Tutorial 2Required PackagesLayoutLink Activity and ViewAdding Event to View ObjectStrings.xmlAndroidManifest.xmlNetwork SettingsBehind Proxy ServerSlide 42Slide 43Slide 44Slide 45Slide 46App to Download jpg fileSlide 48Slide 49Slide 50Slide 51Slide 52Slide 53Programming Tutorial 3Intent and IntentFilterSMS SendingSlide 57Slide 58Slide 59Slide 60Receiving SMSSlide 62Slide 63Slide 64Slide 65ConclusionsResourcesAndroid Application Android Application Development TutorialDevelopment TutorialAccessing Sensors and the NetworkDeepa Shinde and Cindy AthertonTopicsTopicsBackgroundIntroduction to AndroidOverview of SensorsProgramming Tutorial 1: Tracking location with GPS and Google MapsOverview of NetworkingProgramming Tutorial 2: Downloading from the InternetProgramming Tutorial 3: Sending/Receiving SMS MessagesQuestions/CommentsResourcesIntroduction to AndroidA brief guide to the Android Application Development EnvironmentBackgroundBackgroundSoftware platform from Google and the Open Handset AllianceJuly 2005, Google acquired Android, Inc.November 2007, Open Handset Alliance formed to develop open standards for mobile devicesOctober 2008, Android available as open sourceDecember 2008, 14 new members joined Android projectUpdate HistoryUpdate HistoryApril 30, 2009: Official 1.5 Cupcake releaseSeptember 15, 2009: 1.6 SDK Donut releaseOctober 26, 2009: 2.0 SDK Éclair release◦Updates to the Éclair release:2.0.1 on December 3, 20092.1 on January 12, 2010Platform VersionsPlatform VersionsAndroid and the HardwareAndroid and the HardwareBuilt-in Apps ≡ Apps created in SDKLeverage Linux kernel to interface with hardwareOpen source platform promotes development from global communityAndroid FeaturesAndroid FeaturesReuse and replacement of componentsDalvik virtual machineIntegrated browserOptimized graphicsSQLiteMedia supportGSM TelephonyBluetooth, EDGE, 3G, and WiFiCamera, GPS, compass, and accelerometerRich development environmentAndroid ArchitectureAndroid ArchitectureApplication FundamentalsApplication FundamentalsApps are written in JavaBundled by Android Asset Packaging ToolEvery App runs its own Linux processEach process has it’s own Java Virtual MachineEach App is assigned a unique Linux user IDApps can share the same user ID to see each other’s filesApplication ComponentsApplication ComponentsActivity◦Present a visual user interface for one focused endeavor the user can undertake◦Example: a list of menu items users can choose fromServices◦Run in the background for an indefinite period of time◦Example: calculate and provide the result to activities that need itBroadcast Receivers◦Receive and react to broadcast announcements◦Example: announcements that the time zone has changedContent Providers◦Store and retrieve data and make it accessible to all applications ◦Example: Android ships with a number of content providers for common data types (e.g., audio, video, images, personal contact information, etc.)Intents◦Hold the content of a message◦Example: convey a request for an activity to present an image to the user or let the user edit some textInstallationInstallationhttp://developer.android.com/sdk/installing.htmlPreparing your system and system requirementsDownloading and Installing the SDKInstalling ADT plug-in for EclipseAdding Platforms and ComponentsExploring the SDKCompleting tutorialsTroubleshootingOverview of SensorsThe Android Sensor Platform and how to use itOpen Source PlatformOpen Source PlatformDeveloper’s are able to access “goodies”Hardware capabilities made availableHardware-oriented FeaturesHardware-oriented FeaturesFeature DescriptionCameraA class that enables your application to interact with the camera to snap a photo, acquire images for a preview screen, and modify parameters used to govern how the camera operates.Sensor Class representing a sensor. Use getSensorList(int) to get the list of available Sensors. SensorManager A class that permits access to the sensors available within the Android platform. SensorEventListenerAn interface used for receiving notifications from the SensorManager when sensor values have changed. An application implements this interface to monitor one or more sensors available in the hardware. SensorEventThis class represents a sensor event and holds information such as the sensor type (e.g., accelerometer, orientation, etc.), the time-stamp, accuracy and of course the sensor's data. MediaRecorderA class, used to record media samples, that can be useful for recording audio activity within a specific location (such as a baby nursery). Audio clippings can also be analyzed for identification purposes in an access-control or security application. For example, it could be helpful to open the door to your time-share with your voice, rather than having to meet with the realtor to get a key.GeomagneticFieldThis class is used to estimated estimate magnetic field at a given point on Earth, and in particular, to compute the magnetic declination from true north. FaceDetectorA class that permits basic recognition of a person's face as contained in a bitmap. Using this as a device lock means no more passwords to remember — biometrics capability on a cell phone.Sensor and SensorManagerSensor and SensorManagerSensor type (Sensor class)◦Orientation, accelerometer, light, magnetic field, proximity, temperature, etc. Sampling rate ◦Fastest, game, normal, user interface. ◦When an application requests a specific sampling rate, it is really only a hint, or suggestion, to the sensor subsystem. There is no guarantee
View Full Document