24. iOS and Android SDKs
https://github.com/pebble/pebble-ios-sdk/
CocoaPods and Carthage supported
https://github.com/pebble/pebble-android-sdk/
Gradle, Maven and jar available
32. Customizations
● Add resources to appinfo.json, in array media
● Use GFont for TextLayer custom fonts
● Use GBitmap for BitmapLayer
● Use create_with_resource for loading resources
● Use _destroy functions to free resources
33. Limitations
● Number of resources - 256
● Max resource size - 128kB (Aplite), 256kB (Basalt and Chalk)
40. Storage API
Limited to 4KB
persist_write_data(key, &data, sizeof(Data));
persist_read_data(key, &data, sizeof(Data));
Alternative - localStorage API in PebbleKit JS. But it’s not battery efficient
And depends on connection between Watch and Phone
43. PebbleKit JS
● Access to extended storage with localStorage.
● Internet access using XMLHttpRequest.
● Location data using geolocation.
● The ability to show a configuration page to allow users to customize how the
app behaves.
44. AppMessage API
Bi-directional communication between phone apps and Pebble watchapps.
ACKnowledged or "NACK'ed,"
app_message_open()
APP_MESSAGE_INBOX_SIZE_MINIMUM and
APP_MESSAGE_OUTBOX_SIZE_MINIMUM
app_message_inbox_size_maximum() and
app_message_outbox_size_maximum()
46. PebbleKit Android
dependencies { compile 'com.getpebble:pebblekit:3.0.0' }
PebbleDictionary dict = new PebbleDictionary();
dict.addString(AppKeyContactName, contactName);
final UUID appUuid =
UUID.fromString("EC7EE5C6-8DDF-4089-AA84-C3396A11CC95");
// Send the dictionary
PebbleKit.sendDataToPebble(getApplicationContext(), appUuid, dict);
47. PebbleKit Android
Messages will be received on Pebble Watch in:
AppMessageInboxReceived
PebbleKit.registerReceivedDataHandler(getApplicationContext(), dataReceiver);
48. PebbleKit Android
// Create a new receiver to get AppMessages from the C app
PebbleDataReceiver dataReceiver = new PebbleDataReceiver(appUuid) {
@Override
public void receiveData(Context context, int transaction_id,
PebbleDictionary dict) {
// A new AppMessage was received, tell Pebble
PebbleKit.sendAckToPebble(context, transaction_id);
}
};
49. PebbleKit Android
@Override
public void receiveData(Context context, int transaction_id,
PebbleDictionary dict) {
final int AppKeyAge = 1;
// If the tuple is present...
Long ageValue = dict.getInteger(AppKeyAge);
if(ageValue != null) {
// Read the integer value