This is a B4A wrapper for the official Pebble Android SDK. It is using the SDK from November 2014 (pebblekit-2.6.0-eclipse.jar). Read the SDK documentation.
The PebbleKit object has several events which correspond to the SDK they are;
Sub PK_Connected
Sub PK_Disconnected
Sub PK_ReceiveAck
Sub PK_ReceiveData
Sub PK_ReceiveLogData1
Sub PK_ReceiveLogData2
Sub PK_ReceiveLogData3
Sub PK_ReceiveNack
Pebble
Comment: B4A Library for Pebble Android SDK.
On Android, all communication between apps and Pebble go through the official Pebble Android application via intents.
PebbleKit Android provides a convenience layer on top of those intents.
You must install the official Pebble Android application to use PebbleKit Android.
PebbleKit Android requires Android SDK version 14 or higher (4.0 and above).
Author: Trevor Hart
Version: 1
The PebbleKit object has several events which correspond to the SDK they are;
Sub PK_Connected
Sub PK_Disconnected
Sub PK_ReceiveAck
Sub PK_ReceiveData
Sub PK_ReceiveLogData1
Sub PK_ReceiveLogData2
Sub PK_ReceiveLogData3
Sub PK_ReceiveNack
Pebble
Comment: B4A Library for Pebble Android SDK.
On Android, all communication between apps and Pebble go through the official Pebble Android application via intents.
PebbleKit Android provides a convenience layer on top of those intents.
You must install the official Pebble Android application to use PebbleKit Android.
PebbleKit Android requires Android SDK version 14 or higher (4.0 and above).
Author: Trevor Hart
Version: 1
- PebbleAppType
Fields:- GOLF As Int
- OTHER As Int
- SPORTS As Int
- PebbleConstants
Fields:- APP_UUID As String
The bundle-key used to store a message's UUID. - CUST_APP_TYPE As String
The bundle-key used to store the type of application being customized in a CUSTOMIZE intent. - CUST_ICON As String
The bundle-key used to store the custom icon provided in a CUSTOMIZE intent. - CUST_NAME As String
The bundle-key used to store the custom name provided in a CUSTOMIZE intent. - DATA_LOG_TAG As String
A bundle-key used to store the tag for the corresponding data log. - DATA_LOG_TIMESTAMP As String
The bundle-key used to store the timestamp of when a data log was first created. - DATA_LOG_UUID As String
A bundle-key used to store the UUID that uniquely identifies a data log. - GOLF_BACK_KEY As Int
The Constant GOLF_BACK_KEY. - GOLF_CMD_KEY As Int
The Constant GOLF_CMD_KEY. - GOLF_CMD_NEXT As Int
Command sent by the golf-application to display the previous hole. - GOLF_CMD_PREV As Int
Command sent by the golf-application to display the next hole. - GOLF_FRONT_KEY As Int
The Constant GOLF_FRONT_KEY. - GOLF_HOLE_KEY As Int
The Constant GOLF_HOLE_KEY. - GOLF_MID_KEY As Int
The Constant GOLF_MID_KEY. - GOLF_PAR_KEY As Int
The Constant GOLF_PAR_KEY. - GOLF_UUID As UUID
The UUID corresponding to Pebble's built-in "Golf" application. - INTENT_APP_ACK As String
Intent broadcast to pebble.apk to indicate that a message was received from the watch. To avoid protocol timeouts
on the watch, applications <em>must</em> ACK or NACK all received messages. - INTENT_APP_CUSTOMIZE As String
Intent broadcast to pebble.apk responsible for customizing the name and icon of the 'stock' Sports and Golf
applications included in the watch's firmware. - INTENT_APP_NACK As String
Intent broadcast to pebble.apk to indicate that a message was unsuccessfully received from the watch. - INTENT_APP_RECEIVE As String
Intent broadcast from pebble.apk containing one-or-more key-value pairs sent from the watch to the phone. - INTENT_APP_RECEIVE_ACK As String
Intent broadcast from pebble.apk indicating that a sent message was successfully received by a watch app. - INTENT_APP_RECEIVE_NACK As String
Intent broadcast from pebble.apk indicating that a sent message was not received by a watch app. - INTENT_APP_SEND As String
Intent broadcast to pebble.apk containing one-or-more key-value pairs to be sent to the watch from the phone. - INTENT_APP_START As String
Intent broadcast to pebble.apk responsible for launching a watch-app on the connected watch. This intent is
idempotent. - INTENT_APP_STOP As String
Intent broadcast to pebble.apk responsible for closing a running watch-app on the connected watch. This intent is
idempotent. - INTENT_DL_ACK_DATA As String
Intent broadcast to pebble.apk implicitly when a unit of data from a data log is received. - INTENT_DL_FINISH_SESSION As String
Intent broadcast from pebble.apk indicating the session has finished. - INTENT_DL_RECEIVE_DATA As String
Intent broadcast from pebble.apk containing a unit of data from a data log. - INTENT_DL_REQUEST_DATA As String
Intent broadcast to pebble.apk to request data logs for a particular app. - INTENT_PEBBLE_CONNECTED As String
Intent broadcast by pebble.apk when a new connection to a Pebble is established. - INTENT_PEBBLE_DISCONNECTED As String
Intent broadcast by pebble.apk when the connection to a Pebble is closed or lost. - KIT_STATE_COLUMN_APPMSG_SUPPORT As Int
- KIT_STATE_COLUMN_CONNECTED As Int
- KIT_STATE_COLUMN_DATALOGGING_SUPPORT As Int
- KIT_STATE_COLUMN_VERSION_MAJOR As Int
- KIT_STATE_COLUMN_VERSION_MINOR As Int
- KIT_STATE_COLUMN_VERSION_POINT As Int
- KIT_STATE_COLUMN_VERSION_TAG As Int
- MSG_DATA As String
The bundle-key used to store a message's JSON payload send-to or received-from the watch. - PBL_DATA_ID As String
A bundle-key used to store the ID of a unit of data in a data log. - PBL_DATA_OBJECT As String
A bundle-key used to store the value of the data unit. - PBL_DATA_TYPE As String
A bundle-key used to store the data type of the data unit. - SPORTS_DATA_KEY As Int
The PebbleDictionary key corresponding to the 'data' field sent to the Sports watch-app. The data field is paired
with a variable label and can be used to display any data. - SPORTS_DATA_PACE As Int
PebbleDictionary value corresponding to 'pace' data. - SPORTS_DATA_SPEED As Int
PebbleDictionary value corresponding to 'speed' data. - SPORTS_DISTANCE_KEY As Int
The PebbleDictionary key corresponding to the 'distance' field sent to the Sports watch-app. - SPORTS_LABEL_KEY As Int
The PebbleDictionary key corresponding to the 'label' field sent to the Sports watch-app. The label field
controls the label above the 'data' field. - SPORTS_STATE_END As Int
The Constant SPORTS_STATE_END. - SPORTS_STATE_INIT As Int
The Constant SPORTS_STATE_INIT. - SPORTS_STATE_KEY As Int
The PebbleDictionary key corresponding to the 'state' field sent to the Sports watch-app. Both the watch and
phone-app may modify this field. The phone-application is responsible for performing any required state
transitions to stay in sync with the watch-app's state. - SPORTS_STATE_PAUSED As Int
The Constant SPORTS_STATE_PAUSED. - SPORTS_STATE_RUNNING As Int
The Constant SPORTS_STATE_RUNNING. - SPORTS_TIME_KEY As Int
The PebbleDictionary key corresponding to the 'time' field sent to the Sports watch-app. - SPORTS_UNITS_IMPERIAL As Int
PebbleDictionary value corresponding to 'imperial' units. - SPORTS_UNITS_KEY As Int
The PebbleDictionary key corresponding to the 'units' field sent to the Sports watch-app. - SPORTS_UNITS_METRIC As Int
PebbleDictionary value corresponding to 'metric' units. - SPORTS_UUID As UUID
The UUID corresponding to Pebble's built-in "Sports" application. - TRANSACTION_ID As String
The bundle-key used to store a message's transaction id.
- APP_UUID As String
- PebbleDataType
Fields:- BYTES As Int
- INT As Int
- INVALID As Int
- UINT As Int
- PebbleDictionary
Methods:- Initialize
- IsInitialized As Boolean
- addBytes (key As Int, bytes() As Byte)
- addInt16 (key As Int, s As Short)
- addInt32 (key As Int, i As Int)
- addInt8 (key As Int, b As Byte)
- addString (key As Int, value As String)
- addUint16 (key As Int, s As Short)
- addUint32 (key As Int, i As Int)
- addUint8 (key As Int, b As Byte)
- contains (key As Int) As Boolean
- fromJson (jsonString As String) As Boolean
- getBytes (key As Int) As Byte[]
- getInteger (key As Int) As Long
- getString (key As Int) As String
- getUnsignedIntegerAsLong (key As Int) As Long
- remove (key As Int)
- size As Int
- toJsonString As String
- PebbleFirmwareVersionInfo
Methods:- IsInitialized As Boolean
- Major As Int [read only]
- Minor As Int [read only]
- Point As Int [read only]
- Tag As String [read only]
- PebbleKit
- Methods:
- Deinitialize
Initializes the PebbleKit and creates the listener from the event name. - Initialize (EventName As String, subscribedUuid As String)
Initializes the PebbleKit and creates the listener from the event name. - IsInitialized As Boolean
- areAppMessagesSupported As Boolean
Synchronously query the Pebble application to see if the connected watch is running a firmware version that supports PebbleKit messages. - closeAppOnPebble (watchappUuid As String)
Send a message to the connected Pebble to close an application identified by a UUID. - customizeWatchApp (appType As PebbleAppType, name As String, icon As Bitmap)
Send a message to the connected Pebble to "customize" a built-in PebbleKit watch-app. - isDataLoggingSupported As Boolean
Synchronously query the Pebble application to see if the connected watch is running a firmware version that supports PebbleKit data logging. - isWatchConnected As Boolean
Synchronously query the Pebble application to see if an active Bluetooth connection to a watch currently exists. - requestDataLogsForApp (watchappUuid As String)
A convenience function to emit an intent to pebble.apk to request the data logs for a particular app. - sendAckToPebble (transactionId As Int)
Send a message to the connected watch acknowledging the receipt of a PebbleDictionary. - sendDataToPebble (watchappUuid As String, data As PebbleDictionary)
Send one-or-more key-value pairs to the watch-app identified by the provided UUID. - sendNackToPebble (transactionId As Int)
Send a message to the connected watch that the previously sent PebbleDictionary was not received successfully. - startAppOnPebble (watchappUuid As String)
Send a message to the connected Pebble to launch an application identified by a UUID.
- android.permission.ACCESS_WIFI_STATE
- android.permission.INTERNET
- WatchFWVersion As FirmwareVersionInfo [read only]
Get the version information of the firmware running on a connected watch.
- Deinitialize