Geolocalización v2
Upcoming SlideShare
Loading in...5
×
 

Like this? Share it with your network

Share

Geolocalización v2

on

  • 354 views

 

Statistics

Views

Total Views
354
Views on SlideShare
354
Embed Views
0

Actions

Likes
0
Downloads
0
Comments
0

0 Embeds 0

No embeds

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

Geolocalización v2 Presentation Transcript

  • 1. Jimmy Atocza Ledesma
  • 2.  GPS Google Services Location
  • 3.  Permisos ◦ En el archivo MANIFEST  Permiso para acceder a internet. <uses-permission android:name=”android.permission.INTERNET” />  Permiso para obtener la información de la ubicación por GPS o por el proveedor de red. <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
  • 4.  Libreria de Mapas ◦ Utilización de las librería de mapas. ◦ En el archivo MANIFEST <uses-library android:name="com.google.android.maps" />
  • 5.  Código ◦ En la Clase de la Actividad Principal se tiene que heredar de la clase MapActivity y se implementa la interface LocationListener. public class Main extends MapActivity implements LocationListener
  • 6.  Código ◦ Al heredar de MapActivity se tiene que implementar el método:  boolean isRouteDisplayed(); ◦ Al implementar LocationListener se tienen que escribir los siguientes métodos:  onLocationChanged(Location location);  onProviderDisabled(String provider);  onStatusChanged(String provider, int status, Bundle extras);  onProviderEnabled(String provider)
  • 7.  CódigoLocationManager locationManager = (LocationManager) this.getSystemService(Context.LOCATION_SERVICE);LocationListener locationListener = new LocationListener() { public void onLocationChanged(Location location) { makeUseOfNewLocation(location); } public void onStatusChanged(String provider, int status, Bundle extras) {} public void onProviderEnabled(String provider) {} public void onProviderDisabled(String provider) {} };locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 0, 0, locatio nListener);
  • 8.  Mas Información ◦ Diseño  http://espanol.free-ebooks.net/ebook/Curso-Android/html/67#read ◦ Mapview y MapActivity  http://android-coding.blogspot.com/2011/06/mapview-and-mapactivity.html