本文整理汇总了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;
}
示例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;
}
}
示例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;
}
}
示例4: BaseLocationObservable
protected BaseLocationObservable(Context ctx) {
super(ctx, LocationServices.API);
}