bluetooth lowenergy - Using Android Beacon Library to transmit as iBeacon -


i trying transmit ibeacon using android beacon library not sure if code right. use app nrf master control panel verify if transmitting ibeacon doesn't seem that.

below 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!

the code looks correct. few tips:

  1. make sure bluetooth turned on.
  2. verify device supports transmission. check list here http://altbeacon.github.io/android-beacon-library/beacon-transmitter-devices.html
  3. make call test if supported:

    int result = beacontransmitter.checktransmissionsupported(context); 

if device supports transmission, method returns beacontransmitter.supported. may 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 , not_supported_cannot_get_advertiser return typically indicates device either not have compatible chipset, or manufacturer has not implemented driver support required google android 5.x ble transmission apis.


Comments

Popular posts from this blog

Spring Boot + JPA + Hibernate: Unable to locate persister -

go - Golang: panic: runtime error: invalid memory address or nil pointer dereference using bufio.Scanner -

c - double free or corruption (fasttop) -