티스토리 뷰
참조 사이트 : https://console.developers.google.com/iam-admin/projects
|
|
mport android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import com.google.android.gms.maps.CameraUpdateFactory;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.OnMapReadyCallback;
import com.google.android.gms.maps.SupportMapFragment;
import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.MarkerOptions;
public class MapsActivity extends FragmentActivity implements OnMapReadyCallback {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_maps);
SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager()
.findFragmentById(R.id.map);
mapFragment.getMapAsync(this);
}
@Override
public void onMapReady(GoogleMap map) {
// Add a marker in Sydney, Australia, and move the camera.
LatLng sydney = new LatLng(-34, 151);
map.addMarker(new MarkerOptions().position(sydney).title("Marker in Sydney"));
map.moveCamera(CameraUpdateFactory.newLatLng(sydney));
}
}
App build.gradle 추가
|
|
|
|
|
|
|
'ANDROID > android' 카테고리의 다른 글
Android - back 버튼 활용 (0) | 2016.11.28 |
---|---|
Android - RXAndroid Retrofit (0) | 2016.11.14 |
Android - Code Obfuscation (난독화) / Decompile (0) | 2016.11.02 |
Android - Motion Sensors (0) | 2016.11.01 |
android FireBase 사용하기 (0) | 2016.10.28 |
Comments