0% found this document useful (0 votes)
31 views3 pages

PARA Saber Donde Esta El Debug - Keystore Windows Preferences Android Build

The document provides instructions for getting a Google Maps API key for an Android application. It explains that the debug keystore is required to get the API key and describes how to generate a project in Eclipse to create the debug keystore if it is missing. It then outlines the steps to add the correct permissions, library, MapView widget, and API key to the manifest and layout files. It also discusses how to import necessary packages, display controls on the map, center on coordinates, and get the user's location using the GPS.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
31 views3 pages

PARA Saber Donde Esta El Debug - Keystore Windows Preferences Android Build

The document provides instructions for getting a Google Maps API key for an Android application. It explains that the debug keystore is required to get the API key and describes how to generate a project in Eclipse to create the debug keystore if it is missing. It then outlines the steps to add the correct permissions, library, MapView widget, and API key to the manifest and layout files. It also discusses how to import necessary packages, display controls on the map, center on coordinates, and get the user's location using the GPS.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

PARA saber donde esta el debug.

keystore Windows>Preferences>Android>Build

TIPS IMPORTANTE SI EL DEBUG.KEYSTORE NO NOS APARECE:

* Windows Vista: C:\Users\<user>\.android\debug.keystore


* Windows XP: C:\Documents and Settings\<user>\.android\debug.keystore

If we dont have debug.keystore file we cant get Google Maps API Key. To solve this issue and
to get the debug.keystore file in the desired location is

1. Open Eclipse
2. Start a new Android project
3. Run the project in any AVD thats already created.

When the project is successfully RUN on the Android Virtual Device. Now go to your
.android folder and check. You will see that the debug.keystore is present there.

Ir al directorio bin del lugar en el cual esta instalado java:

C:\Program Files\Java\jdk1.7.0_02\bin>

keytool -list -alias androiddebugkey -keystore "C:/Users/Steve


Robinson/.android/debug.keystore" -storepass android -keypass android

http://code.google.com/android/maps-api-signup.html

Modificar el archivo manifest:

<uses-permission android:name="android.permission.INTERNET" />


<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

Antes de la etiqueta Activity agregar:

<uses-library android:name="com.google.android.maps" />


Agregar en el Layaout:

<com.google.android.maps.MapView
android:id="@+id/mapView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:enabled="true"
android:clickable="true"
android:apiKey="0KqtoP3aQpNqQbfHPi1xsBpVzYB9ZN4rB_6_u4A"
/>

Modificar la clase principal agregando los siguientes imports:

import com.google.android.maps.GeoPoint;
import com.google.android.maps.MapActivity;
import com.google.android.maps.MapController;
import com.google.android.maps.MapView;
import com.google.android.maps.Overlay;

Luego cambiar la clase para que implemente:

public class MagentamapActivity extends MapActivity {

y agregar el metodo que pide no esta implementado

Para mostrar los botones de zoom en el mapa usamos el siguiente cdigo:

mapView= (MapView) findViewById(R.id.mapView);


mapView.setBuiltInZoomControls(true);
mapView.getZoomButtonsController().setAutoDismissed(false);

Ubicando una determinada coordenada en el mapa>


Double lat = 13.731381;
Double lng = -89.115601;

GeoPoint point = new GeoPoint((int)(lat * 1E6), (int)(lng *1E6));

MapController controller = mapView.getController();


controller.animateTo(point);

Trabajando con un control Spinner

spnOpcion=(Spinner)findViewById(R.id.spinner1);
String[] opciones={"San Miguel", "Santa Ana","San Salvador"};
ArrayAdapter<String> adapter=new ArrayAdapter<String>(this,
android.R.layout.simple_spinner_item,opciones);
spnOpcion.setAdapter(adapter);

Para leer el elemento seleccionado en un spinner:

String txtopcion=spnOpcion.getSelectedItem().toString();
txtDisplay=(EditText)findViewById(R.id.editText2);
txtDisplay.setText(txtopcion);

para trabajar con el GPS

hay que agregar la clase MyLocationListener


luego en el principal tengo que agregar estos imports>

import android.location.*;
import android.content.*;

y luego al mtodo principal OnCreate agregar esto:

LocationManager locationManager = (LocationManager)


getSystemService(Context.LOCATION_SERVICE);
locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER,
0, 0,
new MyLocationListener(mapView.getController(), locationManager,
getBaseContext()));

Para Mandarle coordenadas al GPS lo haremos por TELNET asi:


TELNET LocalHost 5554

Luegos ejecutamos el comando


geo fix -58.433533 -34.615127

You might also like