I'm now starting to create my first app in android I've already created apps for other platforms, so I wanted to know how I put the google or bing map in my app.
I'm now starting to create my first app in android I've already created apps for other platforms, so I wanted to know how I put the google or bing map in my app.
After reading your question, I just went to Google and in less than 10 seconds I found this: link . Reads carefully that says everything there.
EDIT:
To be more precise and do not go "lost" the search I leave here the following code snippet available on the page that I suggested.
import com.google.android.gms.maps.*;
import com.google.android.gms.maps.model.*;
import android.app.Activity;
import android.os.Bundle;
public class MapPane extends Activity implements OnMapReadyCallback {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.map_activity);
MapFragment mapFragment = (MapFragment) getFragmentManager()
.findFragmentById(R.id.map);
mapFragment.getMapAsync(this);
}
@Override
public void onMapReady(GoogleMap map) {
LatLng sydney = new LatLng(-33.867, 151.206); /* AQUI A ALTITUDE E LONGITUDE */
map.setMyLocationEnabled(true);
map.moveCamera(CameraUpdateFactory.newLatLngZoom(sydney, 13));
map.addMarker(new MarkerOptions()
.title("Sydney") /* TITULO DA CIDADE */
.snippet("The most populous city in Australia.") /* LABEL OU SEJA, UMA PEQUENA DESCRIÇÃO */
.position(sydney));
}
}
Regards, thecreator
A quick way for you to start is to create a Google Maps Activity
Italreadygeneratesan.xmlforyoutoenterthemapskeyandalreadygivesyoualinkonhowtogeneratethiskey.
More information on Getting Started in Google Maps V2: link