0

I am trying to transmit iBeacon using Android Beacon Library but I am not sure if my code is right. I use app like nRF Master Control Panel to verify if it is transmitting as iBeacon but it doesn't seem to do that.

Below is my code

Beacon beacon = new Beacon.Builder()
                        .setId1("6fb0e0e9-2ae6-49d3-bba3-3cb7698c77e2")
                        .setId2(Integer.toString(minor1))
                        .setId3(Integer.toString(minor2))
                        .setManufacturer(0x0000)
                        .setTxPower(-59)
                        .setDataFields(Arrays.asList(new Long[] {0l}))
                        .build();
                BeaconParser beaconParser = new BeaconParser()
                        .setBeaconLayout("m:2-3=0215,i:4-19,i:20-21,i:22-23,p:24-24");
                BeaconTransmitter beaconTransmitter = new BeaconTransmitter(getApplicationContext(), beaconParser);
                beaconTransmitter.startAdvertising(beacon);
            }
        });

Thanks!

Helmi
  • 33
  • 1
  • 10
  • change .setManufacturer(0x0000) to .setManufacturer(0x4c00), where 0x4C00 is apple compant ID – Jaycee May 05 '20 at 06:58

1 Answers1

0

The code looks correct. A few tips:

  1. Make sure Bluetooth is turned on.
  2. Verify your device supports transmission. Check the list here http://altbeacon.github.io/android-beacon-library/beacon-transmitter-devices.html
  3. Make this call to test if it is supported:

    int result = BeaconTransmitter.checkTransmissionSupported(context);
    

If the device supports transmission, the method returns BeaconTransmitter.SUPPORTED. It may also return:

    NOT_SUPPORTED_MIN_SDK
    NOT_SUPPORTED_BLE
    NOT_SUPPORTED_MULTIPLE_ADVERTISEMENTS (deprecated)
    NOT_SUPPORTED_CANNOT_GET_ADVERTISER_MULTIPLE_ADVERTISEMENTS
    NOT_SUPPORTED_CANNOT_GET_ADVERTISER

The NOT_SUPPORTED_CANNOT_GET_ADVERTISER_MULTIPLE_ADVERTISEMENTS, NOT_SUPPORTED_MULTIPLE_ADVERTISEMENTS and NOT_SUPPORTED_CANNOT_GET_ADVERTISER return typically indicates that the device either does not have a compatible chipset, or the manufacturer has not implemented the driver support required by Google for the Android 5.x BLE transmission APIs.

davidgyoung
  • 63,876
  • 14
  • 121
  • 204
  • Hi @davidgyoung. I have followed all your suggestions and it looks good. Other apps on other phones like nRF Master Control Panel or LightBlue can detect that the beacon is being transmitted. I guess my hardware device that suppose to detect the beacon is not detecting it. I will check with my engineer on that. Thanks! – Helmi Aug 10 '16 at 01:37
  • @davidgyoung My device supports beacon transmission , Bluetooth is on and code is same , but my beacon is detected in locate but not in beacon tools or in nearby (Google ) app – Pratik Vyas Jul 19 '17 at 09:37