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


Java DataMapItem.getDataMap方法代码示例

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


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

示例1: onDataChanged

import com.google.android.gms.wearable.DataMapItem; //导入方法依赖的package包/类
@Override
public void onDataChanged(DataEventBuffer dataEvents) {
    LOGD(TAG, "onDataChanged: " + dataEvents + " for " + getPackageName());

    for (DataEvent event : dataEvents) {
        LOGD(TAG, "Uri is: " + event.getDataItem().getUri());
        DataMapItem mapItem = DataMapItem.fromDataItem(event.getDataItem());
        String path = event.getDataItem().getUri().getPath();
        if (event.getType() == DataEvent.TYPE_CHANGED) {
            if (PATH_RESPONSE.equals(path)) {
                // we have a response
                DataMap data = mapItem.getDataMap();
                saveFeedback(data);
            }
        } else if (event.getType() == DataEvent.TYPE_DELETED) {
            if (path.startsWith(SessionAlarmService.PATH_FEEDBACK)) {
                Uri uri = event.getDataItem().getUri();
                dismissLocalNotification(uri.getLastPathSegment());
            }
        }
    }
}
 
开发者ID:dreaminglion,项目名称:iosched-reader,代码行数:23,代码来源:FeedbackWearableListenerService.java

示例2: onDataChanged

import com.google.android.gms.wearable.DataMapItem; //导入方法依赖的package包/类
@Override // DataApi.DataListener
public void onDataChanged(DataEventBuffer dataEvents) {
    Log.d(TAG, "Data changed");
    for (DataEvent dataEvent : dataEvents) {
        if (dataEvent.getType() != DataEvent.TYPE_CHANGED) {
            continue;
        }

        DataItem dataItem = dataEvent.getDataItem();
        if (!dataItem.getUri().getPath().equals(
                ConfigurationHelper.PATH_WITH_FEATURE)) {
            continue;
        }

        DataMapItem dataMapItem = DataMapItem.fromDataItem(dataItem);
        DataMap config = dataMapItem.getDataMap();
        Log.d(TAG, "Config DataItem updated:" + config);
        // This can happen from this method more often when phone changes
        updateUiForConfigDataMap(config);
    }
}
 
开发者ID:jimmykane,项目名称:Athletica,代码行数:22,代码来源:WatchFaceService.java

示例3: onDataChanged

import com.google.android.gms.wearable.DataMapItem; //导入方法依赖的package包/类
@Override // DataApi.DataListener
public void onDataChanged(DataEventBuffer dataEvents) {
    for (DataEvent dataEvent : dataEvents) {
        if (dataEvent.getType() != DataEvent.TYPE_CHANGED) {
            continue;
        }

        DataItem dataItem = dataEvent.getDataItem();
        if (!dataItem.getUri().getPath().equals(
                WatchFaceUtil.PATH_WITH_FEATURE)) {
            continue;
        }

        DataMapItem dataMapItem = DataMapItem.fromDataItem(dataItem);
        DataMap config = dataMapItem.getDataMap();
        Log.d(TAG, "Config DataItem updated:" + config);

        updateUiForConfigDataMap(config);
    }
}
 
开发者ID:marcouberti,项目名称:adrenaline_watch_face,代码行数:21,代码来源:SonicBoomFace.java

示例4: onDataChanged

import com.google.android.gms.wearable.DataMapItem; //导入方法依赖的package包/类
@Override // DataApi.DataListener
public void onDataChanged(DataEventBuffer dataEvents) {
    Log.d(TAG,"onDataChanged "+dataEvents);
    for (DataEvent dataEvent : dataEvents) {
        if (dataEvent.getType() != DataEvent.TYPE_CHANGED) {
            continue;
        }

        DataItem dataItem = dataEvent.getDataItem();
        if (!dataItem.getUri().getPath().equals(WatchFaceUtil.PATH_WITH_FEATURE)) {
            continue;
        }

        DataMapItem dataMapItem = DataMapItem.fromDataItem(dataItem);
        DataMap config = dataMapItem.getDataMap();
        Log.d(TAG, "Config DataItem updated:" + config);

        updateUiForConfigDataMap(config);
    }
}
 
开发者ID:marcouberti,项目名称:adrenaline_watch_face,代码行数:21,代码来源:WatchFaceCompanionConfigActivity.java

示例5: onDataChanged

import com.google.android.gms.wearable.DataMapItem; //导入方法依赖的package包/类
@Override
public void onDataChanged(DataEventBuffer dataEventBuffer) {
    for (DataEvent dataEvent : dataEventBuffer) {
        if (dataEvent.getType() != DataEvent.TYPE_CHANGED) {
            continue;
        }

        DataItem dataItem = dataEvent.getDataItem();
        if (!dataItem.getUri().getPath().equals(
                DigitalWatchFaceUtil.PATH_WITH_FEATURE)) {
            continue;
        }

        DataMapItem dataMapItem = DataMapItem.fromDataItem(dataItem);
        DataMap config = dataMapItem.getDataMap();
        Log.d("WatchFace", "Config DataItem updated:" + config);
        updateUiForConfigDataMap(config);
    }
}
 
开发者ID:passiondroid,项目名称:SunshineApp,代码行数:20,代码来源:WatchFace.java

示例6: onDataChanged

import com.google.android.gms.wearable.DataMapItem; //导入方法依赖的package包/类
@Override // DataApi.DataListener
public void onDataChanged(DataEventBuffer dataEvents) {
    for (DataEvent dataEvent : dataEvents) {
        if (dataEvent.getType() != DataEvent.TYPE_CHANGED) {
            continue;
        }

        DataItem dataItem = dataEvent.getDataItem();
        if (!dataItem.getUri().getPath().equals(SunsetsWatchFaceUtil.PATH_WITH_FEATURE)) {
            continue;
        }

        DataMapItem dataMapItem = DataMapItem.fromDataItem(dataItem);
        DataMap config = dataMapItem.getDataMap();
        if (Log.isLoggable(TAG, Log.DEBUG)) {
            Log.d(TAG, "Config DataItem updated:" + config);
        }
        updateUiForConfigDataMap(config);
    }
}
 
开发者ID:marcouberti,项目名称:american_sunsets_watch_face,代码行数:21,代码来源:WatchFaceCompanionConfigActivity.java

示例7: onDataChanged

import com.google.android.gms.wearable.DataMapItem; //导入方法依赖的package包/类
@Override // DataApi.DataListener
public void onDataChanged(DataEventBuffer dataEvents) {
    for (DataEvent dataEvent : dataEvents) {
        if (dataEvent.getType() != DataEvent.TYPE_CHANGED) {
            continue;
        }

        DataItem dataItem = dataEvent.getDataItem();
        if (!dataItem.getUri().getPath().equals(
                SunsetsWatchFaceUtil.PATH_WITH_FEATURE)) {
            continue;
        }

        DataMapItem dataMapItem = DataMapItem.fromDataItem(dataItem);
        DataMap config = dataMapItem.getDataMap();
        Log.d(TAG, "Config DataItem updated:" + config);

        updateUiForConfigDataMap(config);
    }
}
 
开发者ID:marcouberti,项目名称:african_sunsets_watch_face,代码行数:21,代码来源:SunsetsWatchFace.java

示例8: onDataChanged

import com.google.android.gms.wearable.DataMapItem; //导入方法依赖的package包/类
@Override // DataApi.DataListener
public void onDataChanged(DataEventBuffer dataEvents) {
    try {
        for (DataEvent dataEvent : dataEvents) {
            if (dataEvent.getType() != DataEvent.TYPE_CHANGED) {
                continue;
            }

            DataItem dataItem = dataEvent.getDataItem();
            if (!dataItem.getUri().getPath().equals(
                    DigitalWatchFaceUtil.PATH_WITH_FEATURE)) {
                continue;
            }

            DataMapItem dataMapItem = DataMapItem.fromDataItem(dataItem);
            DataMap config = dataMapItem.getDataMap();
            if (Log.isLoggable(TAG, Log.DEBUG)) {
                Log.d(TAG, "Config DataItem updated:" + config);
            }
            updateUiForConfigDataMap(config);
        }
    } finally {
        dataEvents.close();
    }
}
 
开发者ID:AndroidAvanzato,项目名称:Capitolo6,代码行数:26,代码来源:DigitalWatchFaceService.java

示例9: onDataChanged

import com.google.android.gms.wearable.DataMapItem; //导入方法依赖的package包/类
@Override // DataApi.DataListener
public void onDataChanged(DataEventBuffer dataEvents) {
    for (DataEvent dataEvent : dataEvents) {
        if (dataEvent.getType() != DataEvent.TYPE_CHANGED) {
            continue;
        }

        DataItem dataItem = dataEvent.getDataItem();
        if (!dataItem.getUri().getPath().equals(
                DigitalWatchFaceUtil.PATH_WITH_FEATURE)) {
            continue;
        }

        DataMapItem dataMapItem = DataMapItem.fromDataItem(dataItem);
        DataMap config = dataMapItem.getDataMap();
        if (Log.isLoggable(TAG, Log.DEBUG)) {
            Log.d(TAG, "Config DataItem updated:" + config);
        }
        updateUiForConfigDataMap(config);
    }
}
 
开发者ID:googlesamples,项目名称:android-WatchFace,代码行数:22,代码来源:DigitalWatchFaceService.java

示例10: onDataChanged

import com.google.android.gms.wearable.DataMapItem; //导入方法依赖的package包/类
@Override // DataApi.DataListener
public void onDataChanged(DataEventBuffer dataEvents) {
    try {
        for (DataEvent dataEvent : dataEvents) {
            if (dataEvent.getType() != DataEvent.TYPE_CHANGED) {
                continue;
            }

            DataItem dataItem = dataEvent.getDataItem();
            Log.d(TAG, "onDataChanged: Path" + dataItem.getUri().getPath());
            if (!dataItem.getUri().getPath().equals(
                    Constants.PATH_WEATHER_DATA)) {
                continue;
            }

            DataMapItem dataMapItem = DataMapItem.fromDataItem(dataItem);
            DataMap config = dataMapItem.getDataMap();
            if (Log.isLoggable(TAG, Log.DEBUG)) {
                Log.d(TAG, "Config DataItem updated:" + config);
            }
            updateUiForConfigDataMap(config);
        }
    } finally {
        dataEvents.close();
    }

}
 
开发者ID:mladenbabic,项目名称:Advanced_Android_Development_Wear,代码行数:28,代码来源:SunshineWatchFace.java

示例11: onDataChanged

import com.google.android.gms.wearable.DataMapItem; //导入方法依赖的package包/类
@Override
public void onDataChanged(DataEventBuffer dataEvents) {
    Log.d(TAG, "onDataChanged: ");
    try {
        
        for (DataEvent dataEvent : dataEvents) {
            if (dataEvent.getType() != DataEvent.TYPE_CHANGED) {
                continue;
            }

            DataItem dataItem = dataEvent.getDataItem();

            Log.d(TAG, "path: " + dataItem.getUri().getPath());

            if (!dataItem.getUri().getPath().equals(Constants.PATH_WEATHER_DATA)) {
                continue;
            }

            DataMapItem dataMapItem = DataMapItem.fromDataItem(dataItem);
            DataMap config = dataMapItem.getDataMap();
            if (Log.isLoggable(TAG, Log.DEBUG)) {
                Log.d(TAG, "Config DataItem updated:" + config);
            }
            DigitalWatchFaceUtil.overwriteKeysInConfigDataMap(mGoogleApiClient, config, Constants.PATH_WEATHER_DATA);
        }
    } finally {
        dataEvents.close();
    }
}
 
开发者ID:mladenbabic,项目名称:Advanced_Android_Development_Wear,代码行数:30,代码来源:ConfigDataListenerService.java

示例12: onResult

import com.google.android.gms.wearable.DataMapItem; //导入方法依赖的package包/类
@Override
public void onResult(DataApi.DataItemResult dataItemResult) {
    if (dataItemResult.getStatus().isSuccess()) {
        if (dataItemResult.getDataItem() != null) {
            DataItem configDataItem = dataItemResult.getDataItem();
            DataMapItem dataMapItem = DataMapItem.fromDataItem(configDataItem);
            DataMap config = dataMapItem.getDataMap();
            mCallback.onConfigDataMapFetched(config);
        } else {
            mCallback.onConfigDataMapFetched(new DataMap());
        }
    }
}
 
开发者ID:mladenbabic,项目名称:Advanced_Android_Development_Wear,代码行数:14,代码来源:DigitalWatchFaceUtil.java

示例13: onResult

import com.google.android.gms.wearable.DataMapItem; //导入方法依赖的package包/类
@Override
public void onResult(@NonNull DataApi.DataItemResult dataItemResult) {
    if (dataItemResult.getStatus().isSuccess()) {
        if (dataItemResult.getDataItem() != null) {
            DataItem configDataItem = dataItemResult.getDataItem();
            DataMapItem dataMapItem = DataMapItem.fromDataItem(configDataItem);
            DataMap config = dataMapItem.getDataMap();
            mCallback.onConfigDataMapFetched(config);
        } else {
            mCallback.onConfigDataMapFetched(new DataMap());
        }
    }
}
 
开发者ID:jimmykane,项目名称:Athletica,代码行数:14,代码来源:ConfigurationHelper.java

示例14: onResult

import com.google.android.gms.wearable.DataMapItem; //导入方法依赖的package包/类
@Override // ResultCallback<DataApi.DataItemResult>
public void onResult(DataApi.DataItemResult dataItemResult) {
    if (dataItemResult.getStatus().isSuccess() && dataItemResult.getDataItem() != null) {
        DataItem configDataItem = dataItemResult.getDataItem();
        DataMapItem dataMapItem = DataMapItem.fromDataItem(configDataItem);
        DataMap config = dataMapItem.getDataMap();
        Log.d(TAG, "startup setup UI...");
        updateUiForConfigDataMap(config);
        //setUpAllPickers(config);
    } else {
        // If DataItem with the current config can't be retrieved, select the default items on
        // each picker.
        //setUpAllPickers(null);
    }
}
 
开发者ID:marcouberti,项目名称:adrenaline_watch_face,代码行数:16,代码来源:WatchFaceCompanionConfigActivity.java

示例15: onResult

import com.google.android.gms.wearable.DataMapItem; //导入方法依赖的package包/类
@Override // ResultCallback<DataApi.DataItemResult>
public void onResult(DataApi.DataItemResult dataItemResult) {
    if (dataItemResult.getStatus().isSuccess() && dataItemResult.getDataItem() != null) {
        DataItem configDataItem = dataItemResult.getDataItem();
        DataMapItem dataMapItem = DataMapItem.fromDataItem(configDataItem);
        DataMap config = dataMapItem.getDataMap();
        Log.d(TAG,"startup setup UI...");
        updateUiForConfigDataMap(config);
        //setUpAllPickers(config);
    } else {
        // If DataItem with the current config can't be retrieved, select the default items on
        // each picker.
        //setUpAllPickers(null);
    }
}
 
开发者ID:marcouberti,项目名称:american_sunsets_watch_face,代码行数:16,代码来源:WatchFaceCompanionConfigActivity.java


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