问题
I stuck implementing simple Beacon monitor with AltBeacon library using its examples. In short: I took its reference application, downloaded and integrated its latest build and run app on my Samsung Galaxy S2 with CM (Android 4.4.4). I see that onBeaconServiceConnect callback never called, though bindService is called. I believe onBeaconServiceConnect should be called in order application to work correctly.
I've tried to set beaconManager.debug = true; but it didn't show me any new logs (maybe because I'm using precompiled libraries from site).
Also I've checked if the problem with my firmware/hardware - but I see it's able to monitor beacons with other applications from Google Play. I have iPhone and MacBook and one more android device so I can simulate any transmitting signal which is needed to let AltBeacon catch it.
Can someone help me? I would appreciate any clue you give me!
回答1:
A failure to receive a callback to onBeaconServiceConnect
is usually caused by an incorrect AndroidManifest.xml
setup to declare the BeaconService
. The library uses manifest merging to automatically merge these definitions into your app's AndroidManifest.xml
from the library's AndroidManifest.xml
at compile time. If manifest merging is not enabled, the service will never be declared and the app will not get the onBeaconServiceConnect
callback.
If using Eclipse, check your project.properties file and make sure it has the line: manifestmerger.enabled=true
.
If this does not solve your problem, please post the code that binds to the BeaconService
and let us know the IDE you are using.
来源:https://stackoverflow.com/questions/25580657/altbeacon-onbeaconserviceconnect-not-called