Android Google Maps my location
사용 버전: Android Studio 4.0.1
사용 언어: Kotlin 1.4.10
내 위치를 나타내기 위해서는 사용자에게 위치 권한을 받아야 합니다.
Google Maps를 사용합니다.
사용 언어: Kotlin 1.4.10
안드로이드 Google Maps my location을 나타내 보겠습니다.
내 위치를 나타내기 위해서는 사용자에게 위치 권한을 받아야 합니다.
Google Maps를 사용합니다.
Activity Result APIs를 사용해서 위치 권한을 받겠습니다.
AndroidManifest.xml에 위치 권한을 넣습니다.
권한은 둘 중에 하나를 선택합니다.


Map이 있는 Fragment로 와서 myMap을 정의합니다.

locationPermission을 정의합니다.

myMap에 googleMap을 대입합니다.

callback에 Manifest.permission.ACCESS_FINE_LOCATION을 적습니다.

실행합니다.

거부 모습.

허용 모습.

파란 원이 현재 위치입니다.
끝.
댓글
댓글 쓰기
궁금한 점은 댓글 달아주세요.
Comment if you have any questions.