Lecture Slides for Location based Services [Android]
Upcoming SlideShare
Loading in...5
×
 

Lecture Slides for Location based Services [Android]

on

  • 2,558 views

 

Statistics

Views

Total Views
2,558
Views on SlideShare
2,529
Embed Views
29

Actions

Likes
2
Downloads
129
Comments
0

2 Embeds 29

http://nehiljain.wordpress.com 18
http://nehil.e-caffeine.net 11

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Lecture Slides for Location based Services [Android] Presentation Transcript

  • 1. Accessing Location-Based services Software Development for Portable Devices BITS Pilani Goa Campus Sem I 2011-12
  • 2. Applications
    • Mapping
    • Directions
    • Dynamic chat Application
    • “ Geotag” your photos, tweets
    CS C314 Software Development For Portable Devices
  • 3. What's common in the above?
    • GPS capability of the phone
    • Technologies to identify your location
      • GPS
      • Cell tower triangulation
    CS C314 Software Development For Portable Devices
  • 4. Location based Services (LBS)
    • Two elements of LBS:
      • Location manager : provides hooks to lbs
      • Location providers : provide current location
    CS C314 Software Development For Portable Devices
  • 5. Update location in Emulator
    • In DDMS view, you can set the longitude and latitude 
    • Lets see how.
    CS C314 Software Development For Portable Devices
  • 6. Location manager
    • You can :
      • Find available location providers
      • Obtain your current location
      • Track movement
      • Set proximity alerts for detecting movement into and out of the specified areas
    CS C314 Software Development For Portable Devices
  • 7. Location Providers: They know where you are hiding
    • Selecting location provider
      • Explicitly – By specifying the name
      • Implicitly – By specifying the selection criteria
    CS C314 Software Development For Portable Devices
  • 8. Explicit CS C314 Software Development For Portable Devices
  • 9. User permissions CS C314 Software Development For Portable Devices
  • 10. Finding yourself
    • hasAltitude() and getAltitude() for Altitude
    • hasSpeed() and getSpeed() for Speed
    CS C314 Software Development For Portable Devices
  • 11. On the move
    • Why no getMyCurrentLocationNow() ?
    • Not all location providers are immediately responsive.
    • How to get changes in location reflected in your app?
    • Register for location updates!
    CS C314 Software Development For Portable Devices
  • 12. requestLocationUpdates ( String  provider, long minTime, float minDistance,  LocationListener  listener)
    • provider : name of location provider
    • minTime : how long, in milliseconds, before we might request for a location update
    • minDistance : how far,…. in meters
    • Listener : name of object of locationListener
    CS C314 Software Development For Portable Devices
  • 13. LocationListener CS C314 Software Development For Portable Devices These are the functions provided by the location Listeners
  • 14. STOP!
    • When not required use removeUpdates()
    • If you fail to do this your app will continue getting location updates even after all activities are closed.
    CS C314 Software Development For Portable Devices
  • 15. Are we there yet?
    • LocationManager offers addProximityAlert()
    • Registers a Pending intent
    • addProximityAlert (double latitude, double longitude, float radius, long expiration, PendingIntent intent)
    • In case the screen goes to sleep, checks for proximity alerts happen only once every 4 minutes.
    CS C314 Software Development For Portable Devices
  • 16. parameters
    • Radius: the radius of the central point of the alert region, in meters
    • Expiration: time for this proximity alert, in milliseconds, or -1 to indicate no expiration
    CS C314 Software Development For Portable Devices
  • 17. Thank You! CS C314 Software Development For Portable Devices
  • 18. References
    • Location http://developer.android.com/reference/android/location/Location.html
    • Location Manager http://developer.android.com/reference/android/location/LocationManager.html
    • Location Provider http://developer.android.com/reference/android/location/LocationProvider.html
    CS C314 Software Development For Portable Devices