Giter Club home page Giter Club logo

android-ibeacon-service's People

Contributors

andrewreitz avatar csexton avatar cupakromer avatar davidgyoung avatar keremgocen avatar krossovochkin avatar mattwritescode avatar waded avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

android-ibeacon-service's Issues

Android Studio TroubleShooting

Hi ,
Followed your troubleshooting section for Android Studio:
I am using Open Source Android iBeacon Library in the project ,Version of library 0.7.6.

Some change is required in that section
In app.iml file ,Change the line
"
to
"
"
Otherwise classes will not resolve properly in the Android Studio and IDE Will not able to resolve symbols for Ibeacons

Request for more documentation on scan behavior

Thanks for sharing your library on http://stackoverflow.com/questions/17875430/combine-ibeacon-bluetooth-low-energy-with-android-4-3

I analysed your code. I was interested in how often you scan. It seems like, you do some polling and you have 5 minute break between each scanning. So devices, that appear and disappear in that time aren't recognized?

Thanks for providing your experience in the documentation of your code. Like about how much advertising is lost during restart at a certain SCAN_PERIOD.

However, why do you need to restart scaning each 1100 ms (I do 2100 ms for different kind of devices by the way)? Do you need constantly updates like signal strength? If this isn't the case, you could just scan your 30sec without restart.

Gives NullPointerException in IBeaconManager checkAvailability() method

I am developing one application with Ibeacons in android, I am facing an issue with verifying bluetooth low energy is available on device or not. For that, I used method of IbeaconManager class "checkAvailability()". But whenever I call this method, it instantly gives me exception for NullPointer, I checked that my IBeaconManager object is not null. but not sure, where the error is.

Can you help me to resolve this bug or I may be doing anything wrong in the flow?

use gradle

I want to use this service for an app - part of the ground-work I just did is to gradle-I-fy all this stuff here and do some clean-up - you can find that here:

https://github.com/ligi/android-ibeacon-service
https://github.com/ligi/android-ibeacon-reference

another thing is that I released the service as a jar ( it does not have to be a library-project as it is at the moment):

https://github.com/ligi/android-ibeacon-service/releases/tag/v1.0

perhaps you want to use some of this stuff

Problems with unbinding

There seem to be some issues with properly unbinding: even after calling the IBeaconManager.unbind() method, the background service still does scans and does not always stop (probably race condition).

Situation:

  1. In onPause() I set the background mode:
if (mBeaconManager.isBound(this)) mBeaconManager.setBackgroundMode(this, true);
  1. In onStop() I unbind:
 mBeaconManager.unBind(this);

Due to the fact that when stopping the app, it first starts the background mode, probably goes to sleep for 1s and does not do any checks for state or existing Consumers.

[Feature] Add advertising support

It would be awesome (and more complete) if this project would enable android users to also emit iBeacon data, in other words: enable advertising.

This would include the methods startAdvertising, stopAdvertising and the property isAdvertising. More info can be found here: https://developer.apple.com/library/ios/documentation/CoreBluetooth/Reference/CBPeripheralManager_Class/Reference/CBPeripheralManager.html#//apple_ref/occ/instp/CBPeripheralManager/isAdvertising

Keep up the great work guys!

IBeaconManager.checkAvailability() seems inconsistent.

The IBeaconManager.checkAvailability() method does not seem to be consistent with its documentation. In the event that that OS build is insufficient false is returned rather than throwing a BLE exception would be indicated. As implemented this method can't be used to reliably craft UI based on the availability of BLE because on inadequate OS builds the result can't be distinguished from BLE being temporarily unavailable.

Does Android BLE scanner ask scan response by default?

Hi~I'm using Nexus 5 to test AltBeacon and I find that the length of byte[] scanRecord is 62. The BLE spec says that max length of advertisement data is 31 bytes. Does it mean that Android ask scan response by default when it is scanning?

Thank you~

Cordova Plugin tweak

I've used a fork of this project to build the Android side of a Cordova/PhoneGap plugin. As I included the code in the project rather than include a jar I had one minor edit to make which is not essential to the project at all to remove the Build version log comment being generated. I'm just wondering if this can be altered in the original code to make it easier for me and maybe others to keep up to date with this project?

Here's my tweak: mrtree1@bf86d23

Here's the plugin: https://github.com/petermetz/cordova-plugin-ibeacon

Service not closing properly

Hi,
I am using your library to develop an Application. I have performed some current drain measurement and found the following results on Samsung SIII:
Bluetooth scan in foreground 66 mA
Bluetooth scan in background 16mA
I have bound IBeaconManager to an intent service. I noticed that after calling the onDestroy method of the IntentService:

public void onDestroy(){

    Log.d(ConstantsDecoder.LOGTAG,"INTENT SERVICE BT ON DESTROY()");
    super.onDestroy();
    if(ConstantsDecoder.isBT_ON() && iBeaconManager!=null) {
        try {
            iBeaconManager.stopRangingBeaconsInRegion(region);
            } catch (RemoteException e) {
        // TODO Auto-generated catch block
                e.printStackTrace();
            }
        if (iBeaconManager.isBound(this))
            iBeaconManager.unBind(this);
    }
}

The Bluetooth service remains in some way active I see this log continuously :

D/BtGatt.btif(3092): btif_gattc_upstreams_evt: Event 4096

and the current consumption remains at 66mA.
Please, could you help?

Bluetooth crash recovery infinite loop on Galaxy S3

The crash recovery isn't working properly when testing on a Galaxy S3. When it crashes, the app tries to scan, it keeps logging Skipping scan because crash recovery is in progress infinitely. Quitting the app and launching it again fixes it.

This doesnt happen when testing on a Nexus 4.

screen shot 2014-05-14 at 5 23 33 pm

Region equals() method bug

In the method of class Region:

        public boolean equals(Object other) {
                 if (other instanceof Region) {
                        return ((Region)other).uniqueId == this.uniqueId;                         
                 }
                 return false;
        }

uniqueIds (which are Strings) are compared using '==' instead of .equals().
This will cause problems in collections (eg. removing from Map).

ConcurrentModificationException at IbeaconData

Hi, when the service runs for awhile, sometimes I get this Exception, I have 0.7.5 version

  E/AndroidRuntime(17077): FATAL EXCEPTION: main
  E/AndroidRuntime(17077): java.util.ConcurrentModificationException
  E/AndroidRuntime(17077): at java.util.HashMap$HashIterator.nextEntry(HashMap.java:806)
  E/AndroidRuntime(17077): at java.util.HashMap$KeyIterator.next(HashMap.java:833)
 E/AndroidRuntime(17077):   at com.radiusnetworks.ibeacon.service.IBeaconData.fromIBeacons(IBeaconData.java:43)
 E/AndroidRuntime(17077):   at com.radiusnetworks.ibeacon.service.RangingData.<init>(RangingData.java:42)
 E/AndroidRuntime(17077):   at com.radiusnetworks.ibeacon.service.IBeaconService.processRangeData(IBeaconService.java:466)
E/AndroidRuntime(17077):    at com.radiusnetworks.ibeacon.service.IBeaconService.finishScanCycle(IBeaconService.java:402)
E/AndroidRuntime(17077):    at com.radiusnetworks.ibeacon.service.IBeaconService.scheduleScanStop(IBeaconService.java:388)
E/AndroidRuntime(17077):    at com.radiusnetworks.ibeacon.service.IBeaconService.access$2(IBeaconService.java:375)
E/AndroidRuntime(17077):    at com.radiusnetworks.ibeacon.service.IBeaconService$3.run(IBeaconService.java:384)
E/AndroidRuntime(17077):    at android.os.Handler.handleCallback(Handler.java:730)
E/AndroidRuntime(17077):    at android.os.Handler.dispatchMessage(Handler.java:92)
E/AndroidRuntime(17077):    at android.os.Looper.loop(Looper.java:176)
E/AndroidRuntime(17077):    at android.app.ActivityThread.main(ActivityThread.java:5419)
E/AndroidRuntime(17077):    at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(17077):    at java.lang.reflect.Method.invoke(Method.java:525)
E/AndroidRuntime(17077):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1046)
E/AndroidRuntime(17077):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:862)

E/AndroidRuntime(17077): at dalvik.system.NativeStart.main(Native Method)

Apparent multiple callbacks after repetitive stop/start cycles

My app periodically fetches a new list of regions to monitor from my server, every 10 minutes or so (in case region configuration has been changed by the admin, which is not likely, but possible, so that usually the same set of regions is returned).

What I do when I get a new list of regions is to first stop ranging and monitoring everything currently monitored or ranged (exception handling removed for brevity):

for (Region r : iBeaconManager.getMonitoredRegions()) {
    iBeaconManager.stopMonitoringBeaconsInRegion(r);
}
for (Region r : iBeaconManager.getRangedRegions()) {
    iBeaconManager.stopRangingBeaconsInRegion(r);
}

And then I start monitoring the new set of regions with iBeaconManager.startMonitoringBeaconsInRegion(region) (my consumer automatically begins ranging a region when it is entered, via its monitoring callback)

What I am noticing is that after several cycles of stopping/starting monitoring the same set of regions, there appear to be in the log many instances of something generating LE scans. I see big blocks of debug like:

D/IBeaconService(29603): Waiting to start next bluetooth scan for another 1394 milliseconds
D/IBeaconService(29603): Waiting to start next bluetooth scan for another 1378 milliseconds
D/IBeaconService(29603): Waiting to start next bluetooth scan for another 1372 milliseconds
D/IBeaconService(29603): Waiting to start next bluetooth scan for another 1365 milliseconds
D/IBeaconService(29603): Waiting to start next bluetooth scan for another 1352 milliseconds
D/IBeaconService(29603): Waiting to start next bluetooth scan for another 1339 milliseconds
D/IBeaconService(29603): Waiting to start next bluetooth scan for another 1332 milliseconds
D/IBeaconService(29603): Waiting to start next bluetooth scan for another 1326 milliseconds
D/IBeaconService(29603): Waiting to start next bluetooth scan for another 1319 milliseconds
D/IBeaconService(29603): Waiting to start next bluetooth scan for another 1310 milliseconds
D/IBeaconService(29603): Waiting to start next bluetooth scan for another 1299 milliseconds
D/IBeaconService(29603): Waiting to start next bluetooth scan for another 1299 milliseconds

And other repetitive blocks such as

D/IBeaconIntentProcessor(29603): got ranging data
D/IBeaconIntentProcessor(29603): got an intent to process
D/RangingData(29603): parsing RangingData
D/RangingData(29603): parsing RangingData
D/IBeaconIntentProcessor(29603): got ranging data
D/IBeaconIntentProcessor(29603): got an intent to process
D/RangingData(29603): parsing RangingData
D/RangingData(29603): parsing RangingData
D/IBeaconIntentProcessor(29603): got ranging data
D/IBeaconIntentProcessor(29603): got an intent to process
D/RangingData(29603): parsing RangingData
D/RangingData(29603): parsing RangingData
D/IBeaconIntentProcessor(29603): got ranging data
....

I'm not sure if this is bad, because when multiple LE scans are initiated, all but the first notice the scan is already in progress, but I am concerned there are multiple callbacks from the service eating up memory and battery.

Bluetooth Share has Stopped / DeadObjectException

In some mobiles, particullary on Samsung phone, we have got constantlly this exception

01-29 13:17:57.969: E/BluetoothAdapter(25322): android.os.DeadObjectException
01-29 13:17:57.969: E/BluetoothAdapter(25322): at android.os.BinderProxy.transact(Native Method)
01-29 13:17:57.969: E/BluetoothAdapter(25322): at android.bluetooth.IBluetooth$Stub$Proxy.isEnabled(IBluetooth.java:745)
01-29 13:17:57.969: E/BluetoothAdapter(25322): at android.bluetooth.BluetoothAdapter.isEnabled(BluetoothAdapter.java:524)
01-29 13:17:57.969: E/BluetoothAdapter(25322): at com.radiusnetworks.ibeacon.service.IBeaconService.scanLeDevice(IBeaconService.java:365)
01-29 13:17:57.969: E/BluetoothAdapter(25322): at com.radiusnetworks.ibeacon.service.IBeaconService.finishScanCycle(IBeaconService.java:463)
01-29 13:17:57.969: E/BluetoothAdapter(25322): at com.radiusnetworks.ibeacon.service.IBeaconService.scheduleScanStop(IBeaconService.java:417)
01-29 13:17:57.969: E/BluetoothAdapter(25322): at com.radiusnetworks.ibeacon.service.IBeaconService.access$2(IBeaconService.java:403)
01-29 13:17:57.969: E/BluetoothAdapter(25322): at com.radiusnetworks.ibeacon.service.IBeaconService$3.run(IBeaconService.java:413)
01-29 13:17:57.969: E/BluetoothAdapter(25322): at android.os.Handler.handleCallback(Handler.java:730)
01-29 13:17:57.969: E/BluetoothAdapter(25322): at android.os.Handler.dispatchMessage(Handler.java:92)
01-29 13:17:57.969: E/BluetoothAdapter(25322): at android.os.Looper.loop(Looper.java:137)
01-29 13:17:57.969: E/BluetoothAdapter(25322): at android.app.ActivityThread.main(ActivityThread.java:5450)
01-29 13:17:57.969: E/BluetoothAdapter(25322): at java.lang.reflect.Method.invokeNative(Native Method)
01-29 13:17:57.969: E/BluetoothAdapter(25322): at java.lang.reflect.Method.invoke(Method.java:525)
01-29 13:17:57.969: E/BluetoothAdapter(25322): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1187)
01-29 13:17:57.969: E/BluetoothAdapter(25322): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)
01-29 13:17:57.969: E/BluetoothAdapter(25322): at dalvik.system.NativeStart.main(Native Method)

This cause frozen app and in sometimes system reboots.

How to turn Android device into an iBeacon?

I'm after turning my Android device into an iBeacon, and I hoped to use your library for this. Unfortunately I just read this page on which it says:

Unfortunately, it is not possible to make an iBeacon out of an Android device, because the Android Bluetooth LE APIs do not support the peripheral mode needed to send advertisement packets like in iBeacon.

Is there absolutely no way, also not by other libraries, to turn an Android device into an iBeacon?

iBeacon AD filter too strict

It looks like the advertisement filter was improved in d9c130f, but it is still too strict compared to iOS.

I created custom advertisement that left out the AD Flags entirely, and iOS still ranged the beacon successfully. I started with 1A FF 4C 00 02 15. You might want to scan the first few bytes scanData[0] to scanData[4] for the beginning of the iBeacon AD entry.

Sequent 'didExitRegion()' and 'didEnterRegion()' event occurrence

Hi. Actually, I'm developing a Data Crawler on Android for sensors, networks, bluetooth, etc for gathering user data on my research.
And I added iBeacon service lib into my project for capturing users' enter and leave events in a target region.

However, I encountered the problem.
Although I am in the range of Beacon (i.e., enterRegion), didExitRegion() and didEnterRegion() event occured while crawling the data.
So, event is follow.
{Enter-- (while crawling) -- Exit -> (after few seconds) Enter .... -> (while crawling) -> Exit -> (after few seconds) Enter}

So currently, I solved the problem by ignoring duplicate sequent Leave-Enter events.
But this is not a best solution but just a heuristic.

As a result of debugging, I think that the multiple use of BluetoothAdapter make a this problem. How to solve this issue in iBeacon lib?

Thank you.

iBeaconManager.getMonitoredRegions() gives back phantom regions

After several cycles of iBeaconManager.stopMonitoringBeaconsInRegion() and iBeaconManager.startMonitoringBeaconsInRegion() for the same 5 regions, iBeaconManager.getMonitoredRegions() gives back multiples of the same 5 regions.

My concern is this will run the android VM out of memory eventually for a long-running process. I have not yet verified if I am getting multiple callbacks for ranging/monitoring reports, but will check that next.

Here's a log of the action: https://gist.github.com/jamesfalkner/2899e2bbe708d60265bf

At the beginning of the log (line 1), you can see the app is monitoring 5 regions, and it cycles through each one and calls iBeaconManager.stopMonitoringBeaconsInRegion() for each one. So the app should not be monitoring any regions after this. Then on line 51 we start monitoring the same 5 regions with iBeaconManager.startMonitoringBeaconsInRegion(). Then at line 100 the LE scans begin. So all good so far.

Here's where it gets weird: At line 952, we do another set of calls to stop monitoring all regions, but instead of only 5 regions being "currently" monitored, iBeaconManager.getMonitoredRegions() gives back 10 regions (2 copies of the same 5 regions). After we stop monitoring all 10 regions, we do another round of iBeaconManager.startMonitoringBeaconsInRegion(), for the 5 regions we want to monitor. But then, in the next cycle (on line 2002), when we go to stop monitoring everything again, now iBeaconManager.getMonitoredRegions().size() reports 15 regions to stop! Line 3458 shows 20. And so on, it just keeps growing by multiples of 5.

Missing script/eclipse-support/

Compiling the current git HEAD fails because of a missing script/eclipse-support/ directory.

[pjb@mercure :0.0 src]$ git clone https://github.com/RadiusNetworks/android-ibeacon-service.git 
Cloning into 'android-ibeacon-service'...
remote: Counting objects: 674, done.        
remote: Compressing objects: 100% (320/320), done.        
remote: Total 674 (delta 301), reused 607 (delta 242)        
Receiving objects: 100% (674/674), 766.78 KiB | 520 KiB/s, done.
Resolving deltas: 100% (301/301), done.
[pjb@mercure :0.0 src]$ cd android-ibeacon-service/
[pjb@mercure :0.0 android-ibeacon-service]$ gradle -v

------------------------------------------------------------
Gradle 1.8
------------------------------------------------------------

Build time:   2013-09-24 07:32:33 UTC
Build number: none
Revision:     7970ec3503b4f5767ee1c1c69f8b4186c4763e3d

Groovy:       1.8.6
Ant:          Apache Ant(TM) version 1.9.2 compiled on July 8 2013
Ivy:          2.2.0
JVM:          1.7.0_45 (Oracle Corporation 24.45-b08)
OS:           Linux 3.2.0-4-amd64 amd64

[pjb@mercure :0.0 android-ibeacon-service]$ gradle 
:clean UP-TO-DATE
:compileLint
:copyDebugLint UP-TO-DATE
:mergeDebugProguardFiles
:packageDebugAidl UP-TO-DATE
:preBuild UP-TO-DATE
:preDebugBuild UP-TO-DATE
:prepareDebugDependencies
:compileDebugAidl
:compileDebugRenderscript
:generateDebugBuildConfig
:mergeDebugAssets
:mergeDebugResources
:processDebugManifest
:processDebugResources
:generateDebugSources
:compileDebugNote: /home/pjb/src/android-ibeacon-service/src/main/java/com/radiusnetworks/ibeacon/service/IBeaconService.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.

:processDebugJavaRes UP-TO-DATE
:packageDebugJar
:packageDebugLocalJar UP-TO-DATE
:packageDebugRenderscript UP-TO-DATE
:packageDebugResources
:bundleDebug
:assembleDebug
:copyReleaseLint UP-TO-DATE
:mergeReleaseProguardFiles
:packageReleaseAidl UP-TO-DATE
:preReleaseBuild UP-TO-DATE
:prepareReleaseDependencies
:compileReleaseAidl
:compileReleaseRenderscript
:generateReleaseBuildConfig
:mergeReleaseAssets
:mergeReleaseResources
:processReleaseManifest
:processReleaseResources
:generateReleaseSources
:compileReleaseNote: /home/pjb/src/android-ibeacon-service/src/main/java/com/radiusnetworks/ibeacon/service/IBeaconService.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.

:processReleaseJavaRes UP-TO-DATE
:packageReleaseJar
:packageReleaseLocalJar UP-TO-DATE
:packageReleaseRenderscript UP-TO-DATE
:packageReleaseResources
:bundleRelease
:assembleRelease
:assemble
:check UP-TO-DATE
:build
:bundleEclipse
Generating eclipse bundle from build/libs/AndroidIBeaconLibrary-0.7.1-1-g7e04373.aar to make build/libs/AndroidIBeaconLibrary-0.7.1-1-g7e04373.tar.gz
cp: cannot stat `scripts/eclipse-support': No such file or directory
tar: This does not look like a tar archive
tar: Skipping to next header
tar: Exiting with failure status due to previous errors
mkdir: cannot create directory `build/libs/AndroidIBeaconLibrary/src': No such file or directory
mkdir: cannot create directory `build/libs/AndroidIBeaconLibrary/libs': No such file or directory
mkdir: cannot create directory `build/libs/AndroidIBeaconLibrary/gen': No such file or directory
mv: cannot stat `build/libs/AndroidIBeaconLibrary/*.jar': No such file or directory
tar: AndroidIBeaconLibrary: Cannot stat: No such file or directory
tar: Exiting with failure status due to previous errors
:bundleEclipse FAILED

FAILURE: Build failed with an exception.

* Where:
Build file '/home/pjb/src/android-ibeacon-service/build.gradle' line: 65

* What went wrong:
Execution failed for task ':bundleEclipse'.
> Process 'command 'scripts/bundle-eclipse'' finished with non-zero exit value 2

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 10.721 secs

[pjb@mercure :0.0 android-ibeacon-service]$ ls -l build/libs/
total 108
drwxr-xr-x  2 pjb pjb  4096 Dec 13 16:00 ./
drwxr-xr-x 11 pjb pjb  4096 Dec 13 16:00 ../
-rw-r--r--  1 pjb pjb 44427 Dec 13 16:00 AndroidIBeaconLibrary-0.7.1-1-g7e04373-debug.aar
-rw-r--r--  1 pjb pjb 44411 Dec 13 16:00 AndroidIBeaconLibrary-0.7.1-1-g7e04373.aar
-rw-r--r--  1 pjb pjb    45 Dec 13 16:00 AndroidIBeaconLibrary-0.7.1-1-g7e04373.tar.gz
-rw-r--r--  1 pjb pjb   821 Dec 13 16:00 AndroidIBeaconLibrary-debug.ap_
-rw-r--r--  1 pjb pjb   805 Dec 13 16:00 AndroidIBeaconLibrary-release.ap_
[pjb@mercure :0.0 android-ibeacon-service]$ 

Nexus 7 2013 getting ANR when Bluetooth setting is off

My app is ranging beacons ok in favorable conditions but if I turn Bluetooth off and start the app, then I got ANR. I could avoid this situation by checking isEnabled() on onCreate().

But still got ANR if I turn Bluetooth off in Setting while my app is ranging.

Logcat shows below every seconds, then my app eventually crashes with ANR:
E/BtGatt.GattService(1089): getService() - Service requested, but not available!

Do you think user activity is responsible to handle this or the library can do something to help this out?

Regards
Bob

Power off android device and on again

Hi,

If I power off the android device and power on again, will the previous running beacon service still be there? or I have to run any app with radius android SDK again?

Thanks
Nedved

is it not possible to bind a service on BeaconManager.bind(myService) ???

hello,

when i bind an Activity implements BeaconConsumer (for example myActivity) with:
BeaconManager.bind(myActivity) --> it works fine !!!

when i try to bind a Service implements BeaconConsumer (for Example myService) with
BeaconManager.bind(myService) the app crashes with a NullPointerException

does BeaconManager.bind() not work with Services that implements Beaconconsumer, only with Activities that implements the BeaconConsumer ??

the docs says:

"public interface BeaconConsumer
An interface for an Android Activity or Service that wants to interact with beacons. ... "

thanks, timo

Background mode is not working properly

When I press back button in Main Activity the iBeaconService is unbinding automatically. I didn't unbind the service in onDestroy too,

  1. Then how does this automatic unbinding happen?
    Due to this, I am not able to detect beacons when app runs in background mode.
  2. How do i monitor the beacons in background mode?
    Also observed in logcat the message
    "has leaked ServiceConnection com.radiusnetworks.ibeacon.IBeaconManager$1@42a28f18 that was originally bound here".

iBeacon count

I have two iBeacon which both of them have the same major, minor, TxPower, name, and UUID. just distance and mac address are different. but application find just one of them not both. how can I solve this problem?

Single IBeaconService for multiple Apps

I am dealing with several different apps that will need to see IBeacons (for different clients). Rather than implementing different IBeaconServices for each individual app and having multiple services running at one time (which could potentially decrease battery life), is there any way that one could have a single service for all of the apps?

I started implementing this myself, creating a custom service that implements IBeaconConsumer and will Monitor/range when necessary. I'm thinking this will require implementing some inter-process communication. Is there either:

1.) Any way this could be done in the SDK?
2.) Any advice you could give?

(Looking at the source, I can see that the IBeaconService might already be setup for IPC. So, is this even something I have to worry about?)

Using wildcard matching causes a NPE

When trying to specify matching on wildcard (like the sample in the github readme), the code will crash with a NPE because the normalizing method for the proximity uuid expects the string to be not null.
screen shot 2013-10-07 at 11 13 07 am

This is not an iBeracon advertisement

Hello,

When I use your library for Android and use the MacBeacon tool to generate an iBeacon, than I get the following message in my Android App "[IBeacon] This is not an iBeacon advertisment".

It looks like the iBeacon is recognized but it doesn't pass the criteria.

What's the problem?

Kindly regards,
Wouter

Not able to integrate the beacon library with existing project

I am not able to integrate the beacon library into my current android project as I am not getting the base class.

I am getting errors in overridden methods of child classes for methods defined in base class 'Activity' which has been extended by child classes.

Please provide some help urgently.

Regards
Ashish Kumar

Mulitple Beacon monitoring problems

I am trying to monitoring a particular region with a specific UUID, and any major/minor. So, I create a monitor with a region having my UUID, and both major and minor being null.

Now, I switch on a beacon, I get the Entry event. But after that, if I switch on another one, with the same UUID, it doesn't register an Entry event.

Same is with Exit events as well.

Anytime after this, while the two beacons are active, and then I turn off any one of them, I don't get an Exit event. I only get an Exit event when I turn off the other active beacon also.

Is this the expected behaviour? Or I am doing something wrong?

Failed to set background mode

When binding to the iBeaconManager from my activity in background mode, logcat tells me that the IBeaconManager is not bound to the service. However, the ibeaconservice does get created and is subsequently bound.

12-17 16:20:47.092: E/IBeaconManager(27664): Failed to set background mode
12-17 16:20:47.092: E/IBeaconManager(27664): android.os.RemoteException: The IBeaconManager is not bound to the service. Call iBeaconManager.bind(IBeaconConsumer consumer) and wait for a callback to onIBeaconServiceConnect()
12-17 16:20:47.092: E/IBeaconManager(27664): at com.radiusnetworks.ibeacon.IBeaconManager.setScanPeriods(IBeaconManager.java:382)
12-17 16:20:47.092: E/IBeaconManager(27664): at com.radiusnetworks.ibeacon.IBeaconManager.setBackgroundMode(IBeaconManager.java:266)
12-17 16:20:47.092: E/IBeaconManager(27664): at com.radiusnetworks.ibeacon.IBeaconManager.bind(IBeaconManager.java:205)

Nexus 7

I have the same problems with nexus7 2013 that you reported with nexus4.
It´s possible?

Inconsistent monitoring behavior

The methods such as didDetermineStateForRegion of the MonitorNotifier aren't invoked as the iOS pendants do. In particular the following:

When I'm out of range of any beacons and I started monitoring for a region, the iOS version invokes didDetermineStateForRegion with state = outside. This package just invokes didDetermineStateForRegion if a beacon was found.

I'm not saying the behavior of this package is better or worse, I just think it would be more convenient if both systems behave the same way. I guess Apple won't change their API 😄

How to get the region identifier

Hi all,
I'm advertising an iBeacon signal using an iOS app, my beacon is like:
CLBeaconRegion *region = [super initWithProximityUUID:@"BADED00B-97BF-4E7D-9947-3425D9337FD5" major:20000 minor:50000 identifier:@"blablabla"];
My android app can only read the UUID, minor and major, is there any way to get the region identifier ("blablabla" in my case) ?

NoclassDefFoundError when implements BootstrapNotifier for the Background mode.

I have been trying to make the Radius Network Background mode work, with no success at this moment. I even copied the code from the following link : http://developer.radiusnetworks.com/ibeacon/android/samples.html . To see if it could work.. I tried to extend my class as a intentService, Application and Service none of those work.. My class normally work, but as soon as I implement the BootstrapNotifier I am having a No calss definition Error and my App crashes.

What I am trying to do is when I click on a button, the background functionality starts monitoring.

Here is my code for the background mode:

import android.app.IntentService;
import android.content.Intent;
import android.util.Log;

import com.radiusnetworks.ibeacon.Region;
import com.radiusnetworks.proximity.ibeacon.startup.BootstrapNotifier;
import com.radiusnetworks.proximity.ibeacon.startup.RegionBootstrap;

public class BackgroundService extends IntentService implements BootstrapNotifier {

   private static final String TAG = "BackgroundService";

public BackgroundService() {
    super("BackgroundService");
    // TODO Auto-generated constructor stub
}

@Override
public int onStartCommand(Intent intent, int flags, int startId){
    Log.d(TAG, "service starting");
    Region region = new Region("com.cubic.blebeacon.BackgroundApplication",
            "A90BABD0-2542-4001-A8D9-92EE6E7CF6E7", null, null);
    new RegionBootstrap(this, region);

    return super.onStartCommand(intent,flags,startId);
}

@Override
public void onDestroy() {
    Log.d(TAG, "Service done");
}

@Override
public void didEnterRegion(Region arg0) {
    Log.d(TAG, "did enter region.");
    Intent intent = new Intent(this, MainActivity.class);
    intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);

    // Important:  make sure to add android:launchMode="singleInstance" in the manifest
    // to keep multiple copies of this activity from getting created if the user has
    // already manually launched the app.
    this.startActivity(intent);
}
@Override
public void didExitRegion(Region arg0) {
    Log.d(TAG, "exited region");
}
@Override
public void didDetermineStateForRegion(int arg0, Region arg1) {
    Log.d(TAG, "Did determine State for region");
}

@Override
protected void onHandleIntent(Intent intent) {
    // TODO Auto-generated method stub

}

}

Note that I am new in the android application development, and that I did a lot of research before posting this issue..

Note From CEO Page is Down

I know this repo has been removed but I am hoping you may be able to still help me out.

First thing, the Note from the CEO page is down and reporting a 404.

Second, all of the beacon functionality in my apps have suddenly stopped working. It seems unlikely, but could this have anything to do with this repo being removed (note: I am using the local AAR via gradle). Again, I doubt this is the reason, but nothing has changed in the code for my apps that were previously monitoring correctly and they have suddenly stopped.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.