Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/jcmouse/public_html/app/code/include/model/database/db.class.php on line 18

Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/jcmouse/public_html/app/code/include/model/database/db.class.php on line 18

Deprecated: Function eregi_replace() is deprecated in /home/jcmouse/public_html/app/code/include/model/database/posts.php on line 322

Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/jcmouse/public_html/app/code/include/model/database/db.class.php on line 18

Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/jcmouse/public_html/app/code/include/model/database/db.class.php on line 18
mapas v2 android - Code Army!
HAZLO TU MISMO | Hace 11 años          

mapas v2 android


Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/jcmouse/public_html/app/code/include/model/database/db.class.php on line 18

aqui os dejo una pqueña app de android muy simple que en realidad son los mapas de la version 2 pero para los que lo querais compatible para android 2.2 tendreis que utilizar la lib v4.
aqui os lo dejo resuelto. aparte de hacer vuestra propia key de debug.

//el manifest.

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="es.fjal.shitmap"
android:versionCode="1"
android:versionName="1.0" >

<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="18" />

<permission
android:name="es.fjal.Shitmap.permission.MAPS_RECEIVE"
android:protectionLevel="signature" >
</permission>

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

<uses-feature
android:glEsVersion="0x00020000"
android:required="true" />

<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<uses-library android:name="com.google.android.maps" />

<activity
android:name="es.fjal.shitmap.MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />


</intent-filter>
</activity>

<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="AIzaSyDdCuQ77ov-K6S9pB3sOolmFoBs_3x8Bq4" />

<activity
android:name="es.fjal.shitmap.PrincipalActivity"
android:label="@string/title_activity_principal" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>

</manifest>

// el java

import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.GoogleMap.OnMapClickListener;
import com.google.android.gms.maps.SupportMapFragment;
import com.google.android.gms.maps.model.BitmapDescriptor;
import com.google.android.gms.maps.model.BitmapDescriptorFactory;
import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.MarkerOptions;

import android.os.Bundle;
import android.app.Activity;
import android.support.v4.app.FragmentActivity;
import android.view.Menu;

public class MainActivity extends FragmentActivity implements OnMapClickListener {


GoogleMap map;


@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.mapaly);

map = ((SupportMapFragment)getSupportFragmentManager().findFragmentById(R.id.map)).getMap();

map.setOnMapClickListener(this);



//creamos marcadores
MarkerOptions marker1=new MarkerOptions();


marker1.title("marca 1");
marker1.snippet("este marcador esta en sevilla");
marker1.anchor(0.5f, 0.5f);
LatLng posicion1= new LatLng(37.395801,-5.997505);
marker1.position(posicion1);

marker1.icon(BitmapDescriptorFactory.fromResource(R.drawable.punto));
map.addMarker(marker1);
}

@Override
public void onMapClick(LatLng loc) {
// TODO Auto-generated method stub

}

}

//xml

<?xml version="1.0" encoding="utf-8"?>

<fragment xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/map"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:name="com.google.android.gms.maps.SupportMapFragment" xmlns:tools="http://schemas.android.com/tools"/>

Tags
Fuentes de Información
  • El contenido del post es de mi autoría, y/o, es un recopilación de distintas fuentes.
Dar Puntos
Quitar Puntos
 
10 Puntos
score +10/-0
2452
Visitas
Enviar Email
Hazlo tu mismo
mapas v2 and
Hazlo tu mismo
Comentarios
perroconejo
Soldado
 
 Costa Rica
Pais
 
 51
Puntos
 
 1
Posts
 
 2
Preguntas
 
 0
Respuestas
 
 Hombre
Sexo
Avg Antiviru
Descargas
X

Se parte de Code Army!

Esta acción es solo para usuarios registrados