use of com.google.android.gms.wearable.DataMap in project ETSMobile-Android2 by ApplETS.
the class Seances method putData.
public DataMap putData() {
DataMap map = new DataMap();
map.putString("dateDebut", dateDebut);
map.putString("dateFin", dateFin);
map.putString("coursGroupe", coursGroupe);
map.putString("nomActivite", nomActivite);
map.putString("local", local);
map.putString("descriptionActivite", descriptionActivite);
map.putString("libelleCours", libelleCours);
return map;
}
use of com.google.android.gms.wearable.DataMap in project xDrip by NightscoutFoundation.
the class BaseWatchFace method addToWatchSet.
public void addToWatchSet(DataMap dataMap) {
Log.d(TAG, "addToWatchSet bgDataList.size()=" + bgDataList.size());
ArrayList<DataMap> entries = dataMap.getDataMapArrayList("entries");
if (entries != null) {
Log.d(TAG, "addToWatchSet entries.size()=" + entries.size());
for (DataMap entry : entries) {
addDataMap(entry);
}
} else {
addDataMap(dataMap);
}
for (int i = 0; i < bgDataList.size(); i++) {
if (bgDataList.get(i).timestamp < (new Date().getTime() - (1000 * 60 * 60 * 5))) {
Log.d(TAG, "addToWatchSet Remove bgDataList.get(i).timestamp: " + JoH.dateTimeText((long) bgDataList.get(i).timestamp) + " i: " + i);
// Get rid of anything more than 5 hours old
bgDataList.remove(i);
}
}
}
use of com.google.android.gms.wearable.DataMap in project xDrip by NightscoutFoundation.
the class BIGChart method addToWatchSetTreats.
public void addToWatchSetTreats(DataMap dataMap, ArrayList<BgWatchData> dataList) {
if (d)
Log.d(TAG, "addToWatchSetTreats dataList.size()=" + (dataList != null ? dataList.size() : "0"));
// necessary since treatments, bloodtest and calibrations can be deleted/invalidated
dataList.clear();
ArrayList<DataMap> entries = dataMap.getDataMapArrayList("entries");
if (entries != null) {
if (d)
Log.d(TAG, "addToWatchSetTreats entries.size()=" + entries.size() + " entries=" + entries);
for (DataMap entry : entries) {
addDataMapTreats(entry, dataList);
}
}
if (d)
Log.d(TAG, "addToWatchSetTreats dataList.size()=" + dataList.size());
}
use of com.google.android.gms.wearable.DataMap in project xDrip by NightscoutFoundation.
the class ListenerService method dataMap.
private DataMap dataMap(Treatments log) {
DataMap dataMap = new DataMap();
// String json = log.toS();
// Log.d(TAG, "dataMap PebbleMovement GSON: " + json);
// dataMap.putString("entry", json);
// dataMap.putLong("timestamp", log.timestamp);
String notes = log.uuid + " uuid " + log.notes;
Log.d(TAG, "dataMap Treatments notes:" + notes);
dataMap.putString("entry", notes);
dataMap.putLong("timestamp", log.systimestamp);
return dataMap;
}
use of com.google.android.gms.wearable.DataMap in project xDrip by NightscoutFoundation.
the class ListenerService method getTreatments.
public static DataMap getTreatments(long startTime) {
Treatments last = Treatments.last();
if (last != null) {
Log.d(TAG, "getTreatments last.timestamp:" + JoH.dateTimeText(last.timestamp));
}
List<Treatments> graph = Treatments.latestForGraph(60, startTime);
if (!graph.isEmpty()) {
Log.d(TAG, "getTreatments graph size=" + graph.size());
final ArrayList<DataMap> dataMaps = new ArrayList<>(graph.size());
DataMap entries = null;
// if (includeTreatment(last)) entries = dataMapForWatchface(last);
for (Treatments data : graph) {
if (includeTreatment(data)) {
if (entries == null) {
entries = dataMapForWatchface(data);
dataMaps.add(dataMapForWatchface(data));
} else
dataMaps.add(dataMapForWatchface(data));
}
}
if (entries != null) {
entries.putDataMapArrayList("entries", dataMaps);
Log.d(TAG, "getTreatments entries=" + entries);
}
return entries;
} else
return null;
}
Aggregations