Step 1. Add the JitPack repository to your build file
Add it in your root settings.gradle at the end of repositories:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
}
Add it in your settings.gradle.kts at the end of repositories:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url = uri("https://jitpack.io") }
}
}
Add to pom.xml
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
Add it in your build.sbt at the end of resolvers:
resolvers += "jitpack" at "https://jitpack.io"
Add it in your project.clj at the end of repositories:
:repositories [["jitpack" "https://jitpack.io"]]
Step 2. Add the dependency
dependencies {
implementation 'com.github.hypertrack:hypertrack-live-android:'
}
dependencies {
implementation("com.github.hypertrack:hypertrack-live-android:")
}
<dependency>
<groupId>com.github.hypertrack</groupId>
<artifactId>hypertrack-live-android</artifactId>
<version></version>
</dependency>
libraryDependencies += "com.github.hypertrack" % "hypertrack-live-android" % ""
:dependencies [[com.github.hypertrack/hypertrack-live-android ""]]
This open source app for Live Location Sharing is built with HyperTrack. Developers can now build live location sharing into their apps within minutes by using HyperTrack Live source code. For iOS, refer to our open source iOS repository.
HyperTrack Live for Android is available on the Google Play Store for use by users signed up with HyperTrack. HyperTrack Live for iOS is available on the public App Store.
👋 Read our blog post announcement to learn more about this sample app.
The app demonstrates a simple flow for users to share their live location with friends through their favorite messaging app when on the way to meet up. The convenient 23-character secure short-URL displays live location with accuracy, speed, bearing and recency. The view highlights the ongoing activity (walk, drive, stop, etc.). Device getting inactive due to permissions or other reasons, or disconnected due to unknown reasons is highlighted in the tracking experience. Battery charing and low battery states are flagged as well.
The primary feature of Hypertrack Live is Live Location Sharing. Live Location Sharing is useful for:
It helps solve the user's anxiety of “where are you⁉️”.
HyperTrack Live App uses HyperTrack Trips API to create and complete trips by using Live App Backend. Live App Backend allows to integrate with HyperTrack Trips API via backend server integration.
Once the trip is created in the HyperTrack Live App, the Live App calls Live App Backend which in turn creates a trip via Trips API. Once the trip is completed, the app notifies Live App Backend, which in turn calls HyperTrack Trips API to complete the trip.
$ git clone https://github.com/hypertrack/live-app-android.git
$ cd live-app-android
Goto <a href="https://console.firebase.google.com/">Firebase Console</a> and create test project (or you can reuse existing one)
<img src="https://github.com/hypertrack/quickstart-android/blob/master/Images/add-app-to-test-project.png?raw=true"/>Register new Android application using com.hypertrack.live
package name.
Download google-services.json
file and copy it to app/
folder.
Go through one-time registration flow in the app.
<img src="images/register-account.png"/>Verify your email and proceed to <a href="https://dashboard.hypertrack.com/setup#server_device_communication">setup page</a>. where you should fill FCM Key section in Android paragraph obtained from <i>Firebase Developer console > Project Settings (gear icon at top left) > Cloud Messaging tab.</i></p> <img src="https://github.com/hypertrack/quickstart-android/blob/master/Images/copy-server-key.png?raw=true"/>
For detailed documentation of the APIs, customizations and what all you can build using HyperTrack, please visit the official docs.
Feel free to clone, use, and contribute back via pull requests. We'd love to see your pull requests - send them in! Please use the issues tracker to raise bug reports and feature requests.
We are excited to see what Live Location feature you build in your app using this project. Do ping us at help@hypertrack.com once you build one, and we would love to feature your app on our blog!
Join our Slack community for instant responses. You can also email us at help@hypertrack.com.