0

I tried to follow the steps as stated here, https://github.com/RadiusNetworks/bluetooth-crash-resolver but couldn't succeed. I copied the file BluetoothCrashResolver.java from bluetooth package and pasted it in my codebase(src/main/myProject) and tried to use it in the following way in my MainActivity (Its just the ranging example from code altbeacon site).

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();
  1. The first error i get is that BlutoothCrashResolver cannot be resolved, that means my import is not right, i also had an import statement (import com.project.package.BluetoothCrashResolver;) at the top, but didnt work.

  2. If I somehow get it to work, where should i put this statement

    bluetoothCrashResolver.notifyScannedDevice(device, myLeScanCallback);

  3. And finally why is it happening for the beacon Ranging? Monitoring code worked fine for me. Is it specific to my device (LG Tab 7) or in general (I tried both the latest altbeacon arr files).

Special attention to @davidyoung. Some reflection on this topic will be highly appreciable.

rubikskube
  • 372
  • 1
  • 5
  • 22
  • It looks like you are trying to use the BluetoothCrashResolver with the Android Beacon Library. If so, it is already built-in and started automatically. Why do you need to do these manual steps? – davidgyoung Apr 03 '15 at 14:21
  • hej @davidyoung thanks for your reply, it is because I am getting a warning when I am trying to run the Ranging example code and "Log.i(TAG, "The first beacon I see is about "+beacons.iterator().next().getDistance()+" meters away.");" is not showing. The good thing is that the application is not crashing and it goes on performing leScan and detect my beacons in the logcat. Therefore I thought the problem is with BluetoothCrashResolver. Is there any other issue with the Ranging example Code that might stop me from ranging a beacon.. – rubikskube Apr 03 '15 at 14:32
  • You know the library only detects AltBeacons by default, yes? If you want to detect proprietary beacons, you must set a BeaconParser to do this. To see how others have done this, try doing a Google search for "setBeaconLayout" (include the quotes) and find the beacon layout expression for the type of beacon you have. – davidgyoung Apr 03 '15 at 14:38
  • Thank you very much @davidyoung, i tried to run just by copying your code before, I added the parser and its working now... thanks again – rubikskube Apr 03 '15 at 14:45
  • Glad you got it working. You should accept your own answer below so others see that this was the issue. – davidgyoung Apr 03 '15 at 15:08

1 Answers1

1

Finally got it working. It was just a silly mistake of not adding a beacon parser.

rubikskube
  • 372
  • 1
  • 5
  • 22