Skip to content

Android library for sending Harbor Beacons to the Harbor Service in Android-java apps

License

Notifications You must be signed in to change notification settings

HrbrIO/HarborAndroidBeacon

Repository files navigation

HarborAndroidBeacon

Android library for sending Harbor Beacons to the Harbor Service in Android-java apps:

Setup

This project uses/requires:

  • Android Studio
  • SDK Version API 23: Android 6.0 (Marshmallow)
  • Google Play Services
  • Maven/JitPack

If you haven't used Harbor before, welcome! You'll need to Sign up for a Harbor account first.

JitPack

  1. Install JitPack.

HarborAndroidBeacon

Running the Beacon Sample

To get started with the Quickstart application follow these steps:

  1. Open this HarborAndroidBeacon in Android Studio

  1. Copy your organization API Key from the API Keys page.

  1. Paste your organization API Key from the earlier step in the MyApplication.java.

  1. Copy your AppVersionID from the specific Applications page.

  1. Paste your AppVersionID in the MyApplication.java.

  1. Copy your Beacon Version ID from the specific Edit Beacon page for the Beacons for your Application.

  1. Paste your Beacon Version ID in the MyApplication.java.

  1. Run the Beacon Sample app on your Android device or simulator.

  1. Once you have your app running, you should beacons on the Developer View page for your Application.!

Beacon Messages

Message Type Message Data Description
APP_START_MSG N/A
APP_BG_MSG N/A
APP_FG_MSG N/A
APP_KILL_MSG N/A
HEARTBEAT N/A
SCREEN_VIEW { "screen" : screenName }
SCREEN_DWELL { "screen": screenName, "time" : timeIntervalSince1970 }
GEOLOCATION { "latitude" : latitude, "longitude" : longitude, "altitude" : altitudeMeters, "hz_accuracy" : horizontalAccuracyMeters, "vrt_accuracy" : verticalAccuracyMeters

Beacon Functions

  • mHarborLogger.appStart()
  • mHarborLogger.appBackground()
  • mHarborLogger.appForeground()
  • mHarborLogger.appKill()
  • mHarborLogger.startHeartbeat()
  • mHarborLogger.stopHeartbeat()
  • mHarborLogger.logLocation(location)
  • mHarborLogger.startScreenDwell(viewName)
  • mHarborLogger.stopScreenDwell(viewName)

License

This project is licensed under the Apache License, Version 2.0