Ich benutze Radius-Netzwerke altbeacon Bibliothek in meiner Android-App, aber wenn ich altbeacon von App zu lokalisieren, kann meine Anwendung nicht die altbeacon erkennen.Kann nicht Alt-Beacon in Android
Das ist mein Leuchtfeuer-Parser: -
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"));
Das ist mein Android Studio Logcat: -
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
wenn ich altbeacon von orten app in meinem iPhone die folgenden Code wird gedruckt in logcat übertragen viele Male für meine Android-App, aber das Hauptanliegen ist, didRangeBeaconsInRegion() Funktion wird nie aufgerufen, und mein Code in der Funktion wird nicht ausgeführt, dh meine Android-App kann AltBeacon (Übertragung von Ort app in myiphone) erkennen: -
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}
Und ich bin mit folgenden Abhängigkeiten in android gradle: -
compile 'org.altbeacon:android-beacon-library:2.7'
Einige weitere Code: -
@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);
}
Und meine Hauptklasse implementiert BeaconConsumer, RangeNotifier.
Sind Sie sicher, dass Sie altbeacon auf der Senderseite von Locate ausgewählt haben? Die Protokolle deuten darauf hin, dass Ihre App iBeacon überträgt. Hast du mehr als ein Leuchtfeuer? – davidgyoung
sir, über welchen Parameter Sie entschieden haben, dass meine App ibeacon überträgt ... und mein Problem gelöst ist, musste ich ibeacon Parser im Code hinzufügen ... und noch eine Sache Sir, findet App auf meinem iPhone, wir sehen anders Beacon-Typen zu übertragen, tut alles über ibeacon, denn wenn ich Radius-Netzwerke Beacon aus der App übertragen musste ich Ibeacon Parser hinzufügen, um es zu erkennen, ist nicht die Radius-Netzwerke beacon (altbeacon) anders als ibeacon. –