當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。