Closed NimaaZx closed 2 years ago
Thanks for this detailed report @NimaaZx . There are several distinct issues here so I may close this and open a few different issues to track them individually. Let me run some tests first with the reference app to see what I can reproduce.
ok. no problem. Thank You David. right now I use RangeNotifier .let me know If you need any other detail .
@NimaaZx after testing with the official reference app here, I am unable to reproduce either issue you report.
Here is my test setup:
I think the problems you describe are most likely application-specific problems caused by complexities of the Android lifecycle and perhaps having multiple ranged regions going at the same time.
A few tips for troubleshooting:
If you keep having trouble, please try to reproduce your issues with the reference app, making as few modifications as necessary to reproduce the problem. If you can reproduce the problem with the reference app, please create a new issue.
Redmi note 3 pro - AOSP Version 9.
'org.altbeacon:android-beacon-library:2.19.3'
Hey David. Thanks for improving your library. I have created another issue a year and half ago. I was familiar with your library. after updating to latest version , I saw you added observer and some new functions. You added them in "https://altbeacon.github.io/android-beacon-library/samples.html" , Ranging Example Code part.
so I decided to use them. but I guess there are bugs. I wanted to scan one time for 7 seconds and stop until I start again by button. this issue is not related to button function. when fragment oncreateview is loaded scanning is triggered (permission checked).
problem 1 : rangingObserver should be called once in each cycle of scanning as I found out . it is ok when I don't use stopRangingBeacons. each 7 seconds scaning is done. but if I put "stopRangingBeacons" end of observer scanning process not work properly. return list size 0 and it is called multiple times.
my Logs:
sometimes does not find anything , it does not show "in for loop" .
Problem 2 : after changing my fragment and back to scan fragment. Scanning failed and is not work at all. It seems " ranged regions" is not set.
your logs debug (debug:true) :
it may be useful , before using this new method I tried to use removeAllRangeNotifiers() and addRangeNotifier instead of observers . for each scanning cycle I called them . for scanning once and back to scan fragment, both problems that I said ,there was no problem . it was worked at least in android 9.
I don't know it is correct way to scanning or not.
my Logs:
I used it for start/stop scanning button too.