コード例 #1
0
  public void sendDataToWatch() {
    // Build up a Pebble dictionary
    PebbleDictionary data = new PebbleDictionary();

    data.addUint8(0, (byte) tresholdLevel);

    // Send the assembled dictionary to the weather watch-app;
    PebbleKit.sendDataToPebble(
        getApplicationContext(), UUID.fromString("5ed10362-a625-41e6-b35c-e6b10feb71e6"), data);
  }
コード例 #2
0
  public void sendWeatherDataToWatch(int weatherIconId, String temp) {
    // Build up a Pebble dictionary containing the weather icon and the current temperature in
    // degrees fahrenheit
    PebbleDictionary data = new PebbleDictionary();
    data.addUint8(ICON_KEY, (byte) weatherIconId);
    data.addString(TEMP_KEY, temp);

    // Send the assembled dictionary to the weather watch-app; this is a no-op if the app isn't
    // running or is not
    // installed
    PebbleKit.sendDataToPebble(caller.getApplicationContext(), WEATHER_UUID, data);
  }