我尝试按照此处所述的步骤进行操作,https://github.com/RadiusNetworks/bluetooth-crash-resolver但未能成功。我从蓝牙包中复制了文件 BluetoothCrashResolver.java 并将其粘贴到我的代码库(src/main/myProject)中,并尝试在我的 MainActivity 中以下列方式使用它(它只是代码 altbeacon 站点的范围示例)。
public class RangingActivity extends Activity implements BeaconConsumer {
protected static final String TAG = "RAAAAAAAAAAAAANNNNNNNNGGGGEEEEE";
private BeaconManager beaconManager;
private BlutoothCrashResolver bluetoothCrashResolver=null;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_ranging);
bluetoothCrashResolver = new BlutoothCrashResolver(this.getApplicationContext());
bluetoothCrashResolver.start();
我得到的第一个错误
BlutoothCrashResolver
是无法解决,这意味着我的导入不正确,我import com.project.package.BluetoothCrashResolver;
在顶部也有一个导入语句(),但没有工作。如果我以某种方式让它工作,我应该把这个声明放在哪里
bluetoothCrashResolver.notifyScannedDevice(设备,myLeScanCallback);
最后,为什么信标测距会发生这种情况?监控代码对我来说效果很好。它是特定于我的设备(LG Tab 7)还是一般(我尝试了最新的 altbeacon arr 文件)。
特别注意@davidyoung。对这个主题的一些思考将是非常可观的。