private void stopBtG5Service() {//KS Log.d(TAG, "stopBtG5Service"); Context myContext = getApplicationContext(); myContext.stopService(new Intent(myContext, G5CollectionService.class)); }
private void startBtG5Service() {//KS Log.d(TAG, "startBtG5Service"); //is_using_g5 = (getDexCollectionType() == DexCollectionType.DexcomG5); is_using_bt = DexCollectionType.hasBluetooth(); if (is_using_bt) { Context myContext = getApplicationContext(); Log.d(TAG, "startBtG5Service start G5CollectionService"); myContext.startService(new Intent(myContext, G5CollectionService.class)); Log.d(TAG, "startBtG5Service AFTER startService G5CollectionService"); } else { Log.d(TAG, "Not starting any G5 service as it is not our data source"); } }
private void stopBtG5Service() {//KS Log.d(TAG, "stopBtG5Service"); Context myContext = getApplicationContext(); myContext.stopService(new Intent(myContext, G5CollectionService.class)); }
private void stopBtService() { Log.d(TAG, "stopService call stopService"); CollectionServiceStarter.stopBtService(getApplicationContext()); Log.d(TAG, "stopBtService should have called onDestroy"); }
private void stopBtService() { Log.d(TAG, "stopService call stopService"); CollectionServiceStarter.stopBtService(getApplicationContext()); Log.d(TAG, "stopBtService should have called onDestroy"); }
private void startBtG5Service() {//KS Log.d(TAG, "startBtG5Service"); //is_using_g5 = (getDexCollectionType() == DexCollectionType.DexcomG5); is_using_bt = DexCollectionType.hasBluetooth(); if (is_using_bt) { Context myContext = getApplicationContext(); Log.d(TAG, "startBtG5Service start G5CollectionService"); myContext.startService(new Intent(myContext, G5CollectionService.class)); Log.d(TAG, "startBtG5Service AFTER startService G5CollectionService"); } else { Log.d(TAG, "Not starting any G5 service as it is not our data source"); } }
private void startBtService() {//KS Log.d(TAG, "startBtService"); is_using_bt = DexCollectionType.hasBluetooth();//(getDexCollectionType() == DexCollectionType.DexcomG5) if (is_using_bt) { if (!isCollectorRunning()) { CollectionServiceStarter.startBtService(getApplicationContext()); Log.d(TAG, "startBtService startService"); } else { Log.d(TAG, "startBtService collector already running!"); } } else { Log.d(TAG, "Not starting any BT Collector service as it is not our data source"); } }
@Override public void onPeerDisconnected(com.google.android.gms.wearable.Node peer) {//KS onPeerConnected and onPeerDisconnected deprecated at the same time as BIND_LISTENER super.onPeerDisconnected(peer); String id = peer.getId(); String name = peer.getDisplayName(); Log.d(TAG, "onPeerDisconnected peer name & ID: " + name + "|" + id); SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()); if (sharedPrefs.getBoolean("watch_integration", false)) { Log.d(TAG, "onPeerDisconnected watch_integration=true Phone startBtService"); startBtService(); } }
private void startBtService() {//KS Log.d(TAG, "startBtService"); is_using_bt = DexCollectionType.hasBluetooth();//(getDexCollectionType() == DexCollectionType.DexcomG5) if (is_using_bt) { if (!isCollectorRunning()) { CollectionServiceStarter.startBtService(getApplicationContext()); Log.d(TAG, "startBtService startService"); } else { Log.d(TAG, "startBtService collector already running!"); } } else { Log.d(TAG, "Not starting any BT Collector service as it is not our data source"); } }
@Override public void onPeerDisconnected(com.google.android.gms.wearable.Node peer) {//KS onPeerConnected and onPeerDisconnected deprecated at the same time as BIND_LISTENER super.onPeerDisconnected(peer); String id = peer.getId(); String name = peer.getDisplayName(); Log.d(TAG, "onPeerDisconnected peer name & ID: " + name + "|" + id); SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()); if (sharedPrefs.getBoolean("watch_integration", false)) { Log.d(TAG, "onPeerDisconnected watch_integration=true Phone startBtService"); startBtService(); } }
@Override public void onCreate() { mPrefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()); wear_integration = mPrefs.getBoolean("wear_sync", false); //is_using_g5 = (getDexCollectionType() == DexCollectionType.DexcomG5); is_using_bt = DexCollectionType.hasBluetooth(); if (wear_integration) { googleApiConnect(); } setSettings(); listenForChangeInSettings(); }
@Override public void onCreate() { mPrefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()); wear_integration = mPrefs.getBoolean("wear_sync", false); //is_using_g5 = (getDexCollectionType() == DexCollectionType.DexcomG5); is_using_bt = DexCollectionType.hasBluetooth(); if (wear_integration) { googleApiConnect(); } setSettings(); listenForChangeInSettings(); }
private void sendData() { BgReading bg = BgReading.last(); if (bg != null) { forceGoogleApiConnect(); if (wear_integration) { final int battery = PowerStateReceiver.getBatteryLevel(getApplicationContext()); new SendToDataLayerThread(WEARABLE_DATA_PATH, googleApiClient).executeOnExecutor(xdrip.executor, dataMap(bg, mPrefs, new BgGraphBuilder(getApplicationContext()), battery)); } } }
private void sendData() { BgReading bg = BgReading.last(); if (bg != null) { forceGoogleApiConnect(); if (wear_integration) { final int battery = PowerStateReceiver.getBatteryLevel(getApplicationContext()); new SendToDataLayerThread(WEARABLE_DATA_PATH, googleApiClient).executeOnExecutor(xdrip.executor, dataMap(bg, mPrefs, new BgGraphBuilder(getApplicationContext()), battery)); } } }
private void resendData(long since) { Log.d(TAG, "resendData ENTER"); forceGoogleApiConnect(); final long startTime = since == 0 ? new Date().getTime() - (60000 * 60 * 24) : since; Log.d(TAG, "resendData googleApiClient connected ENTER, sending since: " + JoH.dateTimeText(startTime)); final BgReading last_bg = BgReading.last(); if (last_bg != null) { List<BgReading> graph_bgs = BgReading.latestForGraph(60, startTime); BgGraphBuilder bgGraphBuilder = new BgGraphBuilder(getApplicationContext()); if (!graph_bgs.isEmpty()) { final int battery = PowerStateReceiver.getBatteryLevel(getApplicationContext()); DataMap entries = dataMap(last_bg, mPrefs, bgGraphBuilder, battery); final ArrayList<DataMap> dataMaps = new ArrayList<>(graph_bgs.size()); for (BgReading bg : graph_bgs) { dataMaps.add(dataMap(bg, mPrefs, bgGraphBuilder, battery)); } entries.putLong("time", new Date().getTime()); // MOST IMPORTANT LINE FOR TIMESTAMP entries.putDataMapArrayList("entries", dataMaps); if (mPrefs.getBoolean("extra_status_line", false)) { entries.putString("extra_status_line", StatusLine.extraStatusLine()); } new SendToDataLayerThread(WEARABLE_DATA_PATH, googleApiClient).executeOnExecutor(xdrip.executor, entries); } } }
private void resendData(long since) { Log.d(TAG, "resendData ENTER"); forceGoogleApiConnect(); final long startTime = since == 0 ? new Date().getTime() - (60000 * 60 * 24) : since; Log.d(TAG, "resendData googleApiClient connected ENTER, sending since: " + JoH.dateTimeText(startTime)); final BgReading last_bg = BgReading.last(); if (last_bg != null) { List<BgReading> graph_bgs = BgReading.latestForGraph(60, startTime); BgGraphBuilder bgGraphBuilder = new BgGraphBuilder(getApplicationContext()); if (!graph_bgs.isEmpty()) { final int battery = PowerStateReceiver.getBatteryLevel(getApplicationContext()); DataMap entries = dataMap(last_bg, mPrefs, bgGraphBuilder, battery); final ArrayList<DataMap> dataMaps = new ArrayList<>(graph_bgs.size()); for (BgReading bg : graph_bgs) { dataMaps.add(dataMap(bg, mPrefs, bgGraphBuilder, battery)); } entries.putLong("time", new Date().getTime()); // MOST IMPORTANT LINE FOR TIMESTAMP entries.putDataMapArrayList("entries", dataMaps); if (mPrefs.getBoolean("extra_status_line", false)) { entries.putString("extra_status_line", StatusLine.extraStatusLine()); } new SendToDataLayerThread(WEARABLE_DATA_PATH, googleApiClient).executeOnExecutor(xdrip.executor, entries); } } }
continue; receivedText(getApplicationContext(), record); PersistentStore.setLong(LAST_RECORD_TIMESTAMP, timestamp);
nodes = capabilityResult.getCapability(); SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()); SharedPreferences.Editor prefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()).edit(); boolean enable_wearG5 = sharedPrefs.getBoolean("enable_wearG5", false); boolean force_wearG5 = sharedPrefs.getBoolean("force_wearG5", false);
continue; receivedText(getApplicationContext(), record); PersistentStore.setLong(LAST_RECORD_TIMESTAMP, timestamp);
nodes = capabilityResult.getCapability(); SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()); SharedPreferences.Editor prefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()).edit(); boolean enable_wearG5 = sharedPrefs.getBoolean("enable_wearG5", false); boolean force_wearG5 = sharedPrefs.getBoolean("force_wearG5", false);