public static String getIOB() { final String statusLine = getLastStatusLine(); if (statusLine.length() == 0) return ""; final String check = statusLine.replaceAll("[^%]", ""); if (check.length() > 0) { UserError.Log.v(TAG, statusLine); return statusLine.substring((statusLine.lastIndexOf('%') + 2), (statusLine.lastIndexOf('%') + 6)); } else if (check.length() == 0) { UserError.Log.v(TAG, statusLine); return statusLine.substring(0, 4); } else return "???"; }
String external_status_line = getLastStatusLine();
public static String getTBR() { final String statusLine = getLastStatusLine(); if (statusLine.length() == 0) return ""; final String check = statusLine.replaceAll("[^%]", ""); if (check.length() > 0) { int index1 = 0, index2 = 4; UserError.Log.v(TAG, statusLine); if (statusLine.lastIndexOf('%') == 3) index2 = 4; else if (statusLine.lastIndexOf('%') == 2) index2 = 3; else if (statusLine.lastIndexOf('%') == 1) index2 = 2; return statusLine.substring(index1, index2); } else if (check.length() == 0) return "100%"; else return "???"; }
String external_status_line = getLastStatusLine();
public static String getIOB() { final String statusLine = getLastStatusLine(); if (statusLine.length() == 0) return ""; final String check = statusLine.replaceAll("[^%]", ""); if (check.length() > 0) { UserError.Log.v(TAG, statusLine); return statusLine.substring((statusLine.lastIndexOf('%') + 2), (statusLine.lastIndexOf('%') + 6)); } else if (check.length() == 0) { UserError.Log.v(TAG, statusLine); return statusLine.substring(0, 4); } else return "???"; }
public static String getTBR() { final String statusLine = getLastStatusLine(); if (statusLine.length() == 0) return ""; final String check = statusLine.replaceAll("[^%]", ""); if (check.length() > 0) { int index1 = 0, index2 = 4; UserError.Log.v(TAG, statusLine); if (statusLine.lastIndexOf('%') == 3) index2 = 4; else if (statusLine.lastIndexOf('%') == 2) index2 = 3; else if (statusLine.lastIndexOf('%') == 1) index2 = 2; return statusLine.substring(index1, index2); } else if (check.length() == 0) return "100%"; else return "???"; }
public static void newExternalStatus(boolean receivedLocally) { final String statusLine = ExternalStatusService.getLastStatusLine(); if (statusLine.length() > 0) { // send to wear if (Pref.getBooleanDefaultFalse("wear_sync")) { startWatchUpdaterService(xdrip.getAppContext(), WatchUpdaterService.ACTION_SEND_STATUS, TAG, "externalStatusString", statusLine); } // send to pebble sendToPebble(); sendToAmazfit(); // don't send via GCM if received via GCM! if (receivedLocally) { // SEND TO GCM GcmActivity.push_external_status_update(JoH.tsl(), statusLine); } } }
public static void newExternalStatus(boolean receivedLocally) { final String statusLine = ExternalStatusService.getLastStatusLine(); if (statusLine.length() > 0) { // send to wear if (Pref.getBooleanDefaultFalse("wear_sync")) { startWatchUpdaterService(xdrip.getAppContext(), WatchUpdaterService.ACTION_SEND_STATUS, TAG, "externalStatusString", statusLine); } // send to pebble sendToPebble(); sendToAmazfit(); // don't send via GCM if received via GCM! if (receivedLocally) { // SEND TO GCM GcmActivity.push_external_status_update(JoH.tsl(), statusLine); } } }
append(sb, ExternalStatusService.getLastStatusLine());
append(sb, ExternalStatusService.getLastStatusLine());