當前位置: 首頁>>代碼示例>>Java>>正文


Java LocationServices.API屬性代碼示例

本文整理匯總了Java中com.google.android.gms.location.LocationServices.API屬性的典型用法代碼示例。如果您正苦於以下問題:Java LocationServices.API屬性的具體用法?Java LocationServices.API怎麽用?Java LocationServices.API使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在com.google.android.gms.location.LocationServices的用法示例。


在下文中一共展示了LocationServices.API屬性的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getLocationManager

public static LocationManager getLocationManager() {
  if (Util.hasPlayServices()) {
    try {
      if (LocationServices.API != null) {
        // Reflection here prevents linker errors
        // in Google Play Services is not used in the client app.
        return (LocationManager) Class
            .forName("com.leanplum.LocationManagerImplementation")
            .getMethod("instance").invoke(null);
      }
    } catch (Throwable e) {
      if (!loggedLocationManagerFailure) {
        Log.w("Geofencing support requires Google Play Services v8.1 and higher.\n" +
            "Add this to your build.gradle file:\n" +
            "compile ('com.google.android.gms:play-services-location:8.3.0+')");
        loggedLocationManagerFailure = true;
      }
    }
  }
  return null;
}
 
開發者ID:Leanplum,項目名稱:Leanplum-Android-SDK,代碼行數:21,代碼來源:ActionManager.java

示例2: RxLocationBaseOnSubscribe

protected RxLocationBaseOnSubscribe(@NonNull RxLocation rxLocation, Long timeout, TimeUnit timeUnit) {
    this.ctx = rxLocation.ctx;
    this.services = new Api[]{LocationServices.API};
    this.scopes = null;

    if (timeout != null && timeUnit != null) {
        this.timeoutTime = timeout;
        this.timeoutUnit = timeUnit;
    } else {
        this.timeoutTime = rxLocation.timeoutTime;
        this.timeoutUnit = rxLocation.timeoutUnit;
    }
}
 
開發者ID:TechIsFun,項目名稱:RxJava2-weather-example,代碼行數:13,代碼來源:RxLocationBaseOnSubscribe.java

示例3: RxLocationBaseOnSubscribe

protected RxLocationBaseOnSubscribe(@NonNull RxLocation rxLocation, Long timeout, TimeUnit timeUnit) {
    this.ctx = rxLocation.ctx;
    this.services = new Api[]{ LocationServices.API, ActivityRecognition.API };
    this.scopes = null;

    if (timeout != null && timeUnit != null) {
        this.timeoutTime = timeout;
        this.timeoutUnit = timeUnit;
    } else {
        this.timeoutTime = rxLocation.timeoutTime;
        this.timeoutUnit = rxLocation.timeoutUnit;
    }
}
 
開發者ID:florent37,項目名稱:RxGps,代碼行數:13,代碼來源:RxLocationBaseOnSubscribe.java

示例4: BaseLocationObservable

protected BaseLocationObservable(Context ctx) {
    super(ctx, LocationServices.API);
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:3,代碼來源:BaseLocationObservable.java


注:本文中的com.google.android.gms.location.LocationServices.API屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。