The Birdy SDK is a comprehensive Android library designed to facilitate real-time and on-demand location tracking. Utilizing Android's Fused Location Provider, Birdy offers precise location updates efficiently, suitable for applications that depend on reliable location data.
- Real-Time Location Updates: Automatically capture and transmit location updates in real-time.
- On-Demand Location Access: Fetch the current location as needed with minimal setup.
- Effortless Integration: Integrate Birdy effortlessly into any Android project.
- Battery Optimization: Leverages battery-efficient APIs to extend device usage times without sacrificing accuracy.
- Customizable Settings: Adjustable settings to tailor location update intervals and accuracy to your needs.
- Android SDK 21 (Lollipop) or higher.
- Android Studio 2023.3.1 Jellyfish | RC 2 or higher recommended.
- Gradle 8.3.2 for building the project.
Add this line to your root build.gradle
at the end of repositories:
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
Add the following lines to your app's build.gradle
file:
dependencies {
implementation("com.github.LloydBlv:Birdy:V1.0.0")
implementation("com.google.android.gms:play-services-location:21.2.0")
}
import com.yourdomain.birdy.Birdy
// Initialize Birdy in your Application or Activity
Birdy.init(
context = this,
debugMode = true,
apiKey = "YOUR_API_KEY_HERE"
)
// To start location updates with specific parameters
val params = ObserveParams(
priority = Priority.BALANCED,
updateInterval = 60.seconds,
minUpdateInterval = 30.seconds,
stopAfter = 1.hours
)
Birdy.startLocationUpdates(params)
// To stop location updates
Birdy.stopLocationUpdates()
// To request the last known location
Birdy.requestSingleUpdate(OneshotRequest.LastKnownLocation(LastLocationParams()))
// To request a fresh location
Birdy.requestSingleUpdate(OneshotRequest.FreshLocation(LastLocationParams()))
Used to specify the conditions under which location updates should be observed.
priority
: The priority of the location request (e.g., high accuracy, balanced).updateInterval
: How often location updates should occur.minUpdateInterval
: The minimum interval between location updates to ensure battery efficiency.stopAfter
: Automatically stop updates after a certain duration.
A sealed interface for handling single location requests. It has two implementations:
LastKnownLocation
: Requests the last available location.FreshLocation
: Requests a new location fix.