SlideShare a Scribd company logo
Android Programming




         Lesson 8
 Maps, Geocoding and
Location-Based Services
       NGUYEN The Linh
Android Programming


Contents


      1    Location-Based Services

      2    Gecoding

      3    Maps


      4    Exercise 8




                         2
Android Programming


Maps, Geocoding and LBS




         Location-Based Services




                   3
Android Programming


Using Location-Based Services

 Location-based services (LBS) is an umbrella term
  used to describe the different technologies used to
  find the device’s current location. The two main LBS
  elements are:
    LocationManager: Provides hooks to the location-based services.
    LocationProviders: Each of which represents a different location
     finding technology used to determine the device’s current location.




                                  4
Android Programming


Setting up the Emulator with Test Providers

 Location-based services are dependant on device
  hardware for finding the current location. When
  developing and testing with the emulator, your
  hardware is virtualized, and you’re likely to stay in
  pretty much the same location.

 Use the Location Controls available from the DDMS
  perspective in Eclipse to push location changes
  directly into the test GPS_PROVIDER.



                            5
Android Programming


Setting up the Emulator with Test Providers




                     6
Android Programming


Selecting a Location Provider

 Depending on the device, there may be several
  technologies that Android can use to determine the
  current location. Each technology, or Location
  Provider, will offer different capabilities including
  power consumption, monetary cost, accuracy, and the
  ability to determine altitude, speed, or heading
  information.




                          7
Android Programming


Finding the Available Providers

 The LocationManager class includes static string
  constants that return the provider name for the two
  most common Location Providers:
    LocationManager.GPS_PROVIDER
    LocationManager.NETWORK_PROVIDER
 To get a list of names for all the providers available on
  the device, call getProviders, using a Boolean to
  indicate if you want all, or only the enabled, providers
  to be returned:



                            8
Android Programming


Finding Providers Based on Criteria

 In most scenarios, it’s unlikely that you will want to
  explicitly choose the Location Provider to use. More
  commonly, you’ll specify the requirements that a
  provider must meet and let Android determine the
  best technology to use.

 Use the Criteria class to dictate the requirements of a
  provider in terms of accuracy (fine or coarse), power
  use (low, medium, high), cost, and the ability to
  return values for altitude, speed.


                            9
Android Programming


Finding Providers Based on Criteria




                     10
Android Programming


Finding Your Location

 Before you can use the Location Manager, you need
  to add one or more uses-permission tags to your
  manifest to support access to the LBS hardware.



 You can find the last location fix determined by a
  particular Location Provider using the
  getLastKnownLocation method




                           11
Android Programming


Maps, Geocoding and LBS




               Geocoding




                   12
Android Programming


Reverse Geocoding




                    13
Android Programming


Forward Geocoding

 Forward geocoding (or just geocoding) determines
  map coordinates for a given location.
 To do a forward-geocoding lookup, call
  getFromLocationName on a Geocoder instance. Pass in
  the location you want the coordinates for and the
  maximum number of results to return, as shown in the
  snippet below:




                         14
Android Programming


Maps, Geocoding and LBS




                  Maps




                   15
Android Programming


Introducing MapView and MapActivity

 MapView is the actual Map View (control).
 MapActivity is the base class you extend to create a
  new Activity that can include a Map View. The
  MapActivity class handles the application life cycle
  and background service management required for
  displaying maps. As a result, you can only use a
  MapView within MapActivity-derived Activities.
 Overlay is the class used to annotate your maps. Using
  Overlays, you can use a Canvas to draw onto any
  number of layers that are displayed on top of a Map
  View.

                          16
Android Programming


Introducing MapView and MapActivity

 MapController is used to control the map, allowing you
  to set the center location and zoom levels.

 MyLocationOverlay is a special overlay that can be
  used to display the current position and orientation of
  the device.

 ItemizedOverlays and OverlayItems are used together
  to let you create a layer of map markers, displayed
  using drawable with associated text.

                           17
Android Programming


Creating a Map-Based Activity

 The Android map library is not a standard package; as
  an optional API, it must be explicitly included in the
  application manifest before it can be used. Add the
  library to your manifest using a uses-library tag
  within the application node, as shown in the XML
  snippet below:




                          18
Android Programming


Creating a Map-Based Activity

 Google Maps downloads the map tiles on demand; as a
  result, it implicitly requires permission to use the
  Internet. To see map tiles in your Map View, you need
  to add a uses-permission tag to your application
  manifest for android.permission.INTERNET, as shown
  below:




                         19
Android Programming


Creating a Map-Based Activity




                    20
Android Programming


Creating a Map-Based Activity




                    21
Android Programming


Exercise 8




             22
Android Programming

More Related Content

What's hot

Day: 1 Introduction to Mobile Application Development (in Android)
Day: 1 Introduction to Mobile Application Development (in Android)Day: 1 Introduction to Mobile Application Development (in Android)
Day: 1 Introduction to Mobile Application Development (in Android)Ahsanul Karim
 
iOS Architecture
iOS ArchitectureiOS Architecture
iOS ArchitectureJacky Lian
 
Android animation
Android animationAndroid animation
Android animationKrazy Koder
 
GeoServer, an introduction for beginners
GeoServer, an introduction for beginnersGeoServer, an introduction for beginners
GeoServer, an introduction for beginnersGeoSolutions
 
Planning Site Navigation
Planning Site NavigationPlanning Site Navigation
Planning Site NavigationMukesh Tekwani
 
android layouts
android layoutsandroid layouts
android layoutsDeepa Rani
 
Global positioning system (gps)
Global positioning  system (gps)Global positioning  system (gps)
Global positioning system (gps)Vandana Verma
 
Push Notification for Android, iOS & Sever Side Using Firebase Cloud Messaging
Push Notification for Android, iOS & Sever Side Using Firebase Cloud MessagingPush Notification for Android, iOS & Sever Side Using Firebase Cloud Messaging
Push Notification for Android, iOS & Sever Side Using Firebase Cloud MessagingCumulations Technologies
 
오픈소스 GIS 교육 - PostGIS
오픈소스 GIS 교육 - PostGIS오픈소스 GIS 교육 - PostGIS
오픈소스 GIS 교육 - PostGISJungHwan Yun
 
ExpressJS-Introduction.pdf
ExpressJS-Introduction.pdfExpressJS-Introduction.pdf
ExpressJS-Introduction.pdfBareen Shaikh
 
Image enhancement technique digital image analysis, in remote sensing ,P K MANI
Image enhancement technique  digital image analysis, in remote sensing ,P K MANIImage enhancement technique  digital image analysis, in remote sensing ,P K MANI
Image enhancement technique digital image analysis, in remote sensing ,P K MANIP.K. Mani
 
Image enhancement techniques a review
Image enhancement techniques   a reviewImage enhancement techniques   a review
Image enhancement techniques a revieweSAT Journals
 
Lecture satellite navigation
Lecture   satellite navigationLecture   satellite navigation
Lecture satellite navigationzannuar
 
Getting started with GIS
Getting started with GISGetting started with GIS
Getting started with GISEsri India
 

What's hot (20)

android menus
android menusandroid menus
android menus
 
Day: 1 Introduction to Mobile Application Development (in Android)
Day: 1 Introduction to Mobile Application Development (in Android)Day: 1 Introduction to Mobile Application Development (in Android)
Day: 1 Introduction to Mobile Application Development (in Android)
 
iOS Architecture
iOS ArchitectureiOS Architecture
iOS Architecture
 
Android animation
Android animationAndroid animation
Android animation
 
GeoServer, an introduction for beginners
GeoServer, an introduction for beginnersGeoServer, an introduction for beginners
GeoServer, an introduction for beginners
 
Gps and its application
Gps and its applicationGps and its application
Gps and its application
 
Planning Site Navigation
Planning Site NavigationPlanning Site Navigation
Planning Site Navigation
 
android layouts
android layoutsandroid layouts
android layouts
 
Global positioning system (gps)
Global positioning  system (gps)Global positioning  system (gps)
Global positioning system (gps)
 
Components of a gis
Components of a gisComponents of a gis
Components of a gis
 
Push Notification for Android, iOS & Sever Side Using Firebase Cloud Messaging
Push Notification for Android, iOS & Sever Side Using Firebase Cloud MessagingPush Notification for Android, iOS & Sever Side Using Firebase Cloud Messaging
Push Notification for Android, iOS & Sever Side Using Firebase Cloud Messaging
 
오픈소스 GIS 교육 - PostGIS
오픈소스 GIS 교육 - PostGIS오픈소스 GIS 교육 - PostGIS
오픈소스 GIS 교육 - PostGIS
 
ExpressJS-Introduction.pdf
ExpressJS-Introduction.pdfExpressJS-Introduction.pdf
ExpressJS-Introduction.pdf
 
Clipping
ClippingClipping
Clipping
 
Image enhancement technique digital image analysis, in remote sensing ,P K MANI
Image enhancement technique  digital image analysis, in remote sensing ,P K MANIImage enhancement technique  digital image analysis, in remote sensing ,P K MANI
Image enhancement technique digital image analysis, in remote sensing ,P K MANI
 
Gps signal structure
Gps signal structureGps signal structure
Gps signal structure
 
Image enhancement techniques a review
Image enhancement techniques   a reviewImage enhancement techniques   a review
Image enhancement techniques a review
 
Lecture satellite navigation
Lecture   satellite navigationLecture   satellite navigation
Lecture satellite navigation
 
Abstract of gps
Abstract of gpsAbstract of gps
Abstract of gps
 
Getting started with GIS
Getting started with GISGetting started with GIS
Getting started with GIS
 

Similar to [Android] Maps, Geocoding and Location-Based Services

Mobile Application Development-Lecture 15 & 16.pdf
Mobile Application Development-Lecture 15 & 16.pdfMobile Application Development-Lecture 15 & 16.pdf
Mobile Application Development-Lecture 15 & 16.pdfAbdullahMunir32
 
Android App Development 04 : Location API
Android App Development 04 : Location APIAndroid App Development 04 : Location API
Android App Development 04 : Location APIAnuchit Chalothorn
 
Location based services 10
Location based services   10Location based services   10
Location based services 10Michael Shrove
 
Android Rally: Google Maps with LBS
Android Rally: Google Maps with LBSAndroid Rally: Google Maps with LBS
Android Rally: Google Maps with LBSsumitra22
 
International Journal of Engineering Research and Development
International Journal of Engineering Research and DevelopmentInternational Journal of Engineering Research and Development
International Journal of Engineering Research and DevelopmentIJERD Editor
 
Land vehicle tracking system using java on android platform
Land vehicle tracking system using java on android platformLand vehicle tracking system using java on android platform
Land vehicle tracking system using java on android platformAlexander Decker
 
Android application for gps
Android application for gpsAndroid application for gps
Android application for gpsSutej Chakka
 
Geo location based augmented reality application
Geo location based augmented reality applicationGeo location based augmented reality application
Geo location based augmented reality applicationeSAT Journals
 
THE DESIGN IN MOBILE AND WEB PLATFORM OF THE LOCATION IDENTIFICATION APPLICAT...
THE DESIGN IN MOBILE AND WEB PLATFORM OF THE LOCATION IDENTIFICATION APPLICAT...THE DESIGN IN MOBILE AND WEB PLATFORM OF THE LOCATION IDENTIFICATION APPLICAT...
THE DESIGN IN MOBILE AND WEB PLATFORM OF THE LOCATION IDENTIFICATION APPLICAT...Ibrahim Özgön
 
Maps API on_mobile_dev_festbangkok
Maps API on_mobile_dev_festbangkokMaps API on_mobile_dev_festbangkok
Maps API on_mobile_dev_festbangkokss318
 
Location-Based Services on Android
Location-Based Services on AndroidLocation-Based Services on Android
Location-Based Services on AndroidJomar Tigcal
 
Jaipur Bus Finder - An Android-based Application
Jaipur Bus Finder - An Android-based ApplicationJaipur Bus Finder - An Android-based Application
Jaipur Bus Finder - An Android-based ApplicationAI Publications
 
Jaipur Bus Finder - An Android-based Application
Jaipur Bus Finder - An Android-based ApplicationJaipur Bus Finder - An Android-based Application
Jaipur Bus Finder - An Android-based ApplicationAI Publications
 
Android app developers in bangalore- thorsignia
Android app developers in bangalore- thorsigniaAndroid app developers in bangalore- thorsignia
Android app developers in bangalore- thorsigniacharan Teja
 
Matchinguu droidcon presentation
Matchinguu droidcon presentationMatchinguu droidcon presentation
Matchinguu droidcon presentationDroidcon Berlin
 

Similar to [Android] Maps, Geocoding and Location-Based Services (20)

Mobile Application Development-Lecture 15 & 16.pdf
Mobile Application Development-Lecture 15 & 16.pdfMobile Application Development-Lecture 15 & 16.pdf
Mobile Application Development-Lecture 15 & 16.pdf
 
Android App Development 04 : Location API
Android App Development 04 : Location APIAndroid App Development 04 : Location API
Android App Development 04 : Location API
 
Location based services
Location based servicesLocation based services
Location based services
 
Location based services 10
Location based services   10Location based services   10
Location based services 10
 
Android Rally: Google Maps with LBS
Android Rally: Google Maps with LBSAndroid Rally: Google Maps with LBS
Android Rally: Google Maps with LBS
 
MAD Unit 6.pptx
MAD Unit 6.pptxMAD Unit 6.pptx
MAD Unit 6.pptx
 
All about android
All about androidAll about android
All about android
 
International Journal of Engineering Research and Development
International Journal of Engineering Research and DevelopmentInternational Journal of Engineering Research and Development
International Journal of Engineering Research and Development
 
Android the future
Android  the futureAndroid  the future
Android the future
 
Land vehicle tracking system using java on android platform
Land vehicle tracking system using java on android platformLand vehicle tracking system using java on android platform
Land vehicle tracking system using java on android platform
 
google platform.pptx
google platform.pptxgoogle platform.pptx
google platform.pptx
 
Android application for gps
Android application for gpsAndroid application for gps
Android application for gps
 
Geo location based augmented reality application
Geo location based augmented reality applicationGeo location based augmented reality application
Geo location based augmented reality application
 
THE DESIGN IN MOBILE AND WEB PLATFORM OF THE LOCATION IDENTIFICATION APPLICAT...
THE DESIGN IN MOBILE AND WEB PLATFORM OF THE LOCATION IDENTIFICATION APPLICAT...THE DESIGN IN MOBILE AND WEB PLATFORM OF THE LOCATION IDENTIFICATION APPLICAT...
THE DESIGN IN MOBILE AND WEB PLATFORM OF THE LOCATION IDENTIFICATION APPLICAT...
 
Maps API on_mobile_dev_festbangkok
Maps API on_mobile_dev_festbangkokMaps API on_mobile_dev_festbangkok
Maps API on_mobile_dev_festbangkok
 
Location-Based Services on Android
Location-Based Services on AndroidLocation-Based Services on Android
Location-Based Services on Android
 
Jaipur Bus Finder - An Android-based Application
Jaipur Bus Finder - An Android-based ApplicationJaipur Bus Finder - An Android-based Application
Jaipur Bus Finder - An Android-based Application
 
Jaipur Bus Finder - An Android-based Application
Jaipur Bus Finder - An Android-based ApplicationJaipur Bus Finder - An Android-based Application
Jaipur Bus Finder - An Android-based Application
 
Android app developers in bangalore- thorsignia
Android app developers in bangalore- thorsigniaAndroid app developers in bangalore- thorsignia
Android app developers in bangalore- thorsignia
 
Matchinguu droidcon presentation
Matchinguu droidcon presentationMatchinguu droidcon presentation
Matchinguu droidcon presentation
 

More from Nikmesoft Ltd

[iOS] Multiple Background Threads
[iOS] Multiple Background Threads[iOS] Multiple Background Threads
[iOS] Multiple Background ThreadsNikmesoft Ltd
 
[iOS] Basic UI Elements
[iOS] Basic UI Elements[iOS] Basic UI Elements
[iOS] Basic UI ElementsNikmesoft Ltd
 
[iOS] Introduction to iOS Programming
[iOS] Introduction to iOS Programming[iOS] Introduction to iOS Programming
[iOS] Introduction to iOS ProgrammingNikmesoft Ltd
 
[Android] Multimedia Programming
[Android] Multimedia Programming[Android] Multimedia Programming
[Android] Multimedia ProgrammingNikmesoft Ltd
 
[Android] Android Animation
[Android] Android Animation[Android] Android Animation
[Android] Android AnimationNikmesoft Ltd
 
[Android] 2D Graphics
[Android] 2D Graphics[Android] 2D Graphics
[Android] 2D GraphicsNikmesoft Ltd
 
[Android] Services and Broadcast Receivers
[Android] Services and Broadcast Receivers[Android] Services and Broadcast Receivers
[Android] Services and Broadcast ReceiversNikmesoft Ltd
 
[Android] Web services
[Android] Web services[Android] Web services
[Android] Web servicesNikmesoft Ltd
 
[Android] Multiple Background Threads
[Android] Multiple Background Threads[Android] Multiple Background Threads
[Android] Multiple Background ThreadsNikmesoft Ltd
 
[Android] Data Storage
[Android] Data Storage[Android] Data Storage
[Android] Data StorageNikmesoft Ltd
 
[Android] Intent and Activity
[Android] Intent and Activity[Android] Intent and Activity
[Android] Intent and ActivityNikmesoft Ltd
 
[Android] Widget Event Handling
[Android] Widget Event Handling[Android] Widget Event Handling
[Android] Widget Event HandlingNikmesoft Ltd
 
[Android] Using Selection Widgets
[Android] Using Selection Widgets[Android] Using Selection Widgets
[Android] Using Selection WidgetsNikmesoft Ltd
 
[Android] Basic Widgets and Containers
[Android] Basic Widgets and Containers[Android] Basic Widgets and Containers
[Android] Basic Widgets and ContainersNikmesoft Ltd
 
[Android] Introduction to Android Programming
[Android] Introduction to Android Programming[Android] Introduction to Android Programming
[Android] Introduction to Android ProgrammingNikmesoft Ltd
 

More from Nikmesoft Ltd (18)

[iOS] Networking
[iOS] Networking[iOS] Networking
[iOS] Networking
 
[iOS] Data Storage
[iOS] Data Storage[iOS] Data Storage
[iOS] Data Storage
 
[iOS] Multiple Background Threads
[iOS] Multiple Background Threads[iOS] Multiple Background Threads
[iOS] Multiple Background Threads
 
[iOS] Navigation
[iOS] Navigation[iOS] Navigation
[iOS] Navigation
 
[iOS] Basic UI Elements
[iOS] Basic UI Elements[iOS] Basic UI Elements
[iOS] Basic UI Elements
 
[iOS] Introduction to iOS Programming
[iOS] Introduction to iOS Programming[iOS] Introduction to iOS Programming
[iOS] Introduction to iOS Programming
 
[Android] Multimedia Programming
[Android] Multimedia Programming[Android] Multimedia Programming
[Android] Multimedia Programming
 
[Android] Android Animation
[Android] Android Animation[Android] Android Animation
[Android] Android Animation
 
[Android] 2D Graphics
[Android] 2D Graphics[Android] 2D Graphics
[Android] 2D Graphics
 
[Android] Services and Broadcast Receivers
[Android] Services and Broadcast Receivers[Android] Services and Broadcast Receivers
[Android] Services and Broadcast Receivers
 
[Android] Web services
[Android] Web services[Android] Web services
[Android] Web services
 
[Android] Multiple Background Threads
[Android] Multiple Background Threads[Android] Multiple Background Threads
[Android] Multiple Background Threads
 
[Android] Data Storage
[Android] Data Storage[Android] Data Storage
[Android] Data Storage
 
[Android] Intent and Activity
[Android] Intent and Activity[Android] Intent and Activity
[Android] Intent and Activity
 
[Android] Widget Event Handling
[Android] Widget Event Handling[Android] Widget Event Handling
[Android] Widget Event Handling
 
[Android] Using Selection Widgets
[Android] Using Selection Widgets[Android] Using Selection Widgets
[Android] Using Selection Widgets
 
[Android] Basic Widgets and Containers
[Android] Basic Widgets and Containers[Android] Basic Widgets and Containers
[Android] Basic Widgets and Containers
 
[Android] Introduction to Android Programming
[Android] Introduction to Android Programming[Android] Introduction to Android Programming
[Android] Introduction to Android Programming
 

Recently uploaded

Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...FIDO Alliance
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxAbida Shariff
 
Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Patrick Viafore
 
The Metaverse: Are We There Yet?
The  Metaverse:    Are   We  There  Yet?The  Metaverse:    Are   We  There  Yet?
The Metaverse: Are We There Yet?Mark Billinghurst
 
Top 10 Symfony Development Companies 2024
Top 10 Symfony Development Companies 2024Top 10 Symfony Development Companies 2024
Top 10 Symfony Development Companies 2024TopCSSGallery
 
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi IbrahimzadeFree and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi IbrahimzadeCzechDreamin
 
IESVE for Early Stage Design and Planning
IESVE for Early Stage Design and PlanningIESVE for Early Stage Design and Planning
IESVE for Early Stage Design and PlanningIES VE
 
ECS 2024 Teams Premium - Pretty Secure
ECS 2024   Teams Premium - Pretty SecureECS 2024   Teams Premium - Pretty Secure
ECS 2024 Teams Premium - Pretty SecureFemke de Vroome
 
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...CzechDreamin
 
AI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří KarpíšekAI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří KarpíšekCzechDreamin
 
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdfSimplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdfFIDO Alliance
 
A Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System StrategyA Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System StrategyUXDXConf
 
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdfLinux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdfFIDO Alliance
 
Buy Epson EcoTank L3210 Colour Printer Online.pdf
Buy Epson EcoTank L3210 Colour Printer Online.pdfBuy Epson EcoTank L3210 Colour Printer Online.pdf
Buy Epson EcoTank L3210 Colour Printer Online.pdfEasyPrinterHelp
 
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptxUnpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptxDavid Michel
 
PLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. StartupsPLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. StartupsStefano
 
Intro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераIntro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераMark Opanasiuk
 
Syngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdfSyngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdfSyngulon
 
Speed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in MinutesSpeed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in Minutesconfluent
 
AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101vincent683379
 

Recently uploaded (20)

Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
 
Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024
 
The Metaverse: Are We There Yet?
The  Metaverse:    Are   We  There  Yet?The  Metaverse:    Are   We  There  Yet?
The Metaverse: Are We There Yet?
 
Top 10 Symfony Development Companies 2024
Top 10 Symfony Development Companies 2024Top 10 Symfony Development Companies 2024
Top 10 Symfony Development Companies 2024
 
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi IbrahimzadeFree and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
 
IESVE for Early Stage Design and Planning
IESVE for Early Stage Design and PlanningIESVE for Early Stage Design and Planning
IESVE for Early Stage Design and Planning
 
ECS 2024 Teams Premium - Pretty Secure
ECS 2024   Teams Premium - Pretty SecureECS 2024   Teams Premium - Pretty Secure
ECS 2024 Teams Premium - Pretty Secure
 
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
 
AI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří KarpíšekAI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří Karpíšek
 
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdfSimplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
 
A Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System StrategyA Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System Strategy
 
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdfLinux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
 
Buy Epson EcoTank L3210 Colour Printer Online.pdf
Buy Epson EcoTank L3210 Colour Printer Online.pdfBuy Epson EcoTank L3210 Colour Printer Online.pdf
Buy Epson EcoTank L3210 Colour Printer Online.pdf
 
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptxUnpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
 
PLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. StartupsPLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. Startups
 
Intro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераIntro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджера
 
Syngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdfSyngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdf
 
Speed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in MinutesSpeed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in Minutes
 
AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101
 

[Android] Maps, Geocoding and Location-Based Services

  • 1. Android Programming Lesson 8 Maps, Geocoding and Location-Based Services NGUYEN The Linh
  • 2. Android Programming Contents 1 Location-Based Services 2 Gecoding 3 Maps 4 Exercise 8 2
  • 3. Android Programming Maps, Geocoding and LBS Location-Based Services 3
  • 4. Android Programming Using Location-Based Services  Location-based services (LBS) is an umbrella term used to describe the different technologies used to find the device’s current location. The two main LBS elements are:  LocationManager: Provides hooks to the location-based services.  LocationProviders: Each of which represents a different location finding technology used to determine the device’s current location. 4
  • 5. Android Programming Setting up the Emulator with Test Providers  Location-based services are dependant on device hardware for finding the current location. When developing and testing with the emulator, your hardware is virtualized, and you’re likely to stay in pretty much the same location.  Use the Location Controls available from the DDMS perspective in Eclipse to push location changes directly into the test GPS_PROVIDER. 5
  • 6. Android Programming Setting up the Emulator with Test Providers 6
  • 7. Android Programming Selecting a Location Provider  Depending on the device, there may be several technologies that Android can use to determine the current location. Each technology, or Location Provider, will offer different capabilities including power consumption, monetary cost, accuracy, and the ability to determine altitude, speed, or heading information. 7
  • 8. Android Programming Finding the Available Providers  The LocationManager class includes static string constants that return the provider name for the two most common Location Providers:  LocationManager.GPS_PROVIDER  LocationManager.NETWORK_PROVIDER  To get a list of names for all the providers available on the device, call getProviders, using a Boolean to indicate if you want all, or only the enabled, providers to be returned: 8
  • 9. Android Programming Finding Providers Based on Criteria  In most scenarios, it’s unlikely that you will want to explicitly choose the Location Provider to use. More commonly, you’ll specify the requirements that a provider must meet and let Android determine the best technology to use.  Use the Criteria class to dictate the requirements of a provider in terms of accuracy (fine or coarse), power use (low, medium, high), cost, and the ability to return values for altitude, speed. 9
  • 11. Android Programming Finding Your Location  Before you can use the Location Manager, you need to add one or more uses-permission tags to your manifest to support access to the LBS hardware.  You can find the last location fix determined by a particular Location Provider using the getLastKnownLocation method 11
  • 12. Android Programming Maps, Geocoding and LBS Geocoding 12
  • 14. Android Programming Forward Geocoding  Forward geocoding (or just geocoding) determines map coordinates for a given location.  To do a forward-geocoding lookup, call getFromLocationName on a Geocoder instance. Pass in the location you want the coordinates for and the maximum number of results to return, as shown in the snippet below: 14
  • 16. Android Programming Introducing MapView and MapActivity  MapView is the actual Map View (control).  MapActivity is the base class you extend to create a new Activity that can include a Map View. The MapActivity class handles the application life cycle and background service management required for displaying maps. As a result, you can only use a MapView within MapActivity-derived Activities.  Overlay is the class used to annotate your maps. Using Overlays, you can use a Canvas to draw onto any number of layers that are displayed on top of a Map View. 16
  • 17. Android Programming Introducing MapView and MapActivity  MapController is used to control the map, allowing you to set the center location and zoom levels.  MyLocationOverlay is a special overlay that can be used to display the current position and orientation of the device.  ItemizedOverlays and OverlayItems are used together to let you create a layer of map markers, displayed using drawable with associated text. 17
  • 18. Android Programming Creating a Map-Based Activity  The Android map library is not a standard package; as an optional API, it must be explicitly included in the application manifest before it can be used. Add the library to your manifest using a uses-library tag within the application node, as shown in the XML snippet below: 18
  • 19. Android Programming Creating a Map-Based Activity  Google Maps downloads the map tiles on demand; as a result, it implicitly requires permission to use the Internet. To see map tiles in your Map View, you need to add a uses-permission tag to your application manifest for android.permission.INTERNET, as shown below: 19
  • 20. Android Programming Creating a Map-Based Activity 20
  • 21. Android Programming Creating a Map-Based Activity 21