当前位置: 首页>>代码示例>>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;未经允许,请勿转载。