Skip to content

asamm/locus-addon-wearables

Repository files navigation

Locus Map - add-on Wearables

Add-on for Locus Map (Android) application, focused on using most important features if Locus Map on Android Wear devices.

Add-on consists of these parts.

  • device module - middleman who communicate with Locus Map (over Locus API) on one side and add-on running on watches (over messages) on second side
  • wear module - separate application running on watches
  • and common where code shared/used by both device and wear is used.

Change log

See CHANGELOG.md

Important information

Available at: Wear for Locus Map at Google Play

Supports both Android Wear 1.x and 2.0. For Android Wear 2.0 the add-on must be installed separately on both the mobile phone and the watch.

Requires Google Play Services and Locus Map to work. Paired mobile phone required, standalone function not supported on the watch.

Setup project in Android Studio

  • clone current repository in created directory by
    • git clone https://github.com/asamm/locus-addon-wearables.git
  • open gradle project with Android Studio
  • setup global gradle properties, mainly debug keystore - please refer to Locus API, using global parameters.
  • run device and wear modules

Debugging

Device part

After importing the project, go to run configurations - launch options - launch - select "Nothing". Since device part has no UI, AS will not be able to run the project saying "Default Activity not found" until Launch: Nothing is selected

Wear

  • You can debug on both real device (over WiFi or BT) or using the Emulator paired with a phone. Follow the instructions here
  • When pairing emulator for debug with the phone follow these instructions
    • Mainly apart from enabling developer options and ADB debugging on both the phone and the emulated watch, you must also call adb -d forward tcp:5601 tcp:5601 from the computer console to properly forward adb commands. Call this once command before pairing the watch with the phone or before debugging.
    • Also in the Wear OS app on the phone there are no watches visible when connecting new watch. Tap menu icon in the top right and select "Pair with an emulator" option.

Release

Both modules needs to be generated and published separately.

device module generate over :device:assembleRelease gradle task. Generated APK may be found in the 'device\build\outputs\apk\release' directory.

wear module generate over :wear:assembleRelease gradle task. Generated APK may be found in the 'wear\build\outputs\apk\release' directory.