CS378 - Mobile Computing Maps. Using Google Maps Content on using Google Maps inside your app Alternatives: Open Street Maps –

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.
CE881: Mobile and Social Application Programming Simon M. Lucas Menus and Dialogs.
Location based services
GPS and MapView. First In the emulator, set the time zone to something (e.g., east coast) and check that the time is correct. Otherwise, the gps emulator.
CS378 - Mobile Computing Maps. Using Google Maps Like other web services requires an API key from Google ons/google-apis/mapkey.html.
Chapter 11: Discover! Incorporating Google Maps
Location-Based Services: Part 2 (Google Maps)
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.
Filip Debelić What is it? Android is a mobile operating system (OS) based on the Linux kernel and currently developed by Google Android,
Google Android as a mobile development platform T Internet Technologies for Mobile Computing Olli Mäkinen.
Location and Maps Content Getting Location Getting Google Map In application Test on Emulator/Device.
ANDROID PROGRAMMING MODULE 1 – GETTING STARTED
Android Tutorial Larry Walters OOSE Fall References This tutorial is a brief overview of some major concepts…Android is much richer and more complex.
INTERNATIONAL SUMMER ACADEMIC COURSE UNIVESITY OF NIS ISAC – Android programming.
Finding Nearby Wireless Hotspots CSE 403 LCA Presentation Team Members: Chris Scoville Tessa MacDuff Matt Mohebbi Aiman Erbad Khalil El Haitami.
Map Applications.
Route Tracker App Android How to Program © by Pearson Education, Inc. All Rights Reserved.
Introduction to Android Programming Content Basic environmental structure Building a simple app Debugging.
Programming with Android: The Google Maps Library Slides taken from Luca Bedogni Marco Di Felice.
Android Boot Camp for Developers Using Java, Comprehensive: A Guide to Creating Your First Android Apps Chapter 9: Customize! Navigating with a Master/Detail.
Google Maps Android API v2 吳俊興 國立高雄大學 資訊工程學系 CSF645 – Mobile Computing 行動計算
CS378 - Mobile Computing Web - WebView and Web Services.
Chapter 5: Investigate! Lists, Arrays, and Web Browsers.
Location Services: Part 1 (Location and Geocoding)
Location based services Using Google Maps v2 etc. in Android apps 1Location based services.
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 (
Chapter 2: Simplify! The Android User Interface
PARSING FACEBOOK DATA FOR ANDROID 1. Step by Step  Import Android SDK  Get the hash key  Create a new app  Create a new project in Eclipse 
Copyright© Jeffrey Jongko, Ateneo de Manila University Android.
Android Boot Camp for Developers Using Java, Comprehensive: A Guide to Creating Your First Android Apps Chapter 5: Investigate! Android Lists, Arrays,
CS378 - Mobile Computing Intents.
16 Services and Broadcast Receivers CSNB544 Mobile Application Development Thanks to Utexas Austin.
Chapter 2 The Android User Interface. Objectives  In this chapter, you learn to:  Develop a user interface using the TextView, ImageView, and Button.
Engage! Android User Input, Variables,
Overview of Android Application Development
CS378 - Mobile Computing Intents. Allow us to use applications and components that are part of Android System – start activities – start services – deliver.
Android Boot Camp for Developers Using Java, 3E
© 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. Android Boot Camp.
Creating an Example Android App in Android Studio Activity lifecycle & UI Resources.
MAKANI ANDROID APPLICATION Prepared by: Asma’ Hamayel Alaa Shaheen.
Maps Dr. David Janzen Except as otherwise noted, the content of this presentation is licensed under the Creative Commons Attribution 2.5 License.
Adding Overlay Items.  So, now you have a map, but in many cases you'll also want to create your own map markers and lay-overs.  You must implement.
Adding Location Nasrullah. Adding Location Adding a Map Activity Obtaining a Map API Debug Key Adding a Map View Finding an Address with Google’s GeoCoder.
© 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. Android Boot Camp.
TCS Internal Maps. 2 TCS Internal Objective Objective :  MAPS o Integration of Maps.
© 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. Android Boot Camp.
Cosc 5/4735 YouTube API. YouTube The YouTube Android Player API enables you to incorporate video playback functionality into your Android applications.
Cosc 4735 LocationAware API. Previous on … Before we looked at GPS location. – d-gpslocation.pptx
GPS and MapView. First In the emulator, set the time zone to something (e.g., east coast) and check that the time is correct. Otherwise, the gps emulator.
Lecture 5: Location Topics: Google Play Services, Location API Date: Feb 16, 2016.
CS371m - Mobile Computing Maps. Using Google Maps Content on using Google Maps inside your app Alternatives Exist: – Open Street Maps –
3 rd -party APIs Kalin Kadiev Astea Solutions AD.
CS499 – Mobile Application Development Fall 2013 Location & Maps.
Android Application Maps 1.
Location-Based Services: Part 2 (Google Maps)
AnDroid GoogleMaps API
Android Studio, Android System Basics and Git
Android.
Tracking and Booking Taxi
Activities and Intents
Sensors, maps and fragments:
Android SDK & App Development
CS371m - Mobile Computing Maps.
Mobile Programming Dr. Mohsin Ali Memon.
Presentation transcript:

CS378 - Mobile Computing Maps

Using Google Maps Content on using Google Maps inside your app Alternatives: Open Street Maps – If you simply want to display a "standard Google map" from your app – easy 2

Displaying Standard Google Map String uri = String.format( Locale.ENGLISH, "geo:%f,%f", latitude, longitude); Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(uri)); context.startActivity(intent); 3

Setting Zoom Level and Label Specify Zoom Level for standard Map Zoom Levels in Google Maps, – 0 is the whole earth – 21 individual buildings 4

Using Google Maps Requires an API key from Google ons/google-apis/mapkey.html ons/google-apis/mapkey.html required to use MapView class Must: – Register the MD5 fingerprint of the certificate used to sign the application. – Adding a reference to the Maps API Key in each MapView (xml or code) 5

INCORPORATING MAPS IN YOU APP 6

Signing Apps deploying apps on the market requires signing the app with a certificate development and debugging uses an automatic key creation process – invisible to us In release mode you must create your own private key to sign apps – use of keytool program from Java SDK ng/app-signing.html ng/app-signing.html 7

Debugging Maps Applications Possible to use the debug key to get a certificate for Google Maps steps: – locate debug keystore – use keytool to get the MD5 fingerprint of the debug certificate to request map certificate MD5 – Message - Digest Algorithm – cryptographic hash function 8

Debug Key Portion of debug.keystore 9

Getting MD5 Fingerprint use keytool program keytool part of Java SDK keytool -list -alias androiddebugkey -keystore.keystore -storepass android -keypass android gives MD5 fingerprint of the debug certificate keytool of Java 1.7 gives SHA1 by default – use -v after keytool, before -list 10

Google Maps Terms of Service Some Highlights – may include ads in future – Google may limit number of transactions – Cannot use for turn-by-turn directions or autonomous driving 11

Debug API Key 12

Hello MapView Build Target - Google, not Android MapView not a standard Android class – part of Google Maps Library – add to manifest must also include INTERNET permission and LOCATION permission 13

Aside Permissions android/Manifest.permission.html android/Manifest.permission.html 14

MapView A type of view for layout file 15

MapActivity Create class that extends MapActivity instead of Activity import com.google.android.maps.MapActivity; must implement isRouteDisplayed method must return true if any kind of route (to be followed) is displayed, per terms of use 16

Instance Vars and onCreate Add instance variables and initialize in onCreate method 17

HelloMapView Run app Displays map and allows panning and zooming 18

Customizing Map Easy to display map and allow interaction Customize with markers and overlays Overlays – used to display information on top of map – simple choice: ItemizedOverlay class 19

ItemizedOverlay 20

ItemizedOverlay populate method will call createItem define createItem and return value from the ArrayList instance var define size method that returns number of overlay items 21

Adding Overlays In MapActivity create OverlayItem add to HelloItemizedOverlay add to MapView Need a drawable for the marker – res/drawable – issues display gif format images on some devices 22

Changes to HelloMapView 23

Add Overlay Items Create GeoPoint and use these to create OverlayItems GeoPoint based on microdegrees – lat and long times 1,000,000 Build OverlayItems out of GeoPoints and include strings for title and snippet text to display when drawable clicked 24

addOverlays method in HelloMapView 25

Result one overlay with multiple items based on locations we added 26

Display Information To display information (title and snippet) of overlay override the onTap method in the ItemizedOverlay class 27

Results of Clicking Longhorn 28

Reverse Geocoding 29 Find addresses from longitude/latitude Geocoder uses a backend that is NOT included in the core android framework use isPresent method to check for service location = locationManager.getLastKnownLocation( LocationManager.GPS_PROVIDER); double lat = location.getLatitude(); double lng = location.getLongitude(); Geocoder gc = new Geocoder(this, Locale.getDefault()); List addresses = null; try { addresses = gc.getFromLocation(lat, lng, 5); // maxResults } catch (IOException e) {}

30 Forward Geocoding Find longitude/latitude (and more) from address or airport code Geocoder gc = new Geocoder(this, Locale.US); List addresses = null; try { addresses = gc.getFromLocationName( “713 N. Duchese, St., Missouri”, 5); } catch (IOException e) {} double lat = addresses.get(0).getLatitude(); double lng = addresses.get(0). getLongitude (); String zip = addresses.get(0).getPostalCode();

Recent Changes Google Maps API version 2 – somewhat new, Released December 2012 as part of Google Play Services SDK features: – indoor maps – simplified location services 31

Maps Example Route Tracker using Locations, MapActivity, MapView, and Google Maps – from Deitel AFP-AADA Similar to Map My Ride – popular app among cyclists and runners 32

RouteTracker App 33

RouteTracker App using FrameLayout to stack components with the most recently added component on top ToggleButton at bottom to start and stop route tracking MapView added to FrameLayout route is an overlay to map with points and lines connecting points 34

RouteTracker Classes 35 RouteTracker Starting Activity deals with LocationProvider RouteOverlay Overlay with location points (every 10 th ) and lines connecting. Converts locations to GeoPoints. Overloads draw BearingFrameLayout Displays MapView rotates based on bearing from location

Criteria Class Set criteria for selecting a LocationProvider 36

GpsStatus.Listener Responds to changes in GPS status Are we receiving GPS fixes? App does not track unless this is true 37

Simulating GPS Data to simulate changes in location in emulator GPS data in a file – GPS Exchange Format (GPX) 38

Creating GPX Files Many apps and programs One option for Android devices GPSLogger gpsbabel to convert between various GPS formats – gpx has different versions 39

Running GPX files in App DDMS Emulator Control Tab GPX Tab Load 40

Running GPX 41