Giving Mobile
Apps a Sense
of Place
Dave Johnson
Co-founder, Nitobi Software
Senior Developer, ForeSee Results
Overview

• IPhone
• Android
• BlackBerry
• PhoneGap
Setup
• IPhone SDK 2.2.1
• Android 1.5
• BlackBerry Eclipse JDE
• PhoneGap github.com/sintaxi/phonegap

• github.com/davej...
http://www.flickr.com/photos/dan_h/667441709/
190 million


• Smart phones (Gartner)
• 1.28 billion phones
Smartphone Market

                               4% 1%
                          6%
  IPhone             6%
  RIM
  Windo...
Geo Features

• Heading
• Geolocation (GPS, Wifi, Cell)
• Geocoding
• Mapping
Issues

              • Battery, battery, battery
              • Accuracy
              • Coverage


http://www.flickr.com...
http://www.flickr.com/photos/williamhook/2830319467/
IPhone
• IPhone OS 2.2.1
• IPhone OS 3.0 CENSORED

• Geolocation
• Map URI
• Simulator
CoreLocation


• Uses the available hardware to triangulate
  the user’s position based on nearby GPS,
  cell, or WiFi sig...
CoreLocation
• Add the framework to your project
• #import <CoreLocation/CoreLocation.h>

• CLLocation
• CLLocationManager...
CLLocation

• coordinate (CLLocationCoordinate2D)
• altitude (in feet x 3.28)
• verticalAccuracy
• horizontalAccuracy
• sp...
CLLocationManager

• CLLocationManager::distanceFilter
• CLLocationManager::desiredAccuracy
  •   best, nearestTenMeters, ...
Map URI

• Launch applications with special URIs

• UIApplication::openURL(NSURL)
• http://maps.google.com/maps?
  q=bar&l...
URL Querystring
•   q - The query parameter. Could be a KML file.
•   near - The location part of the query.
•   ll - Latit...
Simulator

• Good luck

• Only GPS location?
 • 1 Infinite Loop, Cupertino, CA, 95014
Simulator

• Good luck

• Only GPS location?
 • 1 Infinite Loop, Cupertino, CA, 95014
Summary

• Get lat/lng from GPS, Wifi or Cell towers
• Launch maps (query, points, directions)
• Simulator leaves much to b...
http://www.flickr.com/photos/kalebdf/2963107065/
Android

• Compass
• Geolocation
• Map Intent
• MapView
• Geocode
Compass

• SensorManager
• SensorEventListener interface

• SensorManager::registerListener()
• Sensor.TYPE_MAGNETIC_FIELD
GPS


• LocationManager
• LocationListener interface
GPS: LocationManager

• addProximityAlert
• getBestProvider(Criteria, enabledOnly)
• getLastKnownLocation
GPS: LocationListener

• onLocationChanged
• onProviderDisabled
• onProviderEnabled
• onStatusChanged
Map Intent

• “Intents” are how Android apps launch
  other apps
• Supports special GEO URI
 • geo:38.899533,-77.036476
Geocode


• getFromLocation
• getFromLocationName
MapView


• setBuiltInZoomControl()
• getController
MapController


• setCenter
• setZoom
Simulator

• Great
• DDMS Perspective in Eclipse
• Simulate single GPS location or provide a
  KML file
Summary
• Get direction/heading information
• Get lat/lng from GPS, Wifi or Cell towers
• Launch maps (query, points, direc...
http://www.flickr.com/photos/dushaun/3112631370/
RIM

• GPS
• JavaScript API
• Invoke Map
GPS


• LocationProvider
• LocationListener interface
Map Invoke


• Invoke.invokeApplication()
• Invoke.APP_TYPE_MAPS
JavaScript API

• window.BlackBerry.BlackBerryLocation
 • latitude
 • longitude
 • onLocationUpdate()
PhoneGap

• Write apps with HTML/JS/CSS, access
  native APIs, deploy to multiple platforms.
• Built at IPhoneDevCamp
• We...
• “The purpose of PhoneGap is for
  PhoneGap to not exist”
Standards
•   W3C
    •   http://dev.w3.org/geo/api/spec-source.html
    •   http://www.w3.org/TR/widgets-apis/
•   Firefo...
Geolocation


• navigator.geolocation.watchPosition()
• navigator.geolocation.getCurrentPosition()
Simulator
Thank You!

• dave@nitobi.com
• twitter.com/davejohnson
• nullisnotanobject.com
Where 2.0
Where 2.0
Where 2.0
Where 2.0
Where 2.0
Where 2.0
Upcoming SlideShare
Loading in …5
×

Where 2.0

1,931 views

Published on

Published in: Technology, News & Politics
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,931
On SlideShare
0
From Embeds
0
Number of Embeds
90
Actions
Shares
0
Downloads
43
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide
















































  • Where 2.0

    1. 1. Giving Mobile Apps a Sense of Place Dave Johnson Co-founder, Nitobi Software Senior Developer, ForeSee Results
    2. 2. Overview • IPhone • Android • BlackBerry • PhoneGap
    3. 3. Setup • IPhone SDK 2.2.1 • Android 1.5 • BlackBerry Eclipse JDE • PhoneGap github.com/sintaxi/phonegap • github.com/davejohnson/Where20Mobile
    4. 4. http://www.flickr.com/photos/dan_h/667441709/
    5. 5. 190 million • Smart phones (Gartner) • 1.28 billion phones
    6. 6. Smartphone Market 4% 1% 6% IPhone 6% RIM Windows Mobile Palm 11% Android Hiptop 50% Symbian 22% Source: AdMob March 2009 metrics
    7. 7. Geo Features • Heading • Geolocation (GPS, Wifi, Cell) • Geocoding • Mapping
    8. 8. Issues • Battery, battery, battery • Accuracy • Coverage http://www.flickr.com/photos/paky/50054831/
    9. 9. http://www.flickr.com/photos/williamhook/2830319467/
    10. 10. IPhone • IPhone OS 2.2.1 • IPhone OS 3.0 CENSORED • Geolocation • Map URI • Simulator
    11. 11. CoreLocation • Uses the available hardware to triangulate the user’s position based on nearby GPS, cell, or WiFi signal information
    12. 12. CoreLocation • Add the framework to your project • #import <CoreLocation/CoreLocation.h> • CLLocation • CLLocationManager • CLLocationManagerDelegate (protocol)
    13. 13. CLLocation • coordinate (CLLocationCoordinate2D) • altitude (in feet x 3.28) • verticalAccuracy • horizontalAccuracy • speed • course (degrees clockwise from north) • getDistanceFrom:(CLLocation *)location
    14. 14. CLLocationManager • CLLocationManager::distanceFilter • CLLocationManager::desiredAccuracy • best, nearestTenMeters, hundredMeters, kilometer, threeKilometers • Accuracy improves over time as it will return the first location ASAP
    15. 15. Map URI • Launch applications with special URIs • UIApplication::openURL(NSURL) • http://maps.google.com/maps? q=bar&ll=-33.874559,151.219575
    16. 16. URL Querystring • q - The query parameter. Could be a KML file. • near - The location part of the query. • ll - Latitude and longitude (decimal format, comma separated) for the map center point. • sll - The latitude and longitude points from which a business search should be performed. • spn - The approximate latitude and longitude span. • sspn - A custom latitude and longitude span format used by Google. • t - The type of map to display. • z - The zoom level. • saddr - The source address, which is used when generating driving directions • daddr - The destination address, which is used when generating driving directions. • latlng - A custom ID format that Google uses for identifying businesses. • cid - A custom ID format that Google uses for identifying businesses.
    17. 17. Simulator • Good luck • Only GPS location? • 1 Infinite Loop, Cupertino, CA, 95014
    18. 18. Simulator • Good luck • Only GPS location? • 1 Infinite Loop, Cupertino, CA, 95014
    19. 19. Summary • Get lat/lng from GPS, Wifi or Cell towers • Launch maps (query, points, directions) • Simulator leaves much to be desired
    20. 20. http://www.flickr.com/photos/kalebdf/2963107065/
    21. 21. Android • Compass • Geolocation • Map Intent • MapView • Geocode
    22. 22. Compass • SensorManager • SensorEventListener interface • SensorManager::registerListener() • Sensor.TYPE_MAGNETIC_FIELD
    23. 23. GPS • LocationManager • LocationListener interface
    24. 24. GPS: LocationManager • addProximityAlert • getBestProvider(Criteria, enabledOnly) • getLastKnownLocation
    25. 25. GPS: LocationListener • onLocationChanged • onProviderDisabled • onProviderEnabled • onStatusChanged
    26. 26. Map Intent • “Intents” are how Android apps launch other apps • Supports special GEO URI • geo:38.899533,-77.036476
    27. 27. Geocode • getFromLocation • getFromLocationName
    28. 28. MapView • setBuiltInZoomControl() • getController
    29. 29. MapController • setCenter • setZoom
    30. 30. Simulator • Great • DDMS Perspective in Eclipse • Simulate single GPS location or provide a KML file
    31. 31. Summary • Get direction/heading information • Get lat/lng from GPS, Wifi or Cell towers • Launch maps (query, points, directions) • Geocoding lat/lng to/from address • Embed maps through MapView • Simulator very extensive
    32. 32. http://www.flickr.com/photos/dushaun/3112631370/
    33. 33. RIM • GPS • JavaScript API • Invoke Map
    34. 34. GPS • LocationProvider • LocationListener interface
    35. 35. Map Invoke • Invoke.invokeApplication() • Invoke.APP_TYPE_MAPS
    36. 36. JavaScript API • window.BlackBerry.BlackBerryLocation • latitude • longitude • onLocationUpdate()
    37. 37. PhoneGap • Write apps with HTML/JS/CSS, access native APIs, deploy to multiple platforms. • Built at IPhoneDevCamp • Web2.0 LaunchPad winner • IPhone, Android, BlackBerry
    38. 38. • “The purpose of PhoneGap is for PhoneGap to not exist”
    39. 39. Standards • W3C • http://dev.w3.org/geo/api/spec-source.html • http://www.w3.org/TR/widgets-apis/ • Firefox 3.5 and Fennec • Android WebKit (Gears) • Opera X • Another popular version of WebKit • Internet Explorer Mobile (Gears) • RIM ... ummm forget about it
    40. 40. Geolocation • navigator.geolocation.watchPosition() • navigator.geolocation.getCurrentPosition()
    41. 41. Simulator
    42. 42. Thank You! • dave@nitobi.com • twitter.com/davejohnson • nullisnotanobject.com

    ×