SlideShare a Scribd company logo
Location-Based Services
       on Android



                   Jomar Tigcal
       GDG DevFest Bacolod 2012
              November 5, 2012
Jomar Tigcal
● Community Manager of GDG Philippines
● Mobile Apps Developer
● Software Engineer at Stratpoint
  Technologies, Inc.
● One of the developers of Moochfood

                      http://jomar.tigcal.com
                          jomar@tigcal.com
                                @jomartigcal
Moochfood
                   Moochfood      is    an
                   Android     application
                   that allows you to
                   record, rate and share
                   dining experiences.




      http://www.moochfood.com/
Location
Challenges
● Obtaining user location can consume a lot of
  battery
● Getting location takes some time
● Because the user location changes, you
  must account for movement by re-estimating
  user location every so often.
● Location estimates from each source may
  not be accurate.
android.location
              Android provides a location
              framework        that    your
              application can use to
              determine      the    device's
              location and bearing and
              register for updates.

              http://developer.android.
              com/reference/android/locat
              ion/package-summary.html
Android Permissions
● ACCESS_COARSE_LOCATION
  -> Network Provider: cell tower and Wi-Fi
  signals

● ACCESS_FINE_LOCATION
  -> GPS Provider
Android Permissions
Note:
If you are using both NETWORK_PROVIDER
and GPS_PROVIDER, then you need to
request only the ACCESS_FINE_LOCATION
permission, because it includes permission for
both.
Android Location API
● Location
  A class representing a geographic location sensed
  at a particular time.

● LocationManager
  This class provides access to the system location
  services.

● LocationListener
  Interface used for receiving notifications from the
  LocationManager when the location has changed.
Getting User Location




                  Image Source: http://evalblog.com/2011/06/06/where-am-i/
Getting User Location
● Create an instance of LocationManager
  Location locationManager =
  (LocationManager) this.getSystemService
  (Context.LOCATION_SERVICE);
● Check Location Provider
  final boolean gpsEnabled =
  locationManager.isProviderEnabled
  (LocationManager.GPS_PROVIDER);
Getting User Location

● Start listening for location updates
  locationManager.requestLocationUpdates
  (LocationManager.GPS_PROVIDER, 0, 0,
  locationListener);

● Stop listening for location updates
  locationManager.removeUpdates(this);
Getting User Location
Getting User Location
Getting User Location
What's next?
Commonly used APIs




         Image Sources: http://developer.foursquare.com and http://thegreasywiener.com/
Google Places API (https:
  //developers.google.
      com/places/)
Google Places API
● Place Searches return a list of Places based on
  a user's location or search string.
● Place Details requests return more detailed
  information about a specific Place, including user
  reviews.
● Place Actions allow you to supplement the data
  in Google's Places Database with data from your
  application. You can schedule Events, add and
  remove Places, or weight Place rankings from
  user activity with Place Bumps.
Google Places API
● Places Autocomplete can be used to provide
  autocomplete functionality for text-based
  geographic searches, by returning Places as
  you type.
● Query Autocomplete can be used to provide a
  query prediction service for text-based
  geographic searches, by returning suggested
  queries as you type.
Getting API Key
● Go to Google APIs console (http://code.
  google.com/apis/console)
● Create an API Project
● Select Services
● Turn on Places API
Places Search
● Nearby Search
  by location (latitude, longitude)

● Text Search
  by search query
  (e.g. "pizza in Bacolod")
Nearby Search Syntax

Syntax:
https://maps.googleapis.
com/maps/api/place/nearbysearch/output?
parameters

Output: Either json or xml
Nearby Search Required Parameters
● key
  API Key
● location
  latitude, longitude
● radius
  distance in meters, maximum of 50, 000 m
● sensor (true/false)
  if request came from location sensor (GPS)
Nearby Search Optional Parameters
keyword -         content
language -        language code
name        -     name
rankby      -     prominence or distance
*if rankby=distance, radius should not be included

types
pagetoken
Place Search Types
Separated by |

Examples:
food     restaurant   convenience_store
hospital school       grocery_or_supermarket

More at:
https://developers.google.
com/places/documentation/supported_types
Example
● Place Search:
https://maps.googleapis.
com/maps/api/place/nearbysearch/json?
location=loc_here&sensor=true&radius=500&ke
y=key_here
● Type=food
https://maps.googleapis.
com/maps/api/place/nearbysearch/json?
location=loc_here&sensor=true&radius=500&typ
es=food&key=key_here
Foursquare API (https:
//developer.foursquare.
         com)
Foursquare API
Core API: Check in, view their history, see where
their friends are, create tips and lists, search for
and learn more about venues, and access specials
and recommendations.

Real-time API: Venue push API notifies venue
managers when users check in to their venues,
and our user push API notifies developers when
their users check in anywhere.
Foursquare API
Merchant Platform: Allows developers to write
applications that help registered venue owners
manage their foursquare presence and
specials.

Venues Platform: Search for places and access
a wealth of information about them, including
addresses, popularity, tips, and photos.
Foursquare Venues Search
Search Foursquare database and find
information including tips, photos, check-in
counts, and here now

Syntax:

https://api.foursquare.com/v2/venues/search
Venues Search Parameters
Required Parameters:

● ll (latitude, longitude) - user's location
  or
● near (text) - place where to search

● v (YYYYMMDD) indicates that the client is
  up to date as of the specified date
Venues Search Parameters
Optional Parameters:

●   query - name of place to search
●   limit - number of results (max is 50)
●   radius - distance in meters (max is 10,000)
●   categoryId - comma-separated categories to
    limit search
Foursquare Demo
HTTP Request:
https://api.foursquare.com/v2/venues/search?
ll=40.7,-74
&oauth_token=0445ZMNU5XS4JDAURLRE3M
ARL222RVJITL2XBKF0CR1C2EWR&v=20121
102

Android Project:
  * Sample Android Project is available at
  https://github.com/jomartigcal/lbs-android-
  sample
Foursquare Demo
Google Places API Challenge 2012
http://developers.google.com/places/challenge/




  Deadline: November 30, 2012
Foursquare Hack Day Philippines
      http://hackday.webgeek.ph/




       December 1, 2012
Resources
● http://developer.android.
  com/reference/android/location/package-
  summary.html
● http://developer.android.
  com/guide/topics/location/index.html
● https://developers.google.com/places/
● https://developer.foursquare.com
● https://github.com/jomartigcal/lbs-android-
  sample
Questions?




             Image Source: http://www.smoblog.com/
Thank you very much!
Location-Based Services
       on Android



                   Jomar Tigcal
       GDG DevFest Bacolod 2012
              November 5, 2012

More Related Content

What's hot

Android activities & views
Android activities & viewsAndroid activities & views
Android activities & views
ma-polimi
 
Shared preferences
Shared preferencesShared preferences
Shared preferences
Sourabh Sahu
 
Google Maps in Android
Google Maps in AndroidGoogle Maps in Android
Google Maps in Android
Mobile 2.0 Europe
 
Android application development ppt
Android application development pptAndroid application development ppt
Android application development ppt
Gautam Kumar
 
Android - Application Framework
Android - Application FrameworkAndroid - Application Framework
Android - Application Framework
Yong Heui Cho
 
Introduction to android
Introduction to androidIntroduction to android
Introduction to android
zeelpatel0504
 
Introduction to Android Development
Introduction to Android DevelopmentIntroduction to Android Development
Introduction to Android Development
Aly Abdelkareem
 
Android Components
Android ComponentsAndroid Components
Android Components
Aatul Palandurkar
 
Android SDK Tutorial | Edureka
Android SDK Tutorial | EdurekaAndroid SDK Tutorial | Edureka
Android SDK Tutorial | Edureka
Edureka!
 
android activity
android activityandroid activity
android activityDeepa Rani
 
Introduction to fragments in android
Introduction to fragments in androidIntroduction to fragments in android
Introduction to fragments in android
Prawesh Shrestha
 
Notification android
Notification androidNotification android
Notification android
ksheerod shri toshniwal
 
Android structure
Android structureAndroid structure
Android structure
Kumar
 
Introduction to android testing
Introduction to android testingIntroduction to android testing
Introduction to android testing
Diego Torres Milano
 
Jetpack Navigation Component
Jetpack Navigation ComponentJetpack Navigation Component
Jetpack Navigation Component
James Shvarts
 

What's hot (20)

Android activities & views
Android activities & viewsAndroid activities & views
Android activities & views
 
Android Basic Components
Android Basic ComponentsAndroid Basic Components
Android Basic Components
 
Shared preferences
Shared preferencesShared preferences
Shared preferences
 
Android Threading
Android ThreadingAndroid Threading
Android Threading
 
Google Maps in Android
Google Maps in AndroidGoogle Maps in Android
Google Maps in Android
 
Android application development ppt
Android application development pptAndroid application development ppt
Android application development ppt
 
Android - Application Framework
Android - Application FrameworkAndroid - Application Framework
Android - Application Framework
 
Android Services
Android ServicesAndroid Services
Android Services
 
Introduction to android
Introduction to androidIntroduction to android
Introduction to android
 
Introduction to Android Development
Introduction to Android DevelopmentIntroduction to Android Development
Introduction to Android Development
 
Android Components
Android ComponentsAndroid Components
Android Components
 
AndroidManifest
AndroidManifestAndroidManifest
AndroidManifest
 
Android SDK Tutorial | Edureka
Android SDK Tutorial | EdurekaAndroid SDK Tutorial | Edureka
Android SDK Tutorial | Edureka
 
android activity
android activityandroid activity
android activity
 
Introduction to fragments in android
Introduction to fragments in androidIntroduction to fragments in android
Introduction to fragments in android
 
Android intents
Android intentsAndroid intents
Android intents
 
Notification android
Notification androidNotification android
Notification android
 
Android structure
Android structureAndroid structure
Android structure
 
Introduction to android testing
Introduction to android testingIntroduction to android testing
Introduction to android testing
 
Jetpack Navigation Component
Jetpack Navigation ComponentJetpack Navigation Component
Jetpack Navigation Component
 

Viewers also liked

Location based reminder
Location based reminderLocation based reminder
Location based reminder
junnubabu
 
Location Tracking of Android Device Based on SMS.
Location Tracking of Android Device Based on SMS.Location Tracking of Android Device Based on SMS.
Location Tracking of Android Device Based on SMS.
iCreateWorld
 
Location Based services
Location Based servicesLocation Based services
Location Based services
Fraj Alshahibi
 
Lecture Slides for Location based Services [Android]
Lecture Slides for Location based Services [Android]Lecture Slides for Location based Services [Android]
Lecture Slides for Location based Services [Android]Nehil Jain
 
Location Based Services - An Overview
Location Based Services - An Overview Location Based Services - An Overview
Location Based Services - An Overview amsanjeev
 
Final Year Project Report on Self Tacit Zone (Location Based Android App)
Final Year Project Report on Self Tacit Zone (Location Based Android App)Final Year Project Report on Self Tacit Zone (Location Based Android App)
Final Year Project Report on Self Tacit Zone (Location Based Android App)
Parthik Poshiya
 
1 location tracking of android device based on sms
 1 location tracking of android device based on sms 1 location tracking of android device based on sms
1 location tracking of android device based on sms
iCreateWorld
 
20 Hot Location-Based Apps and Services You Should Know About
20 Hot Location-Based Apps and Services You Should Know About20 Hot Location-Based Apps and Services You Should Know About
20 Hot Location-Based Apps and Services You Should Know About
Enterprise Social Technology (Book)
 
Location Based Services: Business Model
Location Based Services: Business ModelLocation Based Services: Business Model
Location Based Services: Business Model
Evangelos Tselentis
 
Vehicle tracking system,be computer android report,android project report,gps...
Vehicle tracking system,be computer android report,android project report,gps...Vehicle tracking system,be computer android report,android project report,gps...
Vehicle tracking system,be computer android report,android project report,gps...
Sujit9561
 
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
Usman Sait
 
7 Hot Location-Based Apps You Should Know About
7 Hot Location-Based Apps You Should Know About7 Hot Location-Based Apps You Should Know About
7 Hot Location-Based Apps You Should Know About
Shauna Causey
 
Bus tracking application in Android
Bus tracking application in AndroidBus tracking application in Android
Bus tracking application in Android
yashonil
 
Dfd examples
Dfd examplesDfd examples
Dfd examplesMohit
 
Location Based Services: Global Market Overview, Deployment Trends and Potent...
Location Based Services: Global Market Overview, Deployment Trends and Potent...Location Based Services: Global Market Overview, Deployment Trends and Potent...
Location Based Services: Global Market Overview, Deployment Trends and Potent...
Convergence Catalyst
 
Bus tracking application project report
Bus tracking application project reportBus tracking application project report
Bus tracking application project report
Abhishek Singh
 
Vehicle tracking system using gps and gsm techniques
Vehicle tracking system using gps and gsm techniquesVehicle tracking system using gps and gsm techniques
Vehicle tracking system using gps and gsm techniques
Bharath Chapala
 
Location Based Services
Location Based ServicesLocation Based Services
Location Based Services
Peter Byrne
 
Vehicle Tracking System
Vehicle Tracking SystemVehicle Tracking System
Vehicle Tracking System
Vikas Agarwal
 

Viewers also liked (20)

Location based reminder
Location based reminderLocation based reminder
Location based reminder
 
Location Tracking of Android Device Based on SMS.
Location Tracking of Android Device Based on SMS.Location Tracking of Android Device Based on SMS.
Location Tracking of Android Device Based on SMS.
 
Location Based services
Location Based servicesLocation Based services
Location Based services
 
Lecture Slides for Location based Services [Android]
Lecture Slides for Location based Services [Android]Lecture Slides for Location based Services [Android]
Lecture Slides for Location based Services [Android]
 
Location Based Services - An Overview
Location Based Services - An Overview Location Based Services - An Overview
Location Based Services - An Overview
 
Final Year Project Report on Self Tacit Zone (Location Based Android App)
Final Year Project Report on Self Tacit Zone (Location Based Android App)Final Year Project Report on Self Tacit Zone (Location Based Android App)
Final Year Project Report on Self Tacit Zone (Location Based Android App)
 
1 location tracking of android device based on sms
 1 location tracking of android device based on sms 1 location tracking of android device based on sms
1 location tracking of android device based on sms
 
Mobile GPS Tracking
Mobile GPS TrackingMobile GPS Tracking
Mobile GPS Tracking
 
20 Hot Location-Based Apps and Services You Should Know About
20 Hot Location-Based Apps and Services You Should Know About20 Hot Location-Based Apps and Services You Should Know About
20 Hot Location-Based Apps and Services You Should Know About
 
Location Based Services: Business Model
Location Based Services: Business ModelLocation Based Services: Business Model
Location Based Services: Business Model
 
Vehicle tracking system,be computer android report,android project report,gps...
Vehicle tracking system,be computer android report,android project report,gps...Vehicle tracking system,be computer android report,android project report,gps...
Vehicle tracking system,be computer android report,android project report,gps...
 
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
 
7 Hot Location-Based Apps You Should Know About
7 Hot Location-Based Apps You Should Know About7 Hot Location-Based Apps You Should Know About
7 Hot Location-Based Apps You Should Know About
 
Bus tracking application in Android
Bus tracking application in AndroidBus tracking application in Android
Bus tracking application in Android
 
Dfd examples
Dfd examplesDfd examples
Dfd examples
 
Location Based Services: Global Market Overview, Deployment Trends and Potent...
Location Based Services: Global Market Overview, Deployment Trends and Potent...Location Based Services: Global Market Overview, Deployment Trends and Potent...
Location Based Services: Global Market Overview, Deployment Trends and Potent...
 
Bus tracking application project report
Bus tracking application project reportBus tracking application project report
Bus tracking application project report
 
Vehicle tracking system using gps and gsm techniques
Vehicle tracking system using gps and gsm techniquesVehicle tracking system using gps and gsm techniques
Vehicle tracking system using gps and gsm techniques
 
Location Based Services
Location Based ServicesLocation Based Services
Location Based Services
 
Vehicle Tracking System
Vehicle Tracking SystemVehicle Tracking System
Vehicle Tracking System
 

Similar to Location-Based Services on Android

Android App Development 04 : Location API
Android App Development 04 : Location APIAndroid App Development 04 : Location API
Android App Development 04 : Location APIAnuchit Chalothorn
 
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
AbdullahMunir32
 
Location based services
Location based servicesLocation based services
Location based services
BRILLMINDZ TECHNOLOGIES
 
Developing Windows Phone Apps with Maps and Location Services
Developing Windows Phone Apps with Maps and Location ServicesDeveloping Windows Phone Apps with Maps and Location Services
Developing Windows Phone Apps with Maps and Location Services
Nick Landry
 
Android location and sensors API
Android location and sensors APIAndroid location and sensors API
Android location and sensors API
eleksdev
 
Philipp Nagele (Wikitude): What's Next with Wikitude
Philipp Nagele (Wikitude): What's Next with WikitudePhilipp Nagele (Wikitude): What's Next with Wikitude
Philipp Nagele (Wikitude): What's Next with Wikitude
AugmentedWorldExpo
 
Deep Dive into the ArcGIS Geotrigger Service - Esri DevSummit Dubai 2013
Deep Dive into the ArcGIS Geotrigger Service - Esri DevSummit Dubai 2013Deep Dive into the ArcGIS Geotrigger Service - Esri DevSummit Dubai 2013
Deep Dive into the ArcGIS Geotrigger Service - Esri DevSummit Dubai 2013Aaron Parecki
 
Mobile applications chapter 6
Mobile applications chapter 6Mobile applications chapter 6
Mobile applications chapter 6
Akib B. Momin
 
Location-Based Marketing Application Development Made Easier with GeoSimulator
Location-Based Marketing Application Development Made Easier with GeoSimulatorLocation-Based Marketing Application Development Made Easier with GeoSimulator
Location-Based Marketing Application Development Made Easier with GeoSimulator
Sundeep Dawale
 
MyATM
MyATMMyATM
How to use geolocation in react native apps
How to use geolocation in react native appsHow to use geolocation in react native apps
How to use geolocation in react native apps
InnovationM
 
[English] Create Mobile LBS Application Using Maps API
[English] Create Mobile LBS Application Using Maps API[English] Create Mobile LBS Application Using Maps API
[English] Create Mobile LBS Application Using Maps API
Google Cloud Platform - Japan
 
MAD Unit 6.pptx
MAD Unit 6.pptxMAD Unit 6.pptx
MAD Unit 6.pptx
34ShreyaChauhan
 
[Android] Maps, Geocoding and Location-Based Services
[Android] Maps, Geocoding and Location-Based Services[Android] Maps, Geocoding and Location-Based Services
[Android] Maps, Geocoding and Location-Based Services
Nikmesoft Ltd
 
Android location based services
Android location based servicesAndroid location based services
Android location based services
aswath babu
 
IEEE PROJECT TOPICS & ABSTRACTS BY SOFTRONIICS
IEEE PROJECT TOPICS & ABSTRACTS BY SOFTRONIICSIEEE PROJECT TOPICS & ABSTRACTS BY SOFTRONIICS
IEEE PROJECT TOPICS & ABSTRACTS BY SOFTRONIICS
aswin tbbc
 
Interview with Developer Jose Luis Arenas regarding Google App Engine & Geosp...
Interview with Developer Jose Luis Arenas regarding Google App Engine & Geosp...Interview with Developer Jose Luis Arenas regarding Google App Engine & Geosp...
Interview with Developer Jose Luis Arenas regarding Google App Engine & Geosp...
Rif Kiamil
 
The GPS Architecture on Android
The GPS Architecture on AndroidThe GPS Architecture on Android
The GPS Architecture on AndroidPing-Chin Huang
 
Location Based offers using Android Application
Location Based offers using Android ApplicationLocation Based offers using Android Application
Location Based offers using Android Application
IRJET Journal
 

Similar to Location-Based Services on Android (20)

Android App Development 04 : Location API
Android App Development 04 : Location APIAndroid App Development 04 : Location API
Android App Development 04 : Location API
 
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
 
Location based services
Location based servicesLocation based services
Location based services
 
Developing Windows Phone Apps with Maps and Location Services
Developing Windows Phone Apps with Maps and Location ServicesDeveloping Windows Phone Apps with Maps and Location Services
Developing Windows Phone Apps with Maps and Location Services
 
Android location and sensors API
Android location and sensors APIAndroid location and sensors API
Android location and sensors API
 
Philipp Nagele (Wikitude): What's Next with Wikitude
Philipp Nagele (Wikitude): What's Next with WikitudePhilipp Nagele (Wikitude): What's Next with Wikitude
Philipp Nagele (Wikitude): What's Next with Wikitude
 
Deep Dive into the ArcGIS Geotrigger Service - Esri DevSummit Dubai 2013
Deep Dive into the ArcGIS Geotrigger Service - Esri DevSummit Dubai 2013Deep Dive into the ArcGIS Geotrigger Service - Esri DevSummit Dubai 2013
Deep Dive into the ArcGIS Geotrigger Service - Esri DevSummit Dubai 2013
 
Mobile applications chapter 6
Mobile applications chapter 6Mobile applications chapter 6
Mobile applications chapter 6
 
Location-Based Marketing Application Development Made Easier with GeoSimulator
Location-Based Marketing Application Development Made Easier with GeoSimulatorLocation-Based Marketing Application Development Made Easier with GeoSimulator
Location-Based Marketing Application Development Made Easier with GeoSimulator
 
MyATM
MyATMMyATM
MyATM
 
How to use geolocation in react native apps
How to use geolocation in react native appsHow to use geolocation in react native apps
How to use geolocation in react native apps
 
[English] Create Mobile LBS Application Using Maps API
[English] Create Mobile LBS Application Using Maps API[English] Create Mobile LBS Application Using Maps API
[English] Create Mobile LBS Application Using Maps API
 
MAD Unit 6.pptx
MAD Unit 6.pptxMAD Unit 6.pptx
MAD Unit 6.pptx
 
[Android] Maps, Geocoding and Location-Based Services
[Android] Maps, Geocoding and Location-Based Services[Android] Maps, Geocoding and Location-Based Services
[Android] Maps, Geocoding and Location-Based Services
 
complete ppt
complete pptcomplete ppt
complete ppt
 
Android location based services
Android location based servicesAndroid location based services
Android location based services
 
IEEE PROJECT TOPICS & ABSTRACTS BY SOFTRONIICS
IEEE PROJECT TOPICS & ABSTRACTS BY SOFTRONIICSIEEE PROJECT TOPICS & ABSTRACTS BY SOFTRONIICS
IEEE PROJECT TOPICS & ABSTRACTS BY SOFTRONIICS
 
Interview with Developer Jose Luis Arenas regarding Google App Engine & Geosp...
Interview with Developer Jose Luis Arenas regarding Google App Engine & Geosp...Interview with Developer Jose Luis Arenas regarding Google App Engine & Geosp...
Interview with Developer Jose Luis Arenas regarding Google App Engine & Geosp...
 
The GPS Architecture on Android
The GPS Architecture on AndroidThe GPS Architecture on Android
The GPS Architecture on Android
 
Location Based offers using Android Application
Location Based offers using Android ApplicationLocation Based offers using Android Application
Location Based offers using Android Application
 

More from Jomar Tigcal

Android Design
Android DesignAndroid Design
Android Design
Jomar Tigcal
 
Android Apps Development
Android Apps DevelopmentAndroid Apps Development
Android Apps Development
Jomar Tigcal
 
GDG Philippines in 2012
GDG Philippines in 2012GDG Philippines in 2012
GDG Philippines in 2012
Jomar Tigcal
 
It's more fun in Android!
It's more fun in Android!It's more fun in Android!
It's more fun in Android!
Jomar Tigcal
 
Google+ and the Google+ Platform
Google+ and the Google+ PlatformGoogle+ and the Google+ Platform
Google+ and the Google+ Platform
Jomar Tigcal
 
Why go into Android Apps Development
Why go into Android Apps Development Why go into Android Apps Development
Why go into Android Apps Development
Jomar Tigcal
 
Introduction to Google Drive API
Introduction to Google Drive APIIntroduction to Google Drive API
Introduction to Google Drive API
Jomar Tigcal
 
Introduction to Google Chrome Extensions Development
Introduction to Google Chrome Extensions DevelopmentIntroduction to Google Chrome Extensions Development
Introduction to Google Chrome Extensions Development
Jomar Tigcal
 

More from Jomar Tigcal (8)

Android Design
Android DesignAndroid Design
Android Design
 
Android Apps Development
Android Apps DevelopmentAndroid Apps Development
Android Apps Development
 
GDG Philippines in 2012
GDG Philippines in 2012GDG Philippines in 2012
GDG Philippines in 2012
 
It's more fun in Android!
It's more fun in Android!It's more fun in Android!
It's more fun in Android!
 
Google+ and the Google+ Platform
Google+ and the Google+ PlatformGoogle+ and the Google+ Platform
Google+ and the Google+ Platform
 
Why go into Android Apps Development
Why go into Android Apps Development Why go into Android Apps Development
Why go into Android Apps Development
 
Introduction to Google Drive API
Introduction to Google Drive APIIntroduction to Google Drive API
Introduction to Google Drive API
 
Introduction to Google Chrome Extensions Development
Introduction to Google Chrome Extensions DevelopmentIntroduction to Google Chrome Extensions Development
Introduction to Google Chrome Extensions Development
 

Recently uploaded

FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
RTTS
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Product School
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Tobias Schneck
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 

Recently uploaded (20)

FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 

Location-Based Services on Android

  • 1. Location-Based Services on Android Jomar Tigcal GDG DevFest Bacolod 2012 November 5, 2012
  • 2. Jomar Tigcal ● Community Manager of GDG Philippines ● Mobile Apps Developer ● Software Engineer at Stratpoint Technologies, Inc. ● One of the developers of Moochfood http://jomar.tigcal.com jomar@tigcal.com @jomartigcal
  • 3. Moochfood Moochfood is an Android application that allows you to record, rate and share dining experiences. http://www.moochfood.com/
  • 5. Challenges ● Obtaining user location can consume a lot of battery ● Getting location takes some time ● Because the user location changes, you must account for movement by re-estimating user location every so often. ● Location estimates from each source may not be accurate.
  • 6. android.location Android provides a location framework that your application can use to determine the device's location and bearing and register for updates. http://developer.android. com/reference/android/locat ion/package-summary.html
  • 7. Android Permissions ● ACCESS_COARSE_LOCATION -> Network Provider: cell tower and Wi-Fi signals ● ACCESS_FINE_LOCATION -> GPS Provider
  • 8. Android Permissions Note: If you are using both NETWORK_PROVIDER and GPS_PROVIDER, then you need to request only the ACCESS_FINE_LOCATION permission, because it includes permission for both.
  • 9. Android Location API ● Location A class representing a geographic location sensed at a particular time. ● LocationManager This class provides access to the system location services. ● LocationListener Interface used for receiving notifications from the LocationManager when the location has changed.
  • 10. Getting User Location Image Source: http://evalblog.com/2011/06/06/where-am-i/
  • 11. Getting User Location ● Create an instance of LocationManager Location locationManager = (LocationManager) this.getSystemService (Context.LOCATION_SERVICE); ● Check Location Provider final boolean gpsEnabled = locationManager.isProviderEnabled (LocationManager.GPS_PROVIDER);
  • 12. Getting User Location ● Start listening for location updates locationManager.requestLocationUpdates (LocationManager.GPS_PROVIDER, 0, 0, locationListener); ● Stop listening for location updates locationManager.removeUpdates(this);
  • 17. Commonly used APIs Image Sources: http://developer.foursquare.com and http://thegreasywiener.com/
  • 18. Google Places API (https: //developers.google. com/places/)
  • 19. Google Places API ● Place Searches return a list of Places based on a user's location or search string. ● Place Details requests return more detailed information about a specific Place, including user reviews. ● Place Actions allow you to supplement the data in Google's Places Database with data from your application. You can schedule Events, add and remove Places, or weight Place rankings from user activity with Place Bumps.
  • 20. Google Places API ● Places Autocomplete can be used to provide autocomplete functionality for text-based geographic searches, by returning Places as you type. ● Query Autocomplete can be used to provide a query prediction service for text-based geographic searches, by returning suggested queries as you type.
  • 21. Getting API Key ● Go to Google APIs console (http://code. google.com/apis/console) ● Create an API Project ● Select Services ● Turn on Places API
  • 22. Places Search ● Nearby Search by location (latitude, longitude) ● Text Search by search query (e.g. "pizza in Bacolod")
  • 24. Nearby Search Required Parameters ● key API Key ● location latitude, longitude ● radius distance in meters, maximum of 50, 000 m ● sensor (true/false) if request came from location sensor (GPS)
  • 25. Nearby Search Optional Parameters keyword - content language - language code name - name rankby - prominence or distance *if rankby=distance, radius should not be included types pagetoken
  • 26. Place Search Types Separated by | Examples: food restaurant convenience_store hospital school grocery_or_supermarket More at: https://developers.google. com/places/documentation/supported_types
  • 27. Example ● Place Search: https://maps.googleapis. com/maps/api/place/nearbysearch/json? location=loc_here&sensor=true&radius=500&ke y=key_here ● Type=food https://maps.googleapis. com/maps/api/place/nearbysearch/json? location=loc_here&sensor=true&radius=500&typ es=food&key=key_here
  • 29. Foursquare API Core API: Check in, view their history, see where their friends are, create tips and lists, search for and learn more about venues, and access specials and recommendations. Real-time API: Venue push API notifies venue managers when users check in to their venues, and our user push API notifies developers when their users check in anywhere.
  • 30. Foursquare API Merchant Platform: Allows developers to write applications that help registered venue owners manage their foursquare presence and specials. Venues Platform: Search for places and access a wealth of information about them, including addresses, popularity, tips, and photos.
  • 31. Foursquare Venues Search Search Foursquare database and find information including tips, photos, check-in counts, and here now Syntax: https://api.foursquare.com/v2/venues/search
  • 32. Venues Search Parameters Required Parameters: ● ll (latitude, longitude) - user's location or ● near (text) - place where to search ● v (YYYYMMDD) indicates that the client is up to date as of the specified date
  • 33. Venues Search Parameters Optional Parameters: ● query - name of place to search ● limit - number of results (max is 50) ● radius - distance in meters (max is 10,000) ● categoryId - comma-separated categories to limit search
  • 36. Google Places API Challenge 2012 http://developers.google.com/places/challenge/ Deadline: November 30, 2012
  • 37. Foursquare Hack Day Philippines http://hackday.webgeek.ph/ December 1, 2012
  • 38. Resources ● http://developer.android. com/reference/android/location/package- summary.html ● http://developer.android. com/guide/topics/location/index.html ● https://developers.google.com/places/ ● https://developer.foursquare.com ● https://github.com/jomartigcal/lbs-android- sample
  • 39. Questions? Image Source: http://www.smoblog.com/
  • 40. Thank you very much!
  • 41. Location-Based Services on Android Jomar Tigcal GDG DevFest Bacolod 2012 November 5, 2012