Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/181.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 无法将Bluetooth fitness tracker与google fit sdk连接_Android_Google Fit_Google Fit Sdk - Fatal编程技术网

Android 无法将Bluetooth fitness tracker与google fit sdk连接

Android 无法将Bluetooth fitness tracker与google fit sdk连接,android,google-fit,google-fit-sdk,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 bleScanCall

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

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);
}
GoogleSignInAccount GoogleSignInAccount=GoogleSignIn.getLastSignedAccount(此);
int timeoutSecs=12;
List List=Arrays.asList(DataType.TYPE\u STEP\u COUNT\u DELTA);
BleScanCallback bleScanCallbacks=新的BleScanCallback(){
@凌驾
公用无效onDeviceFound(BleDevice){
//提供请求的数据类型的设备可用
tev.setText(“通过以下方式找到的设备:“+Device.getName()”);
}
@凌驾
已停止的公共void(){
//扫描超时或被中断
tev.setText(“未找到任何内容”);
pb.setVisibility(View.GONE);
}
};
任务响应=适应度
.getBleClient(此,谷歌登录帐户)
.startBleScan(列表、超时秒数、BLEScan回调);
addOnFailureListener(mFailureListener);
}

能否详细说明“未找到结果”。这是否意味着您没有收到任何回调?BleScanCallback在12秒后调用,但onDeviceFound()从未在每次调用OnScanStop()时调用,因此我收到了“未发现”的消息。我不确定您面临的错误是什么,但为了帮助您更好地了解蓝牙,请尝试访问上的文档。从那里,您可以找到示例代码作为参考。此外,让您的软件和应用程序保持最新。然后,检查蓝牙的固件更新。要查看详细步骤,请检查。好的,谢谢,但根据官方文件,我有,但无法搜索我的设备。hi@MuhammadAqeel,你找到答案了吗?