EasyLocationFetch

Additional

Language
Java
Version
2.1.1 (Dec 3, 2020)
Created
Dec 3, 2020
Updated
Jan 24, 2024
Owner
Anirudh M Pai (anirudhmpai)
Contributors
Mend Renovate (renovate-bot)
Anirudh M Pai (anirudhmpai)
2
Activity
Badge
Generate
Download
Source code

Advertisement

EasyLocationFetch

Setup

Step 1. Add it in your root build.gradle at the end of repositories:

allprojects {
 repositories {
  ...
  maven { url 'https://jitpack.io' }
 }
}

Step 2. Add this to gradle

android {

    ...
    compileOptions {
 sourceCompatibility JavaVersion.VERSION_1_8
 targetCompatibility JavaVersion.VERSION_1_8
    }
}
dependencies {
        implementation 'com.github.anirudhmpai:EasyLocationFetch:2.1.1'
}

Implementation :

Method 1. this uses googles api alongside internal providers(works better in all scenarios)

GeoLocationModel geoLocationModel = new EasyLocationFetch(context,GoogleApiKey).getLocationData();

Method 2. uses builtin providers

GeoLocationModel geoLocationModel = new EasyLocationFetch(context).getLocationData();

Different data items you can call from above model

geoLocationModel.getAddress()
geoLocationModel.getCity()
geoLocationModel.getLattitude()
geoLocationModel.getLongitude()