本文整理汇总了Java中com.getpebble.android.kit.util.PebbleDictionary.size方法的典型用法代码示例。如果您正苦于以下问题:Java PebbleDictionary.size方法的具体用法?Java PebbleDictionary.size怎么用?Java PebbleDictionary.size使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.getpebble.android.kit.util.PebbleDictionary
的用法示例。
在下文中一共展示了PebbleDictionary.size方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: receiveData
import com.getpebble.android.kit.util.PebbleDictionary; //导入方法依赖的package包/类
@Override
public void receiveData(int transactionId, PebbleDictionary data) {
Log.d(TAG, "receiveData: transactionId is " + String.valueOf(transactionId));
lastTransactionId = transactionId;
Log.d(TAG, "Received Query. data: " + data.size() + ".");
if (data.size() > 0) {
pebble_sync_value = data.getUnsignedIntegerAsLong(SYNC_KEY);
pebble_platform = data.getUnsignedIntegerAsLong(PLATFORM_KEY);
pebble_app_version = data.getString(VERSION_KEY);
Log.d(TAG, "receiveData: pebble_sync_value=" + pebble_sync_value + ", pebble_platform=" + pebble_platform + ", pebble_app_version=" + pebble_app_version);
} else {
Log.d(TAG, "receiveData: pebble_app_version not known");
}
PebbleKit.sendAckToPebble(context, transactionId);
transactionFailed = false;
transactionOk = false;
messageInTransit = false;
sendStep = 5;
sendData();
}
示例2: evaluateDataFromPebble
import com.getpebble.android.kit.util.PebbleDictionary; //导入方法依赖的package包/类
private void evaluateDataFromPebble(PebbleDictionary data) {
if (data.size() > 0) {
pebble_sync_value = data.getUnsignedIntegerAsLong(SYNC_KEY);
pebble_platform = data.getUnsignedIntegerAsLong(PLATFORM_KEY);
pebble_app_version = data.getString(VERSION_KEY);
Log.d(TAG, "receiveData: pebble_sync_value=" + pebble_sync_value + ", pebble_platform=" + pebble_platform + ", pebble_app_version=" + pebble_app_version);
switch ((int)pebble_platform) {
case 0:
if (PebbleUtil.pebbleDisplayType != PebbleDisplayType.TrendClassic) {
PebbleUtil.pebbleDisplayType = PebbleDisplayType.TrendClassic;
//JoH.static_toast_short("Switching to Pebble Classic Trend");
Log.d(TAG,"Changing to Classic Trend due to platform id");
}
break;
}
} else {
Log.d(TAG, "receiveData: pebble_app_version not known");
}
}
示例3: sendDataToPebbleWithTransactionId
import com.getpebble.android.kit.util.PebbleDictionary; //导入方法依赖的package包/类
/**
* Send one-or-more key-value pairs to the watch-app identified by the provided UUID.
* <p/>
* The watch-app and phone-app must agree of the set and type of key-value pairs being exchanged. Type mismatches or
* missing keys will cause errors on the receiver's end.
*
* @param context
* The context used to send the broadcast.
* @param watchappUuid
* A UUID uniquely identifying the target application. UUIDs for the stock kit applications are available in
* {@link Constants}.
* @param data
* A dictionary containing one-or-more key-value pairs. For more information about the types of data that
* can be stored, see {@link PebbleDictionary}.
* @param transactionId
* An integer uniquely identifying the transaction. This can be used to correlate messages sent to the
* Pebble and ACK/NACKs received from the Pebble.
*
* @throws IllegalArgumentException
* Thrown in the specified PebbleDictionary or UUID is invalid.
*/
public static void sendDataToPebbleWithTransactionId(final Context context,
final UUID watchappUuid, final PebbleDictionary data, final int transactionId)
throws IllegalArgumentException {
if (watchappUuid == null) {
throw new IllegalArgumentException("uuid cannot be null");
}
if (data == null) {
throw new IllegalArgumentException("data cannot be null");
}
if (data.size() == 0) {
return;
}
final Intent sendDataIntent = new Intent(INTENT_APP_SEND);
sendDataIntent.putExtra(APP_UUID, watchappUuid);
sendDataIntent.putExtra(TRANSACTION_ID, transactionId);
sendDataIntent.putExtra(MSG_DATA, data.toJsonString());
context.sendBroadcast(sendDataIntent);
}
示例4: sendDataToPebbleWithTransactionId
import com.getpebble.android.kit.util.PebbleDictionary; //导入方法依赖的package包/类
/**
* Send one-or-more key-value pairs to the watch-app identified by the provided UUID.
*
* The watch-app and phone-app must agree of the set and type of key-value pairs being exchanged. Type mismatches or
* missing keys will cause errors on the receiver's end.
*
* @param context
* The context used to send the broadcast.
* @param watchappUuid
* A UUID uniquely identifying the target application. UUIDs for the stock kit applications are available in
* {@link Constants}.
* @param data
* A dictionary containing one-or-more key-value pairs. For more information about the types of data that
* can be stored, see {@link PebbleDictionary}.
* @param transactionId
* An integer uniquely identifying the transaction. This can be used to correlate messages sent to the
* Pebble and ACK/NACKs received from the Pebble.
*
* @throws IllegalArgumentException
* Thrown in the specified PebbleDictionary or UUID is invalid.
*/
public static void sendDataToPebbleWithTransactionId(final Context context,
final UUID watchappUuid, final PebbleDictionary data, final int transactionId)
throws IllegalArgumentException {
if (watchappUuid == null) {
throw new IllegalArgumentException("uuid cannot be null");
}
if (data == null) {
throw new IllegalArgumentException("data cannot be null");
}
if (data.size() == 0) {
return;
}
final Intent sendDataIntent = new Intent(INTENT_APP_SEND);
sendDataIntent.putExtra(APP_UUID, watchappUuid);
sendDataIntent.putExtra(TRANSACTION_ID, transactionId);
sendDataIntent.putExtra(MSG_DATA, data.toJsonString());
context.sendBroadcast(sendDataIntent);
}
示例5: sendDataToPebbleWithTransactionId
import com.getpebble.android.kit.util.PebbleDictionary; //导入方法依赖的package包/类
/**
* Send one-or-more key-value pairs to the watch-app identified by the provided UUID.
* <p/>
* The watch-app and phone-app must agree of the set and type of key-value pairs being exchanged. Type mismatches or
* missing keys will cause errors on the receiver's end.
*
* @param context The context used to send the broadcast.
* @param watchappUuid A UUID uniquely identifying the target application. UUIDs for the stock kit applications are available in
* {@link Constants}.
* @param data A dictionary containing one-or-more key-value pairs. For more information about the types of data that
* can be stored, see {@link PebbleDictionary}.
* @param transactionId An integer uniquely identifying the transaction. This can be used to correlate messages sent to the
* Pebble and ACK/NACKs received from the Pebble.
*
* @throws IllegalArgumentException Thrown in the specified PebbleDictionary or UUID is invalid.
*/
public static void sendDataToPebbleWithTransactionId(final Context context,
final UUID watchappUuid, final PebbleDictionary data, final int transactionId)
throws IllegalArgumentException {
if (watchappUuid == null) {
throw new IllegalArgumentException("uuid cannot be null");
}
if (data == null) {
throw new IllegalArgumentException("data cannot be null");
}
if (data.size() == 0) {
return;
}
final Intent sendDataIntent = new Intent(INTENT_APP_SEND);
sendDataIntent.putExtra(APP_UUID, watchappUuid);
sendDataIntent.putExtra(TRANSACTION_ID, transactionId);
sendDataIntent.putExtra(MSG_DATA, data.toJsonString());
context.sendBroadcast(sendDataIntent);
}
示例6: sendDataToPebbleWithTransactionId
import com.getpebble.android.kit.util.PebbleDictionary; //导入方法依赖的package包/类
/**
* Send one-or-more key-value pairs to the watch-app identified by the provided UUID.
* <p/>
* The watch-app and phone-app must agree of the set and type of key-value pairs being exchanged. Type mismatches or
* missing keys will cause errors on the receiver's end.
*
* @param context
* The context used to send the broadcast.
* @param watchappUuid
* A UUID uniquely identifying the target application. UUIDs for the stock kit applications are available in
* {@link Constants}.
* @param data
* A dictionary containing one-or-more key-value pairs. For more information about the types of data that
* can be stored, see {@link PebbleDictionary}.
*
* @param transactionId
* An integer uniquely identifying the transaction. This can be used to correlate messages sent to the
* Pebble and ACK/NACKs received from the Pebble.
*
* @throws IllegalArgumentException
* Thrown in the specified PebbleDictionary or UUID is invalid.
*/
public static void sendDataToPebbleWithTransactionId(final Context context, final UUID watchappUuid,
final PebbleDictionary data, final int transactionId)
throws IllegalArgumentException {
if (watchappUuid == null) {
throw new IllegalArgumentException("uuid cannot be null");
}
if (data == null) {
throw new IllegalArgumentException("data cannot be null");
}
if (data.size() == 0) {
return;
}
final Intent sendDataIntent = new Intent(INTENT_APP_SEND);
sendDataIntent.putExtra(APP_UUID, watchappUuid);
sendDataIntent.putExtra(TRANSACTION_ID, transactionId);
sendDataIntent.putExtra(MSG_DATA, data.toJsonString());
context.sendBroadcast(sendDataIntent);
}