无法将蓝牙健身追踪器与Google Fit SDK连接

时间:2018-07-09 12:20:21

标签: android google-fit google-fit-sdk

每次我都找不到结果 还向它添加了失败侦听器,但从未调用

GoogleSignInAccount googleSigninAccount =GoogleSignIn.getLastSignedInAccount(this);
    int timeoutSecs = 12;
    List<DataType> list = Arrays.asList(DataType.TYPE_STEP_COUNT_DELTA);
    BleScanCallback bleScanCallbacks = new BleScanCallback() {
        @Override
        public void onDeviceFound(BleDevice device) {
            // A device that provides the requested data types is available
            tev.setText("Device found with: "+device.getName());
        }
        @Override
        public void onScanStopped() {
            // The scan timed out or was interrupted
            tev.setText("Nothing Found");
            pb.setVisibility(View.GONE);
        }
    };
    Task<Void> response = Fitness
            .getBleClient(this, googleSigninAccount)
            .startBleScan(list, timeoutSecs, bleScanCallbacks );
    response.addOnFailureListener(mFailureListener);
}

0 个答案:

没有答案