내 안드로이드 애플 리케이션에서 Radius 네트워크 altbeacon 라이브러리를 사용하고 있습니다. 그러나 앱 찾기에서 altbeacon을 방송 할 때마다 내 앱은 altbeacon을 감지하지 못합니다.안드로이드에서 Alt- 비컨을 감지 할 수 없습니다.
이 내 비콘 파서는 : - : 나는 아래의 코드가 로그 캣에 인쇄 된 내 아이폰에서 응용 프로그램을 찾을에서 altbeacon를 전송할 때마다
06-11 11:43:45.239 15797-16636/optimus.com.optimusiothome D/BeaconParser:Ignoring pdu type 01
06-11 11:43:45.239 15797-16636/optimus.com.optimusiothome D/BeaconParser: Processing pdu type FF: 02011a1aff4c0002152f234454cf6d4a0fadf2f4911ba9ffa600000000c50000000000000000000000000000000000000000000000000000000000000000 with startIndex: 5, endIndex: 29
06-11 11:43:45.239 15797-16636/optimus.com.optimusiothome D/BeaconParser: This is not a matching Beacon advertisement. (Was expecting be ac. The bytes I see are: 02011a1aff4c0002152f234454cf6d4a0fadf2f4911ba9ffa600000000c50000000000000000000000000000000000000000000000000000000000000000
-
mBeaconManager.getBeaconParsers().add(new BeaconParser().setBeaconLayout("m:2-3=beac,i:4-19,i:20-21,i:22-23,p:24-24,d:25-25"));
이 내 인조 STUDIO의 로그 캣입니다 내 안드로이드 애플 리케이션을위한 여러 번,하지만 주요 관심사는 didRangeBeaconsInRegion() 함수가 호출되지 않으며, 함수 내 코드가 실행되지 않는다는 것입니다. 즉, 안드로이드 앱이 altbeacon (myiphone의 locate 앱에서 전송)을 감지 할 수 없습니다. -
06-11 11:44:38.669 18053-18072/optimus.com.optimusiothome D/ScanRecord: parseFromBytes
06-11 11:44:38.669 18053-18072/optimus.com.optimusiothome D/ScanRecord: first manudata for manu ID
06-11 11:44:38.669 18053-18072/optimus.com.optimusiothome D/BluetoothLeScanner: onScanResult() - ScanResult{mDevice=69:86:DE:DD:64:1D, mScanRecord=ScanRecord [mAdvertiseFlags=26, mServiceUuids=null, mManufacturerSpecificData={76=[2, 21, 47, 35, 68, 84, -49, 109, 74, 15, -83, -14, -12, -111, 27, -87, -1, -90, 0, 0, 0, 0, -59]}, mServiceData={}, mTxPowerLevel=-2147483648, mDeviceName=null], mRssi=-55, mTimestampNanos=97773873478375}
내가 안드로이드 Gradle을에 다음과 같은 의존성을 사용하고 있습니다 : -
compile 'org.altbeacon:android-beacon-library:2.7'
좀 더 코드 : -
@Override
public void onBeaconServiceConnect() {
Region region = new Region("all-beacon-region",null,null,null);
// this tells the library that we want to know about any beacon we see.
try {
mBeaconManager.startMonitoringBeaconsInRegion(region);
} catch (RemoteException e) {
e.printStackTrace();
}
//The last line sets the rangeNotifier to this class,
//so our the same RangingActivity class will get callbacks each time a beacon is seen.
mBeaconManager.setRangeNotifier(this);
}
@Override
public void didRangeBeaconsInRegion(Collection<Beacon> collection, Region region) {
for(Beacon beacon : collection)
{
Log.d(TAG, "Beacon detected with id1: " + beacon.getId1() + " id2:" + beacon.getId2() + " id3: " + beacon.getId3() + " distance: " + beacon.getDistance());
((TextView)beacon_transmit_detect.this.findViewById(R.id.message)).setText("Beacon detected with id1: " + beacon.getId1() + " id2:" + beacon.getId2() + " id3: " + beacon.getId3() + " distance: " + beacon.getDistance());
}
}
@Override
protected void onResume()
{
super.onResume();
mBeaconManager=BeaconManager.getInstanceForApplication(this.getApplicationContext());
mBeaconManager.getBeaconParsers().add(new BeaconParser().setBeaconLayout("m:2-3=beac,i:4-19,i:20-21,i:22-23,p:24-24,d:25-25"));
mBeaconManager.bind(this);
}
그리고 내 메인 클래스가 BeaconConsumer, RangeNotifier 구현합니다.
Locate? 송신기 측에서 altbeacon을 선택 했습니까? 로그는 앱이 iBeacon을 전송하고 있음을 나타냅니다. 주변에 하나 이상의 표지가 있습니까? – davidgyoung
각하 매개 변수를 통해 내 앱이 ibeacon을 전송한다고 결정했으며 .... 내 문제가 해결되었습니다. 코드에 ibeacon 파서를 추가해야했습니다 ... 그리고 한 가지 더 선생님, 내 아이폰에서 앱을 찾습니다. 모든 비컨 유형을 전송할 때, iBeacon을 파서를 추가해야하는 앱에서 반경 네트워크 비콘을 전송할 때 ibeacon과 다른 반경 네트워크 비콘 (altbeacon)이 아니기 때문에 모든 비컨을 전송합니다. –