# Android current location

add code to gradle file

{% embed url="https://gist.github.com/0d83957b1fe22f553f50496adbb3c852" %}
https://gist.github.com/0d83957b1fe22f553f50496adbb3c852
{% endembed %}

add permission in manifest

{% embed url="https://gist.github.com/af16059683dc5a801f299a4858991c3d" %}

create button for fetching location. create three textview which shows latitude,longitude,address

interface image

![](https://111087263-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-L_Lt0fyRsHcS_4ZagFx%2F-Luvz1r4_SSvtpK4QvSC%2F-Luw3YX5O0d9qyd8sU4g%2Fdesign.png?alt=media\&token=691a1963-b716-434d-87e8-6f04053494e3)

xml code

{% embed url="https://gist.github.com/d1d76a93b6abef680037b3122c6aad5e" %}

final code

{% embed url="https://gist.github.com/e85c6791b0f92b8a7ece2d226ee00590" %}

![](https://111087263-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-L_Lt0fyRsHcS_4ZagFx%2F-Luvz1r4_SSvtpK4QvSC%2F-LuwBIGl4maM0-bjOJJu%2Flocation.png?alt=media\&token=8fd1be86-ad6e-4e57-b787-e23ac8a25208)

output

{% embed url="https://github.com/jobinjj/Tutorial" %}

