Project Name | Stars | Downloads | Repos Using This | Packages Using This | Most Recent Commit | Total Releases | Latest Release | Open Issues | License | Language |
---|---|---|---|---|---|---|---|---|---|---|
Android Reactivelocation | 2,117 | 117 | 1 | 3 years ago | 11 | September 29, 2017 | 32 | Java | ||
Small library that wraps Google Play Service API in brilliant RxJava Observables reducing boilerplate to minimum. | ||||||||||
Geo Heatmap | 1,919 | 9 months ago | 11 | mit | Python | |||||
:world_map: Generate an interactive geo heatmap from your Google location data | ||||||||||
React Native Google Places Autocomplete | 1,832 | 272 | 32 | 10 days ago | 76 | August 11, 2021 | 119 | mit | JavaScript | |
Customizable Google Places autocomplete component for iOS and Android React-Native apps | ||||||||||
React Native Maps Directions | 1,057 | 109 | 5 | 9 months ago | 18 | April 14, 2020 | 45 | mit | JavaScript | |
Directions Component for `react-native-maps` | ||||||||||
Google Directions Android | 963 | 186 | 2 years ago | 7 | January 17, 2016 | 20 | mit | Java | ||
This project allows you to calculate the route between two locations and displays it on a map. | ||||||||||
Pokemon Go Node Api | 886 | 48 | 10 | 4 years ago | 15 | August 10, 2016 | 51 | mit | JavaScript | |
Pokemon GO api node.js library | ||||||||||
Leku | 728 | 14 days ago | 6 | March 15, 2022 | 36 | apache-2.0 | Kotlin | |||
:earth_africa: Map location picker component for Android. Based on Google Maps. An alternative to Google Place Picker. | ||||||||||
Location History Visualizer | 647 | 3 years ago | 5 | JavaScript | ||||||
Visualize your Google Location History using an interactive heatmap | ||||||||||
Googleapi | 478 | 12 | 11 | 3 days ago | 136 | September 27, 2022 | 2 | mit | C# | |
C# .NET Core Google Api (Maps, Places, Roads, Search, Translate). Supports all endpoints and requests / responses. | ||||||||||
Actingweb_firstapp | 392 | 15 days ago | 4 | other | Dart | |||||
Starter app for Flutter that includes many different production app features; some not typically included in demo apps. |
Getting location updates requires lots of bolierplate code in Android, You need to take care of
Android-EasyLocation does all this stuff in background, so that you can concentrate on your business logic than handling all above
In your build.gradle
:
com.google.android.gms:play-services-location dependency also needs to be added like this
x.x.x can be replaced with google play service version your app is using versions information available here
dependencies {
compile 'com.akhgupta:android-easylocation:1.0.1'
compile "com.google.android.gms:play-services-location:x.x.x"
}
Extend your Activity
from EasyLocationAppCompatActivity
or EasyLocationActivity
:
Create location request according to your needs
LocationRequest locationRequest = new LocationRequest()
.setPriority(LocationRequest.PRIORITY_BALANCED_POWER_ACCURACY)
.setInterval(5000)
.setFastestInterval(5000);
Create EasyLocation request, and set locationRequest created
EasyLocationRequest easyLocationRequest = new EasyLocationRequestBuilder()
.setLocationRequest(locationRequest)
.setFallBackToLastLocationTime(3000)
.build();
}
Request Single location update like this
requestSingleLocationFix(easyLocationRequest);
Or Request Multiple location updates like this
requestLocationUpdates(easyLocationRequest);
You're good to go!, You will get below callbacks now in your activity
@Override
public void onLocationPermissionGranted() {
}
@Override
public void onLocationPermissionDenied() {
}
@Override
public void onLocationReceived(Location location) {
}
@Override
public void onLocationProviderEnabled() {
}
@Override
public void onLocationProviderDisabled() {
}
Additional Options
Specify what messages you want to show to user using EasyLocationRequestBuilder
EasyLocationRequest easyLocationRequest = new EasyLocationRequestBuilder()
.setLocationRequest(locationRequest)
.setLocationPermissionDialogTitle(getString(R.string.location_permission_dialog_title))
.setLocationPermissionDialogMessage(getString(R.string.location_permission_dialog_message))
.setLocationPermissionDialogNegativeButtonText(getString(R.string.not_now))
.setLocationPermissionDialogPositiveButtonText(getString(R.string.yes))
.setLocationSettingsDialogTitle(getString(R.string.location_services_off))
.setLocationSettingsDialogMessage(getString(R.string.open_location_settings))
.setLocationSettingsDialogNegativeButtonText(getString(R.string.not_now))
.setLocationSettingsDialogPositiveButtonText(getString(R.string.yes))
.build();
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.