gpt4 book ai didi

com.eveningoutpost.dexdrip.xdrip.getAppContext()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-19 19:56:40 28 4
gpt4 key购买 nike

本文整理了Java中com.eveningoutpost.dexdrip.xdrip.getAppContext()方法的一些代码示例,展示了xdrip.getAppContext()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。xdrip.getAppContext()方法的具体详情如下:
包路径:com.eveningoutpost.dexdrip.xdrip
类名称:xdrip
方法名:getAppContext

xdrip.getAppContext介绍

暂无

代码示例

代码示例来源:origin: NightscoutFoundation/xDrip

public static boolean checkAppContext(Context context) {
  if (getAppContext() == null) {
    xdrip.context = context;
    return false;
  } else {
    return true;
  }
}

代码示例来源:origin: NightscoutFoundation/xDrip

public static void cancelNotification(int notificationId) {
  try {
    final NotificationManager mNotifyMgr = (NotificationManager) xdrip.getAppContext().getSystemService(Context.NOTIFICATION_SERVICE);
    mNotifyMgr.cancel(notificationId);
  } catch (Exception e) {
    //
  }
}

代码示例来源:origin: NightscoutFoundation/xDrip

private static NotificationCompat.Builder notificationBuilder(String title, String content, PendingIntent intent, String channelId) {
  return new NotificationCompat.Builder(xdrip.getAppContext(), channelId)
      .setSmallIcon(R.drawable.ic_action_communication_invert_colors_on)
      .setContentTitle(title)
      .setContentText(content)
      .setContentIntent(intent);
}

代码示例来源:origin: NightscoutFoundation/xDrip

public static boolean isLANConnected() {
  final ConnectivityManager cm =
      (ConnectivityManager) xdrip.getAppContext().getSystemService(Context.CONNECTIVITY_SERVICE);
  final NetworkInfo activeNetwork = cm.getActiveNetworkInfo();
  final boolean isConnected = activeNetwork != null &&
      activeNetwork.isConnected();
  return isConnected && ((activeNetwork.getType() == ConnectivityManager.TYPE_WIFI)
      || (activeNetwork.getType() == ConnectivityManager.TYPE_ETHERNET)
      || (activeNetwork.getType() == ConnectivityManager.TYPE_BLUETOOTH));
}

代码示例来源:origin: NightscoutFoundation/xDrip

@SuppressWarnings("ConstantConditions")
private static boolean isOngoingCall() {
  final AudioManager manager = (AudioManager) xdrip.getAppContext().getSystemService(Context.AUDIO_SERVICE);
  try {
    return (manager.getMode() == AudioManager.MODE_IN_CALL);
  } catch (NullPointerException e) {
    return false;
  }
}

代码示例来源:origin: NightscoutFoundation/xDrip

public static synchronized RxBleClient getSingleton(final String name) {
  final RxBleClient cached = singletons.get(name);
  if (cached != null) return cached;
  final RxBleClient created = RxBleClient.create(xdrip.getAppContext());
  singletons.put(name, created);
  return created;
}

代码示例来源:origin: NightscoutFoundation/xDrip

/**
 * Check the device to make sure it has the Google Play Services APK. If
 * it doesn't, display a dialog that allows users to download the APK from
 * the Google Play Store or enable it in the device's system settings.
 */
private static Boolean checkPlayServices() {
  return checkPlayServices(xdrip.getAppContext(), null);
}

代码示例来源:origin: NightscoutFoundation/xDrip

public static boolean isOngoingCall() {
  try {
    AudioManager manager = (AudioManager) xdrip.getAppContext().getSystemService(Context.AUDIO_SERVICE);
    return (manager.getMode() == AudioManager.MODE_IN_CALL);
    // possibly should have MODE_IN_COMMUNICATION as well
  } catch (Exception e) {
    return false;
  }
}

代码示例来源:origin: NightscoutFoundation/xDrip

public static void writeToFileWithCurrentDate(String TAG, String file, byte []data) {
  Context context = xdrip.getAppContext();
  
  String dir = context.getFilesDir().getPath();
  SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd_HHmmss");
  String currentDateandTime = sdf.format(new Date());
  String fileName = dir + '/' + file+ "_" + currentDateandTime + ".dat";
  writeToFile(TAG, fileName, data);
}

代码示例来源:origin: NightscoutFoundation/xDrip

public void onClick(View v) {
  xdrip.checkForcedEnglish(xdrip.getAppContext());
  Intent myIntent = new Intent(AlertList.this, EditAlertActivity.class);
  myIntent.putExtra("above", "false");
  AlertList.this.startActivityForResult(myIntent, ADD_ALERT);
}

代码示例来源:origin: NightscoutFoundation/xDrip

private static boolean isAndroidTV() {
  if (xdrip.getAppContext().getPackageManager().hasSystemFeature(PackageManager.FEATURE_ETHERNET)) {
    UserError.Log.d(TAG, "Android TV Detected");
    return true;
  }
  return false;
}

代码示例来源:origin: NightscoutFoundation/xDrip

@Override
protected void onCreate(Bundle b) {
  super.onCreate(b);
  prefs = PreferenceManager.getDefaultSharedPreferences(xdrip.getAppContext());
  startup();
}

代码示例来源:origin: NightscoutFoundation/xDrip

@Override
protected void onResume() {
  xdrip.checkForcedEnglish(xdrip.getAppContext());
  super.onResume();
}

代码示例来源:origin: NightscoutFoundation/xDrip

@Override
  public void run() {
    immediateSend = XbridgePlus.sendDataRequestPacket();
    CollectionServiceStarter.restartCollectionService(xdrip.getAppContext()); // TODO quicker/cleaner restart
  }
}));

代码示例来源:origin: NightscoutFoundation/xDrip

private void requestWearCollectorStatus() {
  if (Home.get_enable_wear()) {
    if (DexCollectionType.getDexCollectionType().equals(DexcomG5)) {
      startWatchUpdaterService(xdrip.getAppContext(), WatchUpdaterService.ACTION_STATUS_COLLECTOR, TAG, "getBatteryStatusNow", G5CollectionService.getBatteryStatusNow);
    } else {
      startWatchUpdaterService(xdrip.getAppContext(), WatchUpdaterService.ACTION_STATUS_COLLECTOR, TAG);
    }
  }
}

代码示例来源:origin: NightscoutFoundation/xDrip

@Override
protected void onResume() {
  mActivity = this;
  super.onResume();
  activityVisible = true;
  final IntentFilter intentFilter = new IntentFilter();
  intentFilter.addAction(WatchUpdaterService.ACTION_BLUETOOTH_COLLECTION_SERVICE_UPDATE);
  LocalBroadcastManager.getInstance(xdrip.getAppContext()).registerReceiver(serviceDataReceiver, intentFilter);
  if ((autoRunnable != null) || (autoStart)) startAutoFresh();
  if (sectionList.size() > 1)
    startupInfo(); // show swipe message if there is a page to swipe to
}

代码示例来源:origin: NightscoutFoundation/xDrip

public synchronized void undoFromFloater(View v) {
  if (last_undo != null) {
    dismissDoppelgangerItem(last_undo);
    reinject(last_undo);
    last_undo = null;
    hideSnoozeFloater();
  } else {
    JoH.static_toast_short(xdrip.getAppContext().getString(R.string.nothing_to_undo));
  }
}

代码示例来源:origin: NightscoutFoundation/xDrip

@Override
protected void onPause() {
  try {
    LocalBroadcastManager.getInstance(xdrip.getAppContext()).unregisterReceiver(mRegistrationBroadcastReceiver);
  } catch (Exception e) {
    Log.e(TAG, "Exception onPause: ", e);
  }
  super.onPause();
}

代码示例来源:origin: NightscoutFoundation/xDrip

private static void uploadToShare(BgReading bgReading, boolean is_follower) {
    if ((!is_follower) && (Pref.getBooleanDefaultFalse("share_upload"))) {
      if (JoH.ratelimit("sending-to-share-upload", 10)) {
        UserError.Log.d("ShareRest", "About to call ShareRest!!");
        String receiverSn = Pref.getString("share_key", "SM00000000").toUpperCase();
        BgUploader bgUploader = new BgUploader(xdrip.getAppContext());
        bgUploader.upload(new ShareUploadPayload(receiverSn, bgReading));
      }
    }
  }
}

代码示例来源:origin: NightscoutFoundation/xDrip

static void scheduleWakeUp() {
  final BgReading lastBg = BgReading.lastNoSenssor();
  final long last = lastBg != null ? lastBg.timestamp : 0;
  final long grace = Constants.SECOND_IN_MS * 10;
  final long next = Anticipate.next(JoH.tsl(), last, SAMPLE_PERIOD, grace) + grace;
  UserError.Log.d(TAG, "Anticipate next: " + JoH.dateTimeText(next) + "  last: " + JoH.dateTimeText(last));
  JoH.wakeUpIntent(xdrip.getAppContext(), JoH.msTill(next), WakeLockTrampoline.getPendingIntent(NightscoutFollowService.class, Constants.NSFOLLOW_SERVICE_FAILOVER_ID));
}

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com