• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Day 9: Make Your App Location Aware using Location API
 

Day 9: Make Your App Location Aware using Location API

on

  • 5,802 views

On Day 9: We'll see how to use Location API to get user location from application with both:

On Day 9: We'll see how to use Location API to get user location from application with both:
1. GPS
2. Network

Statistics

Views

Total Views
5,802
Views on SlideShare
1,205
Embed Views
4,597

Actions

Likes
1
Downloads
86
Comments
0

3 Embeds 4,597

http://droidtraining.wordpress.com 4542
http://droidtraining.wordpress.com. 50
http://webcache.googleusercontent.com 5

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

    Day 9: Make Your App Location Aware using Location API Day 9: Make Your App Location Aware using Location API Presentation Transcript

    • Android Application Development GPS Access Ahsanul Karim ahsanul.karim@sentinelbd.com Sentinel Solutions Ltd. http://www.sentinelbd.com
    • GPS Technology: Simplified• The Global Positioning System (GPS) is a satellite-based navigation system madeup of a network of 24 satellites placed into orbit by the U.S. Department of Defense.• GPS was originally intended for military applications, but in the 1980s, thegovernment made the system available for civilian use.• GPS works in any weather conditions, anywhere in the world, 24 hours a day.• There are no subscription fees or setup charges to use GPS.
    • GPS Technology: Simplified (Contd.) • Global Positioning System satellites transmit signals to equipment (receivers) on the ground. GPS receivers passively receive satellite signals; they do not transmit. • GPS receivers require an unobstructed view of the sky • Depend on a very accurate time reference, which is provided by atomic clocks at the U.S. Naval Observatory. Each GPS satellite has atomic clocks on board. • Each GPS satellite transmits data that indicates its location and the current time. • All GPS satellites synchronize operations so that these repeating signals are transmitted at the same instant. • The signals, moving at the speed of light, arrive at a GPS receiver at slightly different times because some satellites are farther away than others. • The distance to the GPS satellites can be determined by estimating the amount of time it takes for their signals to reach the receiver. • When the receiver estimates the distance to at least four GPS satellites, it can calculate its position in three dimensions. • There are at least 24 operational GPS satellites at all times. The satellites, operated by the U.S. Air Force, orbit with a period of 12 hours.
    • GPS Technology: Determining Position
    • GPS Access 1. Create a project Named “UseGps” 2. We need to add some permissions to use GPS and Internet
    • GPS Access 3. Now we need add a location listener, so each time the GPS senses a new location, this callback function will be called from the android system. To do this, we need to add the fallowing code in the onCreate() method:
    • GPS Access 4. We now have to create MyLocationListener class that implements LocationListener and Implement methods for various events: · onLocationChanged ( Location Update ) · onProviderDisabled ( GPS Off ) · onProviderEnabled (GPS On )
    • GPS Access
    • GPS Access 5. Now we run the app in emulator and use emulator control to emulate the GPS module
    • GPS Access 6. Now we’ll add a webview to main.xml layout and show the location in a map 7. Capture the webview by findViewById()
    • GPS Access 8. Now when the location is changed 9. Lets run it again
    • GPS Access