The Garmin application sends commands such as "play/stop," "next song," "volume up," "volume down," and "add to library" to the phone and waits for a response. The phone sends information about the currently playing track back to the Garmin application. The Android app uses the Garmin Connect IQ SDK to communicate with the Garmin device and waits for commands from it. When a command is received, the app calls the appropriate function through the Spotify SDK to control Spotify.
https://github.com/krakentom/GarminSpotifyRemoteController
-
Download and install visual studio code https://code.visualstudio.com/
-
Install MonkeyC extension from Garmin (Extension ID: Garmin.monkey-c)
-
Register on Garmin, download and install Connect IQ SDK Manager https://developer.garmin.com/connect-iq/sdk/
-
Extract "connectiq-sdk-manager-windows.zip" and run "sdkmanager.exe" click on the "Login" button and continue with instalation.
-
Download SDK and Device for Garmin Edge 530
-
Open folder GarminSpotifyRemoteController\garmin\SpotifyEdge in visual studio code
-
Press CTRL + P and type "manifest.xml" end press "ENTER", it will open manifest.xml file. Locate the "App UUID" section and click on the "Regenerate" button. This will replace "TODO YOUR WATCH ID" with the new application id. Copy this ID for future use in the Android app.
-
Press CTRL + SHIFT + P and type "Monkey C: Generate a Developer Key"
-
Press CTRL + SHIFT + P and run the command Monkey C: Build for Device
-
Connect your garmin to computer using USB.
-
Copy SpotifyEdge.prg to GARMIN/APPS/ folder.
-
Disconnect your Garmin device from USB.
-
Download and install android studio https://developer.android.com/studio
-
Paste the "GARMIN_WATCH_ID" from the "manifest.xml" file in the garmin project app into the MyService.kt file in the Android project.
-
In android studio click on Gradle in right toolbar. On top menu select "Execute Gradle Task" and run "gradle signingreport". Copy SHA1 hash from console.
-
Register your android app on spotify developer https://developer.spotify.com/dashboard
-
In Spotify developer dashboard add new android package with package name "app.krakentom.garminspotifyremotecontroller" and package sha1 fingerprint from gradle console. Save changes.
-
Set Redirect URIs to http://localhost/
-
Copy the Client ID from the spotify developer (Basic Information) and paste it into the "SPOTIFY_CLIENT_ID" variable in the "MainActivity.kt" file.
-
Connect phone with USB to computer
-
Enable developer mode on the phone and enable usb debuging.
-
Run app from android studio on phone.