Tracking device movements

Slides:



Advertisements
Similar presentations
Android Application Development Tutorial. Topics Lecture 4 Overview Overview of Sensors Programming Tutorial 1: Tracking location with GPS and Google.
Advertisements

Google APIs & Location Based Applications -Krishna Achanta
Bruce Scharlau, University of Aberdeen, 2010 Android and Location Mobile Computing Unless otherwise stated, images are from android sdk.
VIP Smartphone Team – Ahmad, Din, Vinayak Car Locator App Fall 2010 VIP Smartphone Team Ahmad, Din, Vinayak.
Prepared by: Prepared by: Jameela Rabaya Jameela Rabaya Fatima Darawsha Fatima Darawsha.
Google Android Map API Presentation 13/03/2008. Map API – Overview (1) Map rendering facility on Android device Similar to Google Earth Integrate map.
Location & Maps.  Mobile applications can benefit from being location-aware, e.g.,  Routing from a current to a desired location  Searching for stores.
Multi-criteria infrastructure for location-based applications Shortly known as: Localization Platform Ronen Abraham Ido Cohen Yuval Efrati Tomer Sole'
Android Application Development. Agenda  Android Business Model  Why Android  Android application market space  Market Segments & Target customers.
Presented by Tao HUANG Lingzhi XU. Context Mobile devices need exploit variety of connectivity options as they travel. Operating systems manage wireless.
CS378 - Mobile Computing Location (Location, Location, Location)
CS378 - Mobile Computing Location.
Android Security Enforcement and Refinement. Android Applications --- Example Example of location-sensitive social networking application for mobile phones.
Emerging Platform#4: Android Bina Ramamurthy.  Android is an Operating system.  Android is an emerging platform for mobile devices.  Initially developed.
Route Tracker App Android How to Program © by Pearson Education, Inc. All Rights Reserved.
Google Maps Android API v2 吳俊興 國立高雄大學 資訊工程學系 CSF645 – Mobile Computing 行動計算
Developing Push Notifications (C2DM) for Android Vijai Co-Founder Adhish Technologies, Sweet’N’Spicy apps.
Android, where is my car? Summary. This is the just the summary of topic after it was taught in the lecture class. The LocationSensor component can report.
Social network Twitter Hashtag: #m2eu #android Personal Israel Ferrer –
Location based services
CSS216 MOBILE PROGRAMMING Android, Chapter 8 Book: “Professional Android™ 2 Application Development” by Reto Meier, 2010 by: Andrey Bogdanchikov (
Take a leap towards the most promising technology
Google Cloud Messaging for Android (GCM) is a free service that helps developers send data from servers to their Android.
Broadcast Receiver Android Club Agenda Broadcast Receiver Widget.
Rajab Davudov. Agenda Eclipse, ADT and Android SDK APK file Fundamentals – Activity – Service – Content Provider – Broadcast Receiver – Intent Hello World.
Using Intents to Broadcast Events Intents Can be used to broadcast messages anonymously Between components via the sendBroadcast method As a result Broadcast.
Android ICC Part II Inter-component communication.
Mobile Application Development using Android Lecture 2.
Android - Project Green basket Android Application * Let's you do your grocery shopping location based. * Let's you decide to go to the closest grocery.
1 Tradedoubler & Mobile Mobile web & app tracking technical overview.
Cosc 5/4730 Android App Widgets. App Widgets App Widgets are miniature application views that can be embedded in other applications (such as the Home.
Location. GPS Global Positioning System – At least 4 satellites typically used 3 required extra for error detection and altitude typically accurate within.
LocationListener in Android Nasrullah. The LocationManager provides access to the system location services The LocationListener is used for receiving.
FCM Workflow using GCM.
Android - Location Based Services. Google Play services facilitates adding location awareness to your app with automated location tracking Geo fencing.
Android Fundamentals. What is Android Software stack for mobile devices Software stack for mobile devices SDK provides tools and APIs to develop apps.
3 rd -party APIs Kalin Kadiev Astea Solutions AD.
1. 2 Android location services Determining a device’s current location Tracking device movements Proximity alerts.
CS499 – Mobile Application Development Fall 2013 Location & Maps.
Reactive Android Development
Android Application Maps 1.
Mobile Applications (Android Programming)
Lesson # 9 HP UCMDB 8.0 Essentials
Security service management of tomorrow
Understanding Android Security
Broadcast receivers.
AnDroid GoogleMaps API
Android Studio, Android System Basics and Git
Tracking and Booking Taxi
MAD.
Notifications and Services
Activities and Intents
Android Mobile Application Development
Sensors, maps and fragments:
Broadcast Receivers A Android Component where you can register for system or application events, receive and react to broadcast intent. Each broadcast.
CS371m - Mobile Computing Maps.
Android Programming Lecture 9
Iteration 1 Presentation
Android Notifications (Part 2) Plus Alarms and BroadcastReceivers
Using K2 applications How can users interact with K2 applications?
AquaScale Data Collection Android Application
Zicheng Wan and Yuan Gao CPSC 6820, Clemson University
Stephen Platt, Soham Parekh, Matt DeAngelis
HNDIT2417 Mobile Application Development
Understanding Android Security
Emerging Platform#3 Android & Programming an App
Mobile Programming Dr. Mohsin Ali Memon.
CS378 - Mobile Computing Location and Maps.
Android Development Tools
Views Base Relation View
Presentation transcript:

Tracking device movements

In this chapter Android location service to continuously track device location Google Maps library to plot location data on a map Broadcast receivers to track location in the background Considering effects on battery life

The example app will shows: how to receive the device’s current location, persist that location in a database, and plot the path traveled places on a map using the Google Maps external library for Android.

Additional functionality comes with additional complexities keeping more device hardware adverse affect battery life incorrect location data

Three Android application components: An activity to display both the current location and previous locations A broadcast receiver with location data in the background and stores the new locations in a database Another broadcast receiver that receives location updates only when the app is in the foreground in order to update the display

The app should continue to collect and save location data even when not in the foreground. background tasks are services and broadcast receivers that can do this The app uses a broadcast receiver A receiver is passed intents based on a filter, and those intents contain data for the broadcast receiver to read and process.

Create a class that extends BroadcastReceiver. Register the child class as a BroadcastReceiver with Android. Register an intent to be broadcast when Android receives new location information with the LocationManager.

To have a broadcast receiver receive intents that were broadcast, it needs to be registered with Android. Two ways to perform the registration: in the manifest for your app or by calling registerReceiver() on a Context.

Once the broadcast receiver has been implemented and registered with Android, the app needs to request that an intent is broadcast when location data updates are available. Before this request is made, a PendingIntent needs to be created.

Once the pending intent is created, location updates are requested by calling LocationManager. requestLocationUpdates() to register a LocationListener.

Both TrackLocationBroadcastReceiver and UpdateViewBroadcastReceiver instead extend LocationBroadcastReceiver.

Services are components for performing tasks in the background in Android.

One reason to choose a broadcast receiver over a service for certain background tasks is that they can be a lighter weight application component for passively collecting location data compared to a service. In order to present the location data to the user, the TrackLocationActivity will display a Google map with the tracked points plotted on it.

TrackLocationActivity uses the following classes from the Google Maps external library: MapView OverlayItem ItemizedOverlay MapActivity

The MapView is the view that displays the map in TrackLocationActivity. OverlayItem is an object that is drawn on the map. The overlay item is a container for the location data — latitude, longitude, and accuracy — that needs to be represented on the map.

ItemizedOverlay holds the list of overlay items that need to be drawn on the overlay, and defines how to draw the items. The draw() method defines how each overlay item will be drawn. MapActivity adds two methods that deserve some special attention: isRouteDisplayed() and isLocationDisplayed(). used by the Google Maps library for accounting purposes and need to reflect if the activity is currently displaying route and location information, respectively

Location data filtering is used when multiple location providers may be providing location data simultaneously. The example app provides the filtering algorithms in the FilteringLocationBroadcastReceiver class.

To reduce battery consumption reduce the frequency at which location updates need to be acquired from the location services. By configuring the parameters passed to LocationManager.requestLocationUpdates(). locationManager.requestLocationUpdates(provider, 0, 0, pendingIntent);. The second and third parameters define minimum time and minimum distance at which location updates should be received.

Another way to improve battery life is to limit the location providers that are used to acquire location updates. Although the user may have every location provider enabled, an app does not need to request updates from all of them.