本文整理匯總了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);
}