当前位置: 首页>>代码示例>>Java>>正文


Java LocationRequest.PRIORITY_HIGH_ACCURACY属性代码示例

本文整理汇总了Java中com.google.android.gms.location.LocationRequest.PRIORITY_HIGH_ACCURACY属性的典型用法代码示例。如果您正苦于以下问题:Java LocationRequest.PRIORITY_HIGH_ACCURACY属性的具体用法?Java LocationRequest.PRIORITY_HIGH_ACCURACY怎么用?Java LocationRequest.PRIORITY_HIGH_ACCURACY使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在com.google.android.gms.location.LocationRequest的用法示例。


在下文中一共展示了LocationRequest.PRIORITY_HIGH_ACCURACY属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setLocationPriority

@ReactMethod
public void setLocationPriority(int mLocationPriority) {
    switch (mLocationPriority) {
        case 0:
            this.mLocationPriority = LocationRequest.PRIORITY_HIGH_ACCURACY;
            break;
        case 1:
            this.mLocationPriority = LocationRequest.PRIORITY_BALANCED_POWER_ACCURACY;
            break;
        case 2:
            this.mLocationPriority = LocationRequest.PRIORITY_LOW_POWER;
            break;
        case 3:
            this.mLocationPriority = LocationRequest.PRIORITY_NO_POWER;
            break;
    }
}
 
开发者ID:MustansirZia,项目名称:react-native-fused-location,代码行数:17,代码来源:FusedLocationModule.java

示例2: onStartCommand

@Override
public int onStartCommand(Intent intent, int flags, int startId) {
    mLocationClient = new GoogleApiClient.Builder(this)
            .addConnectionCallbacks(this)
            .addOnConnectionFailedListener(this)
            .addApi(LocationServices.API)
            .build();

    mLocationRequest.setInterval(Constants.LOCATION_INTERVAL);
    mLocationRequest.setFastestInterval(Constants.FASTEST_LOCATION_INTERVAL);

    int priority = LocationRequest.PRIORITY_HIGH_ACCURACY;

    mLocationRequest.setPriority(priority);
    mLocationClient.connect();

    return START_STICKY;
}
 
开发者ID:kev5,项目名称:GoMeet,代码行数:18,代码来源:LocationMonitoringService.java

示例3: setup

public void setup(final Callback successCallback, final Callback errorCallback,
                  final int interval, final boolean requestHighAccuracy) {
    mInterval = interval;
    mErrorCallback = errorCallback;
    mSuccessCallback = successCallback;

    if (requestHighAccuracy) {
        mAccuracy = LocationRequest.PRIORITY_HIGH_ACCURACY;
    } else {
        mAccuracy = LocationRequest.PRIORITY_BALANCED_POWER_ACCURACY;
    }
}
 
开发者ID:philiWeitz,项目名称:react-native-location-switch,代码行数:12,代码来源:LocationSwitch.java


注:本文中的com.google.android.gms.location.LocationRequest.PRIORITY_HIGH_ACCURACY属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。