Mình đang viết ứng dụng trên android nhưng không biết làm sao để lấy địa chỉ của bản thân.
http://www.joellipman.com/articles/google/android-o-s/app-development/733-basic-android-app-using-google-maps-and-current-location.html
Mình có tham khảo link trên nhưng lại không thể chạy được.
setUpMap của mình:
private void setUpMap() {
LatLng SaiGon = new LatLng(10.10, 106.22);
/*
//getMyLocation
mMap.setMyLocationEnabled(true);
LocationManager locationManager = (LocationManager)getSystemService(LOCATION_SERVICE);
Criteria criteria = new Criteria();
String provider = locationManager.getBestProvider(criteria,true);
Location myLocation = locationManager.getLastKnownLocation(provider);
LatLng curLoc = new LatLng(myLocation.getLatitude(),myLocation.getLongitude());*/
//curLoc.latitude = myLocation.getLatitude();
//curLoc.longitude = myLocation.getLongitude();
mMap.setMapType(1);
mMap.addMarker(new MarkerOptions().position(SaiGon).title("Hello SaiGon"));
mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(SaiGon, 10));
//Draw a circle
mMap.addCircle(new CircleOptions().center(SaiGon).radius(1000).fillColor(100));
}
p/s: Mình có thể lấy địa chỉ của các địa danh hay địa điểm được không?