liebus

5일차 본문

예전꺼(2014년이전꺼)/Android

5일차

리베스 2010. 9. 15. 14:44



27장   Android LBS (Location Based Service)

BroadcastReceiver   는    SystemCall  과 관련됨 을 기억...


28장   MapView

com.google.android.maps.package
com.google.android.maps.MapView

permission으로 쓸수 있는 tag  확인
맵사용시 주의 사항 AndoroidMainfest.xml 에 해당 permission을 추가 해준다.
예)
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.INTERNET" />
또한 google map을 사용하기에 해당 lib도 추가해 준다.
예)
<uses-library android:name="com.google.android.maps" />

라우팅정보   isRouteDisplayed()

MapView 에서 GPS값 보는 방법  -
Geocoder locations are stored in microdegrees (10-6). 
Geocoder gc = new Geocoder(this);
List<Address> coordinates = gc.getFromLocationName(“1860 East 18th Street Cleveland Ohio”,  3);
double  myLat  = coordinates(0).getLatitude() * 1000000;
double  myLon = coordinates(0).getLongitude() * 1000000;

GeoPoint p = new GeoPoint ( (int) myLat, (int) myLon );



구현시에는

MapView class로 맵을 표시 해주고 (android.maps....)
Geocoder class 로 GPS point 을 얻을수 있다. (android.location....)
GeoPoint class 와 MapController class로 해당 좌표로 지도를 이동 시킬수 있다.

내 위치 찾기는 MyLocationOverlay 를 이용하는 방법 과 LocationManager 를 사용하는 방법이 있다.

'예전꺼(2014년이전꺼) > Android' 카테고리의 다른 글

7일차  (0) 2010.09.15
6일차  (0) 2010.09.15
4일차  (0) 2010.09.15
3일차  (0) 2010.09.01
2일차  (0) 2010.08.31
Comments