SlideShare una empresa de Scribd logo
1 de 23
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

Más contenido relacionado

La actualidad más candente

An introduction to mobile app development and investing
An introduction to mobile app development and investingAn introduction to mobile app development and investing
An introduction to mobile app development and investingBrandon Na
 
Creating the first app with android studio
Creating the first app with android studioCreating the first app with android studio
Creating the first app with android studioParinita03
 
Mobile Application Development: Hybrid, Native and Mobile Web Apps
Mobile Application Development: Hybrid, Native and Mobile Web AppsMobile Application Development: Hybrid, Native and Mobile Web Apps
Mobile Application Development: Hybrid, Native and Mobile Web AppsPaul Sons
 
Native, Hybrid, or Cross-platform Development? What Type of Mobile App is Bes...
Native, Hybrid, or Cross-platform Development? What Type of Mobile App is Bes...Native, Hybrid, or Cross-platform Development? What Type of Mobile App is Bes...
Native, Hybrid, or Cross-platform Development? What Type of Mobile App is Bes...ReformedTech
 
My Project Report Documentation with Abstract & Snapshots
My Project Report Documentation with Abstract & SnapshotsMy Project Report Documentation with Abstract & Snapshots
My Project Report Documentation with Abstract & SnapshotsUsman Sait
 
Top 11 Mobile App Development Frameworks
Top 11 Mobile App Development FrameworksTop 11 Mobile App Development Frameworks
Top 11 Mobile App Development FrameworksAlbiorix Technology
 
Android GPS Tutorial
Android GPS TutorialAndroid GPS Tutorial
Android GPS TutorialAhsanul Karim
 
Skia & Freetype - Android 2D Graphics Essentials
Skia & Freetype - Android 2D Graphics EssentialsSkia & Freetype - Android 2D Graphics Essentials
Skia & Freetype - Android 2D Graphics EssentialsKyungmin Lee
 
Android app development
Android app developmentAndroid app development
Android app developmentTanmoy Roy
 
Android Architecture.pptx
Android Architecture.pptxAndroid Architecture.pptx
Android Architecture.pptxpriya Nithya
 
Graphics software standards
Graphics software standardsGraphics software standards
Graphics software standardsAnkit Garg
 
Android activities & views
Android activities & viewsAndroid activities & views
Android activities & viewsma-polimi
 
GeoTools와 GeoServer를 이용한 KOPSS Open API의 구현
GeoTools와 GeoServer를 이용한 KOPSS Open API의 구현GeoTools와 GeoServer를 이용한 KOPSS Open API의 구현
GeoTools와 GeoServer를 이용한 KOPSS Open API의 구현MinPa Lee
 

La actualidad más candente (20)

Three.js basics
Three.js basicsThree.js basics
Three.js basics
 
An introduction to mobile app development and investing
An introduction to mobile app development and investingAn introduction to mobile app development and investing
An introduction to mobile app development and investing
 
AndroidManifest
AndroidManifestAndroidManifest
AndroidManifest
 
Creating the first app with android studio
Creating the first app with android studioCreating the first app with android studio
Creating the first app with android studio
 
Hardware Accelerated 2D Rendering for Android
Hardware Accelerated 2D Rendering for AndroidHardware Accelerated 2D Rendering for Android
Hardware Accelerated 2D Rendering for Android
 
Android Basic Components
Android Basic ComponentsAndroid Basic Components
Android Basic Components
 
Mobile Application Development: Hybrid, Native and Mobile Web Apps
Mobile Application Development: Hybrid, Native and Mobile Web AppsMobile Application Development: Hybrid, Native and Mobile Web Apps
Mobile Application Development: Hybrid, Native and Mobile Web Apps
 
Native, Hybrid, or Cross-platform Development? What Type of Mobile App is Bes...
Native, Hybrid, or Cross-platform Development? What Type of Mobile App is Bes...Native, Hybrid, or Cross-platform Development? What Type of Mobile App is Bes...
Native, Hybrid, or Cross-platform Development? What Type of Mobile App is Bes...
 
My Project Report Documentation with Abstract & Snapshots
My Project Report Documentation with Abstract & SnapshotsMy Project Report Documentation with Abstract & Snapshots
My Project Report Documentation with Abstract & Snapshots
 
Android Threading
Android ThreadingAndroid Threading
Android Threading
 
Top 11 Mobile App Development Frameworks
Top 11 Mobile App Development FrameworksTop 11 Mobile App Development Frameworks
Top 11 Mobile App Development Frameworks
 
Android GPS Tutorial
Android GPS TutorialAndroid GPS Tutorial
Android GPS Tutorial
 
Skia & Freetype - Android 2D Graphics Essentials
Skia & Freetype - Android 2D Graphics EssentialsSkia & Freetype - Android 2D Graphics Essentials
Skia & Freetype - Android 2D Graphics Essentials
 
Android app development
Android app developmentAndroid app development
Android app development
 
Different types of mobile apps
Different types of mobile appsDifferent types of mobile apps
Different types of mobile apps
 
Introduction to android testing
Introduction to android testingIntroduction to android testing
Introduction to android testing
 
Android Architecture.pptx
Android Architecture.pptxAndroid Architecture.pptx
Android Architecture.pptx
 
Graphics software standards
Graphics software standardsGraphics software standards
Graphics software standards
 
Android activities & views
Android activities & viewsAndroid activities & views
Android activities & views
 
GeoTools와 GeoServer를 이용한 KOPSS Open API의 구현
GeoTools와 GeoServer를 이용한 KOPSS Open API의 구현GeoTools와 GeoServer를 이용한 KOPSS Open API의 구현
GeoTools와 GeoServer를 이용한 KOPSS Open API의 구현
 

Similar a [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
 
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
 
ARmedia SDK: new Features and Capabilities
ARmedia SDK: new Features and CapabilitiesARmedia SDK: new Features and Capabilities
ARmedia SDK: new Features and CapabilitiesGraziano Terenzi
 

Similar a [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
 
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
 
ARmedia SDK: new Features and Capabilities
ARmedia SDK: new Features and CapabilitiesARmedia SDK: new Features and Capabilities
ARmedia SDK: new Features and Capabilities
 

Más de 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
 

Más de 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
 

Último

Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 

Último (20)

Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 

[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