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


Java DataMap.putBoolean方法代码示例

本文整理汇总了Java中com.google.android.gms.wearable.DataMap.putBoolean方法的典型用法代码示例。如果您正苦于以下问题:Java DataMap.putBoolean方法的具体用法?Java DataMap.putBoolean怎么用?Java DataMap.putBoolean使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.google.android.gms.wearable.DataMap的用法示例。


在下文中一共展示了DataMap.putBoolean方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: sendActiveBtDeviceData

import com.google.android.gms.wearable.DataMap; //导入方法依赖的package包/类
private void sendActiveBtDeviceData() {//KS
    if (is_using_bt) {//only required for Collector running on watch
        forceGoogleApiConnect();
        ActiveBluetoothDevice btDevice = ActiveBluetoothDevice.first();
        if (btDevice != null) {
            if (wear_integration) {
                DataMap dataMap = new DataMap();
                Log.d(TAG, "sendActiveBtDeviceData name=" + btDevice.name + " address=" + btDevice.address + " connected=" + btDevice.connected);

                dataMap.putLong("time", new Date().getTime()); // MOST IMPORTANT LINE FOR TIMESTAMP

                dataMap.putString("name", btDevice.name);
                dataMap.putString("address", btDevice.address);
                dataMap.putBoolean("connected", btDevice.connected);

                new SendToDataLayerThread(WEARABLE_ACTIVEBTDEVICE_DATA_PATH, googleApiClient).executeOnExecutor(xdrip.executor, dataMap);
            }
        }
    } else {
        Log.d(TAG, "Not sending activebluetoothdevice data as we are not using bt");
    }
}
 
开发者ID:NightscoutFoundation,项目名称:xDrip,代码行数:23,代码来源:WatchUpdaterService.java

示例2: sendPrefSettings

import com.google.android.gms.wearable.DataMap; //导入方法依赖的package包/类
private void sendPrefSettings() {//KS

        Log.d(TAG, "sendPrefSettings enter");
        forceGoogleApiConnect();
        DataMap dataMap = new DataMap();
        boolean enable_wearG5 = mPrefs.getBoolean("enable_wearG5", false);
        boolean force_wearG5 = mPrefs.getBoolean("force_wearG5", false);
        String node_wearG5 = mPrefs.getString("node_wearG5", "");
        String dex_txid = mPrefs.getString("dex_txid", "ABCDEF");
        boolean show_wear_treatments = mPrefs.getBoolean("show_wear_treatments", false);

        if (localnode == null || (localnode != null && localnode.isEmpty())) setLocalNodeName();
        Log.d(TAG, "sendPrefSettings enable_wearG5: " + enable_wearG5 + " force_wearG5:" + force_wearG5 + " node_wearG5:" + node_wearG5 + " localnode:" + localnode + " dex_txid:" + dex_txid + " show_wear_treatments:" + show_wear_treatments);
        dataMap.putLong("time", new Date().getTime()); // MOST IMPORTANT LINE FOR TIMESTAMP
        dataMap.putBoolean("enable_wearG5", enable_wearG5);
        dataMap.putBoolean("force_wearG5", force_wearG5);
        if (force_wearG5) {
            dataMap.putString("node_wearG5", localnode);
        } else {
            if (node_wearG5.equals(localnode)) {
                dataMap.putString("node_wearG5", "");
            } else {
                dataMap.putString("node_wearG5", node_wearG5);
            }
        }
        dataMap.putString("dex_txid", dex_txid);
        dataMap.putInt("bridge_battery", mPrefs.getInt("bridge_battery", -1));//Used in DexCollectionService
        dataMap.putInt("nfc_sensor_age", mPrefs.getInt("nfc_sensor_age", -1));//Used in DexCollectionService for LimiTTer
        dataMap.putBoolean("bg_notifications_watch", mPrefs.getBoolean("bg_notifications", false));
        dataMap.putBoolean("persistent_high_alert_enabled_watch", mPrefs.getBoolean("persistent_high_alert_enabled", false));
        dataMap.putBoolean("show_wear_treatments", show_wear_treatments);
        sendData(WEARABLE_PREF_DATA_PATH, dataMap.toByteArray());

        SharedPreferences.Editor prefs = PreferenceManager.getDefaultSharedPreferences(this).edit();
        if (!node_wearG5.equals(dataMap.getString("node_wearG5", ""))) {
            Log.d(TAG, "sendPrefSettings save to SharedPreferences - node_wearG5:" + dataMap.getString("node_wearG5", ""));
            prefs.putString("node_wearG5", dataMap.getString("node_wearG5", ""));
            prefs.commit();
        }
    }
 
开发者ID:NightscoutFoundation,项目名称:xDrip,代码行数:41,代码来源:ListenerService.java

示例3: sendTreatment

import com.google.android.gms.wearable.DataMap; //导入方法依赖的package包/类
public synchronized static void sendTreatment(String notes) {
    Log.d(TAG, "sendTreatment WEARABLE_TREATMENT_PAYLOAD notes=" + notes);
    DataMap dataMap = new DataMap();
    dataMap.putDouble("timestamp", System.currentTimeMillis());
    dataMap.putBoolean("watchkeypad", true);
    dataMap.putString("notes", notes);
    dataMap.putBoolean("ismgdl", doMgdl(PreferenceManager.getDefaultSharedPreferences(xdrip.getAppContext())));
    Intent intent = new Intent(xdrip.getAppContext(), Simulation.class);
    intent.putExtra(WEARABLE_TREATMENT_PAYLOAD, dataMap.toBundle());
    intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    xdrip.getAppContext().startActivity(intent);
}
 
开发者ID:NightscoutFoundation,项目名称:xDrip,代码行数:13,代码来源:ListenerService.java

示例4: addBooleanKeyIfMissing

import com.google.android.gms.wearable.DataMap; //导入方法依赖的package包/类
private void addBooleanKeyIfMissing(DataMap config, String key, boolean value) {
    if (!config.containsKey(key)) {
        config.putBoolean(key, value);
    }
}
 
开发者ID:mladenbabic,项目名称:Advanced_Android_Development_Wear,代码行数:6,代码来源:SunshineWatchFace.java

示例5: updateConfigDataItemTimeFormat

import com.google.android.gms.wearable.DataMap; //导入方法依赖的package包/类
private void updateConfigDataItemTimeFormat(boolean format24) {
    DataMap configMap = new DataMap();
    configMap.putBoolean(ConfigurationHelper.KEY_TIME_FORMAT,
            format24);
    ConfigurationHelper.overwriteKeysInConfigDataMap(googleApiClient, configMap);
}
 
开发者ID:jimmykane,项目名称:Athletica,代码行数:7,代码来源:ConfigurationActivity.java

示例6: updateConfigDataItemDateNames

import com.google.android.gms.wearable.DataMap; //导入方法依赖的package包/类
private void updateConfigDataItemDateNames(boolean date_names) {
    DataMap configMap = new DataMap();
    configMap.putBoolean(ConfigurationHelper.KEY_DATE_NAMES,
            date_names);
    ConfigurationHelper.overwriteKeysInConfigDataMap(googleApiClient, configMap);
}
 
开发者ID:jimmykane,项目名称:Athletica,代码行数:7,代码来源:ConfigurationActivity.java

示例7: updateConfigDataItemShowSunriseSunsetTimes

import com.google.android.gms.wearable.DataMap; //导入方法依赖的package包/类
private void updateConfigDataItemShowSunriseSunsetTimes(boolean showSunriseSunset) {
    DataMap configMap = new DataMap();
    configMap.putBoolean(ConfigurationHelper.KEY_SHOW_SUNRISE_SUNSET,
            showSunriseSunset);
    ConfigurationHelper.overwriteKeysInConfigDataMap(googleApiClient, configMap);
}
 
开发者ID:jimmykane,项目名称:Athletica,代码行数:7,代码来源:ConfigurationActivity.java

示例8: updateConfigDataItemInterlace

import com.google.android.gms.wearable.DataMap; //导入方法依赖的package包/类
private void updateConfigDataItemInterlace(boolean interlace) {
    DataMap configMap = new DataMap();
    configMap.putBoolean(ConfigurationHelper.KEY_INTERLACE,
            interlace);
    ConfigurationHelper.overwriteKeysInConfigDataMap(googleApiClient, configMap);
}
 
开发者ID:jimmykane,项目名称:Athletica,代码行数:7,代码来源:ConfigurationActivity.java

示例9: updateConfigDataItemAntialiasInAmbient

import com.google.android.gms.wearable.DataMap; //导入方法依赖的package包/类
private void updateConfigDataItemAntialiasInAmbient(boolean antialiasInAmbient) {
    DataMap configMap = new DataMap();
    configMap.putBoolean(ConfigurationHelper.KEY_ANTIALIAS_IN_AMBIENT_MODE,
            antialiasInAmbient);
    ConfigurationHelper.overwriteKeysInConfigDataMap(googleApiClient, configMap);
}
 
开发者ID:jimmykane,项目名称:Athletica,代码行数:7,代码来源:ConfigurationActivity.java

示例10: updateConfigDataItemInvertBlackAndWhite

import com.google.android.gms.wearable.DataMap; //导入方法依赖的package包/类
private void updateConfigDataItemInvertBlackAndWhite(boolean invertBlackAndWhite) {
    DataMap configMap = new DataMap();
    configMap.putBoolean(ConfigurationHelper.KEY_INVERT_BLACK_AND_WHITE,
            invertBlackAndWhite);
    ConfigurationHelper.overwriteKeysInConfigDataMap(googleApiClient, configMap);
}
 
开发者ID:jimmykane,项目名称:Athletica,代码行数:7,代码来源:ConfigurationActivity.java

示例11: updateConfigDataItemDayNightMode

import com.google.android.gms.wearable.DataMap; //导入方法依赖的package包/类
private void updateConfigDataItemDayNightMode(boolean dayNightMode) {
    DataMap configMap = new DataMap();
    configMap.putBoolean(ConfigurationHelper.KEY_DAY_NIGHT_MODE,
            dayNightMode);
    ConfigurationHelper.overwriteKeysInConfigDataMap(googleApiClient, configMap);
}
 
开发者ID:jimmykane,项目名称:Athletica,代码行数:7,代码来源:ConfigurationActivity.java

示例12: updateConfigDataItemTwoColorBackground

import com.google.android.gms.wearable.DataMap; //导入方法依赖的package包/类
private void updateConfigDataItemTwoColorBackground(boolean twoColorBackground) {
    DataMap configMap = new DataMap();
    configMap.putBoolean(ConfigurationHelper.KEY_TWO_COLOR_BACKGROUND,
            twoColorBackground);
    ConfigurationHelper.overwriteKeysInConfigDataMap(googleApiClient, configMap);
}
 
开发者ID:jimmykane,项目名称:Athletica,代码行数:7,代码来源:ConfigurationActivity.java

示例13: updateConfigDataItemShowGoogleFitSteps

import com.google.android.gms.wearable.DataMap; //导入方法依赖的package包/类
private void updateConfigDataItemShowGoogleFitSteps(boolean showGoogleFitSteps) {
    DataMap configMap = new DataMap();
    configMap.putBoolean(ConfigurationHelper.KEY_SHOW_GOOGLE_FIT_STEPS,
            showGoogleFitSteps);
    ConfigurationHelper.overwriteKeysInConfigDataMap(googleApiClient, configMap);
}
 
开发者ID:jimmykane,项目名称:Athletica,代码行数:7,代码来源:ConfigurationActivity.java

示例14: updateConfigDataItemShowUnreadNotificationCount

import com.google.android.gms.wearable.DataMap; //导入方法依赖的package包/类
private void updateConfigDataItemShowUnreadNotificationCount(boolean showUnreadNotificationCount) {
    DataMap configMap = new DataMap();
    configMap.putBoolean(ConfigurationHelper.KEY_SHOW_UNREAD_NOTIFICATION_COUNT,
            showUnreadNotificationCount);
    ConfigurationHelper.overwriteKeysInConfigDataMap(googleApiClient, configMap);
}
 
开发者ID:jimmykane,项目名称:Athletica,代码行数:7,代码来源:ConfigurationActivity.java

示例15: addBooleanKeyIfMissing

import com.google.android.gms.wearable.DataMap; //导入方法依赖的package包/类
private static void addBooleanKeyIfMissing(DataMap config, String key, Boolean value) {
    if (!config.containsKey(key)) {
        config.putBoolean(key, value);
    }
}
 
开发者ID:jimmykane,项目名称:Athletica,代码行数:6,代码来源:ConfigurationHelper.java


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