Android device can't scan beacon
up vote
0
down vote
favorite
I'm working on a simple beacon proximity app using AltBeacon library from here https://altbeacon.github.io/android-beacon-library/samples.html.
I am experimenting with the sample code provided on the above website, however, each time I run the app it only goes to addRangingNotifier()
method. If it detected the beacon it would go log the beacon size.
private Region defaultRegion = null;
defaultRegion = new Region("BeaconIdentifier", Identifier.fromUuid(java.util.UUID.fromString(UUID)), null, null);
beaconManager = BeaconManager.getInstanceForApplication(this);
beaconManager.getBeaconParsers().add(new BeaconParser().setBeaconLayout("m:2-3=0215,i:4-19,i:20-21,i:22-23,p:24-24"));
beaconManager.bind(this);
@Override
public void onBeaconServiceConnect() {
beaconManager.addRangeNotifier(new RangeNotifier() {
@Override
public void didRangeBeaconsInRegion(Collection<Beacon> beacons, Region region) {
if (beacons.size() > 0) {
Log.d("MainInfo","Beacon List Size " + beacons.size());
}else{
Log.d("MainInfo","Beacon Empty");
}
}
});
try {
beaconManager.startRangingBeaconsInRegion(defaultRegion);
} catch (RemoteException e) {}
}
I can receive the beacon size around of me.
I test the two device(A : Samsung galaxy J510-Marshmellow/B: Samsung galaxy J7-Nougat), B scan the beacon and print Beacon List Size, but, A can't scan the beacon and print Beacon Empty.
So I test same Marshmellow device, but I can't find it.
Are there any codes that should be added depending on the operating system?
android beacon
add a comment |
up vote
0
down vote
favorite
I'm working on a simple beacon proximity app using AltBeacon library from here https://altbeacon.github.io/android-beacon-library/samples.html.
I am experimenting with the sample code provided on the above website, however, each time I run the app it only goes to addRangingNotifier()
method. If it detected the beacon it would go log the beacon size.
private Region defaultRegion = null;
defaultRegion = new Region("BeaconIdentifier", Identifier.fromUuid(java.util.UUID.fromString(UUID)), null, null);
beaconManager = BeaconManager.getInstanceForApplication(this);
beaconManager.getBeaconParsers().add(new BeaconParser().setBeaconLayout("m:2-3=0215,i:4-19,i:20-21,i:22-23,p:24-24"));
beaconManager.bind(this);
@Override
public void onBeaconServiceConnect() {
beaconManager.addRangeNotifier(new RangeNotifier() {
@Override
public void didRangeBeaconsInRegion(Collection<Beacon> beacons, Region region) {
if (beacons.size() > 0) {
Log.d("MainInfo","Beacon List Size " + beacons.size());
}else{
Log.d("MainInfo","Beacon Empty");
}
}
});
try {
beaconManager.startRangingBeaconsInRegion(defaultRegion);
} catch (RemoteException e) {}
}
I can receive the beacon size around of me.
I test the two device(A : Samsung galaxy J510-Marshmellow/B: Samsung galaxy J7-Nougat), B scan the beacon and print Beacon List Size, but, A can't scan the beacon and print Beacon Empty.
So I test same Marshmellow device, but I can't find it.
Are there any codes that should be added depending on the operating system?
android beacon
Maybe worth checking that if the location permission is granted to the app on the phone?
– Ricky Mo
Nov 20 at 5:28
@RickyMo Of course that
– Polaris Nation
Nov 20 at 5:35
Did this solve the problem?
– davidgyoung
Nov 20 at 11:49
@davidgyoung yes. when I change dependencies { implementation 'org.altbeacon:android-beacon-library:2+' } to AAR file (in project structure and import aar file), it show the scan result. So now I can scan. Thank you for your answer
– Polaris Nation
Nov 21 at 8:35
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I'm working on a simple beacon proximity app using AltBeacon library from here https://altbeacon.github.io/android-beacon-library/samples.html.
I am experimenting with the sample code provided on the above website, however, each time I run the app it only goes to addRangingNotifier()
method. If it detected the beacon it would go log the beacon size.
private Region defaultRegion = null;
defaultRegion = new Region("BeaconIdentifier", Identifier.fromUuid(java.util.UUID.fromString(UUID)), null, null);
beaconManager = BeaconManager.getInstanceForApplication(this);
beaconManager.getBeaconParsers().add(new BeaconParser().setBeaconLayout("m:2-3=0215,i:4-19,i:20-21,i:22-23,p:24-24"));
beaconManager.bind(this);
@Override
public void onBeaconServiceConnect() {
beaconManager.addRangeNotifier(new RangeNotifier() {
@Override
public void didRangeBeaconsInRegion(Collection<Beacon> beacons, Region region) {
if (beacons.size() > 0) {
Log.d("MainInfo","Beacon List Size " + beacons.size());
}else{
Log.d("MainInfo","Beacon Empty");
}
}
});
try {
beaconManager.startRangingBeaconsInRegion(defaultRegion);
} catch (RemoteException e) {}
}
I can receive the beacon size around of me.
I test the two device(A : Samsung galaxy J510-Marshmellow/B: Samsung galaxy J7-Nougat), B scan the beacon and print Beacon List Size, but, A can't scan the beacon and print Beacon Empty.
So I test same Marshmellow device, but I can't find it.
Are there any codes that should be added depending on the operating system?
android beacon
I'm working on a simple beacon proximity app using AltBeacon library from here https://altbeacon.github.io/android-beacon-library/samples.html.
I am experimenting with the sample code provided on the above website, however, each time I run the app it only goes to addRangingNotifier()
method. If it detected the beacon it would go log the beacon size.
private Region defaultRegion = null;
defaultRegion = new Region("BeaconIdentifier", Identifier.fromUuid(java.util.UUID.fromString(UUID)), null, null);
beaconManager = BeaconManager.getInstanceForApplication(this);
beaconManager.getBeaconParsers().add(new BeaconParser().setBeaconLayout("m:2-3=0215,i:4-19,i:20-21,i:22-23,p:24-24"));
beaconManager.bind(this);
@Override
public void onBeaconServiceConnect() {
beaconManager.addRangeNotifier(new RangeNotifier() {
@Override
public void didRangeBeaconsInRegion(Collection<Beacon> beacons, Region region) {
if (beacons.size() > 0) {
Log.d("MainInfo","Beacon List Size " + beacons.size());
}else{
Log.d("MainInfo","Beacon Empty");
}
}
});
try {
beaconManager.startRangingBeaconsInRegion(defaultRegion);
} catch (RemoteException e) {}
}
I can receive the beacon size around of me.
I test the two device(A : Samsung galaxy J510-Marshmellow/B: Samsung galaxy J7-Nougat), B scan the beacon and print Beacon List Size, but, A can't scan the beacon and print Beacon Empty.
So I test same Marshmellow device, but I can't find it.
Are there any codes that should be added depending on the operating system?
android beacon
android beacon
edited Nov 20 at 5:36
asked Nov 20 at 2:34
Polaris Nation
139117
139117
Maybe worth checking that if the location permission is granted to the app on the phone?
– Ricky Mo
Nov 20 at 5:28
@RickyMo Of course that
– Polaris Nation
Nov 20 at 5:35
Did this solve the problem?
– davidgyoung
Nov 20 at 11:49
@davidgyoung yes. when I change dependencies { implementation 'org.altbeacon:android-beacon-library:2+' } to AAR file (in project structure and import aar file), it show the scan result. So now I can scan. Thank you for your answer
– Polaris Nation
Nov 21 at 8:35
add a comment |
Maybe worth checking that if the location permission is granted to the app on the phone?
– Ricky Mo
Nov 20 at 5:28
@RickyMo Of course that
– Polaris Nation
Nov 20 at 5:35
Did this solve the problem?
– davidgyoung
Nov 20 at 11:49
@davidgyoung yes. when I change dependencies { implementation 'org.altbeacon:android-beacon-library:2+' } to AAR file (in project structure and import aar file), it show the scan result. So now I can scan. Thank you for your answer
– Polaris Nation
Nov 21 at 8:35
Maybe worth checking that if the location permission is granted to the app on the phone?
– Ricky Mo
Nov 20 at 5:28
Maybe worth checking that if the location permission is granted to the app on the phone?
– Ricky Mo
Nov 20 at 5:28
@RickyMo Of course that
– Polaris Nation
Nov 20 at 5:35
@RickyMo Of course that
– Polaris Nation
Nov 20 at 5:35
Did this solve the problem?
– davidgyoung
Nov 20 at 11:49
Did this solve the problem?
– davidgyoung
Nov 20 at 11:49
@davidgyoung yes. when I change dependencies { implementation 'org.altbeacon:android-beacon-library:2+' } to AAR file (in project structure and import aar file), it show the scan result. So now I can scan. Thank you for your answer
– Polaris Nation
Nov 21 at 8:35
@davidgyoung yes. when I change dependencies { implementation 'org.altbeacon:android-beacon-library:2+' } to AAR file (in project structure and import aar file), it show the scan result. So now I can scan. Thank you for your answer
– Polaris Nation
Nov 21 at 8:35
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
The most likely thing wrong is that the UUID specified does not match your beacon. Try replacing this code:
Identifier.fromUuid(java.util.UUID.fromString(UUID))
With
null
To match all beacons. If this fixes it, replace the UUID with the one you are out of the detected beacon.
Ok I'll test it. but I suggest why B device can scan it, but A device can't scan it. If UUID is wrong, I guess B device also can't scan it.
– Polaris Nation
Nov 20 at 5:00
defaultRegion = new Region("BeaconIdentifier", null, null, null); but still can't scan..
– Polaris Nation
Nov 20 at 5:37
I test another C device (API 24, Marshmellow, galaxy J7 2016), but still can't
– Polaris Nation
Nov 20 at 5:38
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
The most likely thing wrong is that the UUID specified does not match your beacon. Try replacing this code:
Identifier.fromUuid(java.util.UUID.fromString(UUID))
With
null
To match all beacons. If this fixes it, replace the UUID with the one you are out of the detected beacon.
Ok I'll test it. but I suggest why B device can scan it, but A device can't scan it. If UUID is wrong, I guess B device also can't scan it.
– Polaris Nation
Nov 20 at 5:00
defaultRegion = new Region("BeaconIdentifier", null, null, null); but still can't scan..
– Polaris Nation
Nov 20 at 5:37
I test another C device (API 24, Marshmellow, galaxy J7 2016), but still can't
– Polaris Nation
Nov 20 at 5:38
add a comment |
up vote
0
down vote
The most likely thing wrong is that the UUID specified does not match your beacon. Try replacing this code:
Identifier.fromUuid(java.util.UUID.fromString(UUID))
With
null
To match all beacons. If this fixes it, replace the UUID with the one you are out of the detected beacon.
Ok I'll test it. but I suggest why B device can scan it, but A device can't scan it. If UUID is wrong, I guess B device also can't scan it.
– Polaris Nation
Nov 20 at 5:00
defaultRegion = new Region("BeaconIdentifier", null, null, null); but still can't scan..
– Polaris Nation
Nov 20 at 5:37
I test another C device (API 24, Marshmellow, galaxy J7 2016), but still can't
– Polaris Nation
Nov 20 at 5:38
add a comment |
up vote
0
down vote
up vote
0
down vote
The most likely thing wrong is that the UUID specified does not match your beacon. Try replacing this code:
Identifier.fromUuid(java.util.UUID.fromString(UUID))
With
null
To match all beacons. If this fixes it, replace the UUID with the one you are out of the detected beacon.
The most likely thing wrong is that the UUID specified does not match your beacon. Try replacing this code:
Identifier.fromUuid(java.util.UUID.fromString(UUID))
With
null
To match all beacons. If this fixes it, replace the UUID with the one you are out of the detected beacon.
answered Nov 20 at 3:39
davidgyoung
48.1k1075137
48.1k1075137
Ok I'll test it. but I suggest why B device can scan it, but A device can't scan it. If UUID is wrong, I guess B device also can't scan it.
– Polaris Nation
Nov 20 at 5:00
defaultRegion = new Region("BeaconIdentifier", null, null, null); but still can't scan..
– Polaris Nation
Nov 20 at 5:37
I test another C device (API 24, Marshmellow, galaxy J7 2016), but still can't
– Polaris Nation
Nov 20 at 5:38
add a comment |
Ok I'll test it. but I suggest why B device can scan it, but A device can't scan it. If UUID is wrong, I guess B device also can't scan it.
– Polaris Nation
Nov 20 at 5:00
defaultRegion = new Region("BeaconIdentifier", null, null, null); but still can't scan..
– Polaris Nation
Nov 20 at 5:37
I test another C device (API 24, Marshmellow, galaxy J7 2016), but still can't
– Polaris Nation
Nov 20 at 5:38
Ok I'll test it. but I suggest why B device can scan it, but A device can't scan it. If UUID is wrong, I guess B device also can't scan it.
– Polaris Nation
Nov 20 at 5:00
Ok I'll test it. but I suggest why B device can scan it, but A device can't scan it. If UUID is wrong, I guess B device also can't scan it.
– Polaris Nation
Nov 20 at 5:00
defaultRegion = new Region("BeaconIdentifier", null, null, null); but still can't scan..
– Polaris Nation
Nov 20 at 5:37
defaultRegion = new Region("BeaconIdentifier", null, null, null); but still can't scan..
– Polaris Nation
Nov 20 at 5:37
I test another C device (API 24, Marshmellow, galaxy J7 2016), but still can't
– Polaris Nation
Nov 20 at 5:38
I test another C device (API 24, Marshmellow, galaxy J7 2016), but still can't
– Polaris Nation
Nov 20 at 5:38
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53385394%2fandroid-device-cant-scan-beacon%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Maybe worth checking that if the location permission is granted to the app on the phone?
– Ricky Mo
Nov 20 at 5:28
@RickyMo Of course that
– Polaris Nation
Nov 20 at 5:35
Did this solve the problem?
– davidgyoung
Nov 20 at 11:49
@davidgyoung yes. when I change dependencies { implementation 'org.altbeacon:android-beacon-library:2+' } to AAR file (in project structure and import aar file), it show the scan result. So now I can scan. Thank you for your answer
– Polaris Nation
Nov 21 at 8:35