4. Flow for obtaining user location
Portions of this page are reproduced from work created and shared by the Android Open Source
Project and used according to terms described in theCreative Commons 2.5 Attribution License.
5. Real-time tracking
locationManager. isProviderEnabled(
LocationManager.GPS_PROVIDER )
locationManager.requestLocationUpdates(
LocationManager.GPS_PROVIDER,0,0,listener);
public void onLocationChanged(Location location) {
if(location.getAccuracy() < 100.0 && location.getSpeed() < 6.95){
//Do something
}
else{
//Continue listening for a more accurate location
}
}
6. Is a consumer smartphone
GPS good enough?
Accuracy
Rooftop <= 10 meters (desired result)
Street >10 meters and <= 100 meters (let user know
it’s close but not perfect. Good enough?)
Neighborhood > 100 meters and <= 500 meters
(give visual feedback that accuracy is low)
City > 500 meters and <= 2000 meters (ask user to
verify city name from a list)
County > 2000 meters (prompt for manual location
input)
12. Geotrigger Components
• Condition
(area) Polygon
• Action
(message, callback URL, or
change tracking profile)
• Tags
(to group content)
- Example:
- Tags
- Can
Wikipedia article data
for Buildings, History
allow users to subscribe to a subset
of the data
13. Setting a Geotrigger for a date and time
Set the date
and time in
the dateFrom
and dateTo
fields.
14. Geotrigger Tracking Profiles
Adaptive mode
• Optimized
for Geotrigger™ events
• Will
use less power when farther away from
triggers and content
Rough mode
• Only
gathers approximate location data
• Good
for determining if a device is in a given
city or neighborhood
• The
most battery efficient
15. Data collected by one person in rough mode
Portions of this page are reproduced from work created by Aaron Parecki
16. Geotrigger Tracking Profiles
Real-time mode
• Sends accurate location as fast as
possible
• Least battery efficient
Logging
• Tracks location data in areas of low
connectivity
• Sends to the server later, or when a
connection re-occurs
17. Data collected by one person in
real-time mode
2.5 million points since 2008
Portions of this page are reproduced from work created by Aaron Parecki
http://developer.android.com/guide/topics/location/strategies.html#BestEstimateStart application.Sometime later, start listening for updates from desired location providers.Maintain a "current best estimate" of location by filtering out new, but less accurate fixes.Stop listening for location updates.Take advantage of the last best location estimate.
http://stackoverflow.com/questions/843675/how-do-i-find-out-if-the-gps-of-an-android-device-is-enabledhttp://www.andygup.net/how-accurate-is-android-gps-part-2-consuming-real-time-locations/Start application using minTime = 0 and minDistance = 0. Use an aggressive setting to get accurate location as quickly as possible.Once accuracy is less than 50 meters and speed less than 45 mph set minTime = 5000 and minDistance = 25.Speed equals 0 for greater than 1 hour. Shut off location listeners and notify user.Battery gets low. Shut off location listeners and notify user.Rooftop <= 10 meters (desired result)Street >10 meters and <= 100 meters (let user know it’s close but not perfect. Good enough?)Neighborhood > 100 meters and <= 500 meters (give visual feedback that accuracy is low)City > 500 meters and <= 2000 meters (ask user to verify city name from a list)County > 2000 meters (prompt for manual location input)finalLocationManager manager = (LocationManager) getSystemService( Context.LOCATION_SERVICE ); if ( !manager.isProviderEnabled( LocationManager.GPS_PROVIDER ) ) { buildAlertMessageNoGps(); } private voidbuildAlertMessageNoGps() { finalAlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setMessage("Your GPS seemstobedisabled, do you want toenableit?") .setCancelable(false) .setPositiveButton("Yes", new DialogInterface.OnClickListener() { public voidonClick(@SuppressWarnings("unused") finalDialogInterfacedialog, @SuppressWarnings("unused") final int id) { startActivity(new Intent(android.provider.Settings.ACTION_LOCATION_SOURCE_SETTINGS)); } }) .setNegativeButton("No", new DialogInterface.OnClickListener() { public voidonClick(finalDialogInterfacedialog, @SuppressWarnings("unused") final int id) { dialog.cancel(); } }); finalAlertDialog alert = builder.create(); alert.show(); }
http://www.andygup.net/android-gps-testing-tool/
https://developers.arcgis.com/en/geotrigger-service/Triggers when entering or leaving.http://coolmaps.esri.com/starbucks/Use CasesRetail and LoyaltyEngage loyal customers with personalized content and deals the moment they enter your store.Real EstateSend messages to prospective home buyers when their search criteria matches a home nearby.Energy ManagementUse your location to automatically manage power consumption in your home or office.TourismBring public attractions to life by informing tourists of interesting locations as they explore your city.Public AlertsNotify citizens about events such as road closures or civic emergencies based on past locations.Personalized OffersSend customized, individual offers to potential customers as they pass by your establishment.Data CollectionGroup related content with tagsLocation Checkpoint VerificationCreate triggers to represent each location. App monitors the location and records a point whenever client is at the location
There’s great tech out there for dedicated GPS devices and real-time tech for devices running intensive GPS for short periods, In the ordinary world – everyone wants to be location-aware, but battery drain has been an issue. Consumer devices – the devices in your pockets vs. a dedicated GPS device. I thinkeveryone in this room has troublewith GPS being a totalbatteryhog. For on the go situations, we need a solution that prevents battery-drain while still providing location-based alerts and tracking. This is consumer-grade, ready for millions of devices. Holding back the market for consumer devices to get on using GPS.
Example of GeoJSON format. Can add date and time conditions.