안드로이드 개발 질문/답변
(글 수 45,052)
이하와 같은 코드를 작성했습니다.
Geocoder goecoder = new Geocoder(getBaseContext());
List<Address> addresses = goecoder.getFromLocation(thisLocation.getLatitude(), thisLocation.getLongitude(), 1);
Address adr = goecoder.getFromLocation(thisLocation.getLatitude(),thisLocation.getLongitude(), 1).get(0);
Log.i("location",adr.getPostalCode());
adr 변수값을 디버깅해 보았는데... 이하와 같습니다.
우편번호를 못가져옵니다. ㅜ
혹시 어떤 부분이 잘못되었는지 ... 아무리 봐도 모르겠더라구요..
비슷한 어려움 겪으신 분 , 해결하신 분 계신가요?
Address[addressLines=[0:"대한민국 경기도 성남시 분당구 구미동 151"],feature=151,admin=경기도,sub-admin=null,locality=성남시,thoroughfare=구미동,
postalCode=null,countryCode=KR,countryName=대한민국,hasLatitude=true,latitude=37.3423051,hasLongitude=true,longitude=127.1085083,phone=null,url=null,extras=null]




http://maps.google.co.kr/maps/geo?q=37.3423051,127.1085083
위 요청을 url로 만들면 위와 같은데 browser로 확인해 보면 postalCode가 비어 있군요,
API 확인 결과, postalCode는 "제공 될 경우" 에만 쓰여질 수 있는 값입니다.
구글측에 위 좌표는 우편번호가 등록되어 있지 않은 걸로 판단되네요