当前位置: 首页>>代码示例>>Java>>正文


Java PebbleDictionary.size方法代码示例

本文整理汇总了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();
}
 
开发者ID:NightscoutFoundation,项目名称:xDrip,代码行数:22,代码来源:PebbleDisplayTrend.java

示例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");
        }
    }
 
开发者ID:NightscoutFoundation,项目名称:xDrip,代码行数:24,代码来源:PebbleDisplayTrendOld.java

示例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);
}
 
开发者ID:jiaminghan,项目名称:droidplanner-master,代码行数:44,代码来源:PebbleKit.java

示例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);
}
 
开发者ID:pebble,项目名称:pebble-android-sdk,代码行数:44,代码来源:PebbleKit.java

示例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);
}
 
开发者ID:nhaarman,项目名称:PebbleNotifier,代码行数:39,代码来源:PebbleKit.java

示例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);
}
 
开发者ID:smallstoneapps,项目名称:rockshot-android,代码行数:45,代码来源:PebbleKit.java


注:本文中的com.getpebble.android.kit.util.PebbleDictionary.size方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。