Git Product home page Git Product logo

android-altbeacon-library's People

Contributors

chrisriesgo 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

Watchers

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

android-altbeacon-library's Issues

Alt Beacon Library does not deploy using latest Xamarin Studio 5.9.x

Hi Chris

I'm trying to get the sample project from the Xamarin Alt Beacon project
(v.2.1.3 - https://components.xamarin.com/view/android-altbeacon-library)
to deploy but it fails every time with the exception outlined below.

I contacted Xamarin Support who can reproduce it and who advised me to raise it as an issue in this github repo.

Any help would be greatly appreciated!

Cheers,
Mike

Xamarin response:
I was able to reproduce the error you got using the sample for the Alt Beacon Component. And to be honest IO have no idea why that error is occurring. Ito seems the class is present. I suspect, though now where near 100% certain, that the issue may be on the library side due to changes with how we are generating Android Callable Wrappers. See: http://developer.xamarin.com/releases/android/xamarin.android_5/xamarin.android_5.1/#Android_Callable_Wrapper_Naming

If this is the case, this will likely have to remedied by the Component's developer. Third party components are supported by the Component author. I see they have the library in a github, so perhaps filing an issue there would be the best way to move forward.
https://github.com/chrisriesgo/Android-AltBeacon-Library

The Exception:
[AndroidRuntime] FATAL EXCEPTION: main
[AndroidRuntime] Process: androidaltbeaconlibrary.sample, PID: 4422
[AndroidRuntime] java.lang.RuntimeException: Unable to instantiate
application androidaltbeaconlibrary.sample.BeaconReferenceApplication:
java.lang.ClassNotFoundException: Didn't find class
"androidaltbeaconlibrary.sample.BeaconReferenceApplication" on path:
DexPathList[[zip file "/data/app/androidaltbeaconlibrary.
sample-1/base.apk"],nativeLibraryDirectories=[/data/app/
androidaltbeaconlibrary.sample-1/lib/arm64, /vendor/lib64, /system/lib64]]
[AndroidRuntime] at android.app.LoadedApk.makeApplication(LoadedApk.
java:649)
[AndroidRuntime] at android.app.ActivityThread.handleBindApplication(
ActivityThread.java:5225)
[AndroidRuntime] at android.app.ActivityThread.access$1600(ActivityThread.
java:182)
[AndroidRuntime] at android.app.ActivityThread$H.
handleMessage(ActivityThread.java:1536)
[AndroidRuntime] at android.os.Handler.dispatchMessage(Handler.java:102)
[AndroidRuntime] at android.os.Looper.loop(Looper.java:145)
[AndroidRuntime] at android.app.ActivityThread.
main(ActivityThread.java:6141)
[AndroidRuntime] at java.lang.reflect.Method.invoke(Native Method)
[AndroidRuntime] at java.lang.reflect.Method.invoke(Method.java:372)
[AndroidRuntime] at com.android.internal.os.ZygoteInit$
MethodAndArgsCaller.run(ZygoteInit.java:1399)
[AndroidRuntime] at com.android.internal.os.ZygoteInit.main(ZygoteInit.
java:1194)
[AndroidRuntime] Caused by: java.lang.ClassNotFoundException: Didn't find
class "androidaltbeaconlibrary.sample.BeaconReferenceApplication" on path:
DexPathList[[zip file "/data/app/androidaltbeaconlibrary.
sample-1/base.apk"],nativeLibraryDirectories=[/data/app/
androidaltbeaconlibrary.sample-1/lib/arm64, /vendor/lib64, /system/lib64]]
[AndroidRuntime] at dalvik.system.BaseDexClassLoader.findClass(
BaseDexClassLoader.java:56)
[AndroidRuntime] at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
[AndroidRuntime] at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
[AndroidRuntime] at android.app.Instrumentation.newApplication(
Instrumentation.java:988)
[AndroidRuntime] at android.app.LoadedApk.makeApplication(LoadedApk.
java:644)
[AndroidRuntime] ... 10 more
[AndroidRuntime] Suppressed: java.lang.ClassNotFoundException:
androidaltbeaconlibrary.sample.BeaconReferenceApplication
[AndroidRuntime] at java.lang.Class.classForName(Native Method)
[AndroidRuntime] at java.lang.BootClassLoader.findClass(ClassLoader.java:
781)
[AndroidRuntime] at java.lang.BootClassLoader.loadClass(ClassLoader.java:
841)
[AndroidRuntime] at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
[AndroidRuntime] ... 13 more
[AndroidRuntime] Caused by: java.lang.NoClassDefFoundError: Class not
found using the boot class loader; no stack available

Where's the source code?

I'm looking at the sample projects. They all seem to point to the AndroidAltBeaconLibrary.dll as a hard reference, instead of the actual code, as a project reference. The actually AndroidAltBeaconLibrary project, however, doesn't seem to have all the code that's in the referenced library. Am I missing something?

Thanks!

Sample differs from NuGet

Hi Chris,

your Xamarin.Forms sample does not use the NuGet Package.
The .dll works fine but the dll from NuGet wants me to implement all methods (even Dispose and Handle):

class Class1 : IBeaconConsumer
{

    public Context ApplicationContext
    {
        get { throw new NotImplementedException(); }
    }

    public bool BindService(Intent intent, IServiceConnection serviceConnection, Bind flags)
    {
        throw new NotImplementedException();
    }

    public void OnBeaconServiceConnect()
    {
        throw new NotImplementedException();
    }

    public void UnbindService(IServiceConnection serviceConnection)
    {
        throw new NotImplementedException();
    }

    public IntPtr Handle
    {
        get { throw new NotImplementedException(); }
    }

    public void Dispose()
    {
        throw new NotImplementedException();
    }
}

Even though the Versions are equal (2.7)...

BR

RangingBeaconsInRegion

Hi @chrisriesgo . I have downloaded your Forms Demo and I see that

    async void RangingBeaconsInRegion(object sender, RangeEventArgs e)

is called 2 times, one after the other.
I have only inserted this row

        Debug.WriteLine ("Entered " + e.Beacons.Count);

there

    async void RangingBeaconsInRegion(object sender, RangeEventArgs e)
    {
        await ClearData();

        **Debug.WriteLine ("Entered " + e.Beacons.Count);**

        var allBeacons = new List<Beacon>();
        if(e.Beacons.Count > 0)

And in Application Output I see

Thread started: #13
Entered 1
Entered 1
Entered 2
Entered 2
Thread finished: #13
[BluetoothAdapter] startLeScan(): null
[BluetoothAdapter] onClientRegistered() - status=0 clientIf=5
[BluetoothAdapter] onScanResult() - Device=DD:01:E3:CA:53:A5 RSSI=-82
[BluetoothAdapter] onScanResult() - Device=43:64:F6:D7:C4:8D RSSI=-45
[BluetoothAdapter] onScanResult() - Device=D4:CC:53:E6:E8:0F RSSI=-42
[BluetoothAdapter] onScanResult() - Device=43:64:F6:D7:C4:8D RSSI=-57
[BluetoothAdapter] onScanResult() - Device=D4:CC:53:E6:E8:0F RSSI=-48
[BluetoothAdapter] onScanResult() - Device=43:64:F6:D7:C4:8D RSSI=-50
[BluetoothAdapter] onScanResult() - Device=DD:01:E3:CA:53:A5 RSSI=-85
[BluetoothAdapter] onScanResult() - Device=D4:CC:53:E6:E8:0F RSSI=-47
[BluetoothAdapter] onScanResult() - Device=43:64:F6:D7:C4:8D RSSI=-52
[BluetoothAdapter] onScanResult() - Device=D4:CC:53:E6:E8:0F RSSI=-49
[BluetoothAdapter] onScanResult() - Device=43:64:F6:D7:C4:8D RSSI=-53
[BluetoothAdapter] onScanResult() - Device=D4:CC:53:E6:E8:0F RSSI=-48
[BluetoothAdapter] onScanResult() - Device=DD:01:E3:CA:53:A5 RSSI=-84
[BluetoothAdapter] stopLeScan()
Thread started: #14
Entered 1
Entered 1
Entered 2
Entered 2
Thread finished: #14
[BluetoothAdapter] startLeScan(): null
[BluetoothAdapter] onClientRegistered() - status=0 clientIf=5
[BluetoothAdapter] onScanResult() - Device=D4:CC:53:E6:E8:0F RSSI=-39
[BluetoothAdapter] onScanResult() - Device=D4:CC:53:E6:E8:0F RSSI=-39
[BluetoothAdapter] onScanResult() - Device=43:64:F6:D7:C4:8D RSSI=-49
[BluetoothAdapter] onScanResult() - Device=D4:CC:53:E6:E8:0F RSSI=-41
[BluetoothAdapter] onScanResult() - Device=43:64:F6:D7:C4:8D RSSI=-48
[BluetoothAdapter] onScanResult() - Device=DD:01:E3:CA:53:A5 RSSI=-88
[BluetoothAdapter] onScanResult() - Device=43:64:F6:D7:C4:8D RSSI=-46
[BluetoothAdapter] onScanResult() - Device=D4:CC:53:E6:E8:0F RSSI=-42
[BluetoothAdapter] onScanResult() - Device=43:64:F6:D7:C4:8D RSSI=-46
[BluetoothAdapter] onScanResult() - Device=D4:CC:53:E6:E8:0F RSSI=-42
[BluetoothAdapter] onScanResult() - Device=43:64:F6:D7:C4:8D RSSI=-51
[BluetoothAdapter] onScanResult() - Device=D4:CC:53:E6:E8:0F RSSI=-39
[BluetoothAdapter] stopLeScan()
Thread started: #15
Entered 1
Entered 1
Entered 2
Entered 2
Thread finished: #15

The first time is often "1" and the second time is often "2" (I have 2 beacons here, one is a Estimote, the other one... I don't know...)

Do you know the reason RangingBeaconsInRegion is called twice?
Thanks

Exception in sample App.

Just run sample. Samsung Galaxy S5. Android 5.0

03-19 17:16:34.569 E/mono (30193): Unhandled Exception:
03-19 17:16:34.569 E/mono (30193): System.InvalidOperationException: Collection was modified; enumeration operation may not execute.
03-19 17:16:34.569 E/mono (30193): at System.Collections.Generic.List1+Enumerator[AltBeaconOrg.BoundBeacon.Beacon].MoveNext () [0x00000] in <filename unknown>:0 03-19 17:16:34.569 E/mono (30193): at System.Linq.Enumerable.All[Beacon] (IEnumerable1 source, System.Func`2 predicate) [0x00000] in :0
03-19 17:16:34.569 E/mono (30193): at AndroidAltBeaconLibrary.Sample.MainActivity+<>c__DisplayClass20.b__1c () [0x00003] in c:\Users\POLKOVNIK\Documents\Android-AltBeacon-Library\Samples\Android\AndroidAltBeaconLibrary.Sample\MainActivity.cs:259
03-19 17:16:34.569 E/mono (30193): at System.Threading.Tasks.TaskActionInvoker+ActionInvoke.Invoke (System.Threading.Tasks.Task owner, System.Object state, System.Threading.Tasks.Task context) [0x00000] in :0
03-19 17:16:34.569 E/mono (30193): at System.Threading.Tasks.Task.InnerInvoke () [0x00000] in :0
03-19 17:16:34.569 E/mono (30193): at System.Threading.Tasks.Task.ThreadStart () [0x00000] in :0
03-19 17:16:34.569 E/mono (30193): --- End of stack trace from previous location where exception was thrown ---
03-19 17:16:34.569 E/mono (30193): at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in :0
03-19 17:16:34.569 E/mono (30193): at System.Runtime.CompilerServices.TaskAwaiter.GetResult () [0x00000] in :0
03-19 17:16:34.569 E/mono (30193): at AndroidAltBeaconLibrary.Sample.MainActivity+d__24.MoveNext () [0x0004c] in c:\Users\POLKOVNIK\Documents\Android-AltBeacon-Library\Samples\Android\AndroidAltBeaconLibrary.Sample\MainActivity.cs:257
03-19 17:16:34.569 E/mono (30193): --- End of stack trace from previous location where exception was thrown ---
03-19 17:16:34.569 E/mono (30193): at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in :0
03-19 17:16:34.569 E/mono (30193): at System.Runtime.CompilerServices.TaskAwaiter.GetResult () [0x00000] in :0
03-19 17:16:34.569 E/mono (30193): at AndroidAltBeaconLibrary.Sample.MainActivity+<>c__DisplayClass7+<b__5>d__9.MoveNext () [0x00031] in c:\Users\POLKOVNIK\Documents\Android-AltBeacon-Library\Samples\Android\AndroidAltBeaconLibrary.Sample\MainActivity.cs:184
The thread 'Unknown' (0x7) has exited with code 0 (0x0).

What are the events?

Is there a wiki? How can I see a list of events which the client can subscribe to?

Thanks,

Monitoring as background service sample

Hello Chris,

I am stugling in finding the way how to do beacon monitoring in the background when app is closed.
Is this supportted by the library now or there are some examples that you can point me to.

Here is the striped down sample that I built from your sample, but I am unable to get monitoring (region entered / left) if the app was killed in task manager.
I can see app in the background processes running as a cached background process.

thank you,
DiNo

Eddystone URL problem

Hi, Id1 is returning wrong data. The problem is that when you set the beacon for maximum length (which can be up 20 bytes ... it is frame type (1byte), tx power (1byte), URL scheme (1byte) and 1-17 bytes for URL) id1 contains also URL scheme as the first byte. Therefore the last byte of the URL is not shown.

Can you pls test this?

Example:
if you set a beacon for http://aaaabbbbccccdddd.com id1 returns https://aaaabbbbccccdddd instead of aaaabbbbccccdddd.com ("http://" and ".com" can be converted to 1 byte each but the difference is that https:// or other prefixes should be in separate byte flag, not in URL)

I hope it is understandable.

Supporting altbeacon 2.12 and above?

Hi there is a problem with previous versions that dont enter region in sleep mode
for android 8 and above.
Is there any chance to get a nuget that supports these version and resolves this issue?

Linker failed

The lib is working fine, but if I want to build a release apk with the linker, I get always this error:

Error 3 The "LinkAssemblies" task failed unexpectedly. Xamarin.Android.XamarinAndroidException: error XA2006: Reference to metadata item 'Android.Bluetooth.LE.AdvertiseCallback' (defined in 'AndroidAltBeaconLibrary, Version=2.1.4.0, Culture=neutral, PublicKeyToken=null') from 'AndroidAltBeaconLibrary, Version=2.1.4.0, Culture=neutral, PublicKeyToken=null' could not be resolved. ---> Mono.Cecil.ResolutionException: Failed to resolve Android.Bluetooth.LE.AdvertiseCallback at Mono.Linker.Steps.MarkStep.MarkType(TypeReference reference) at Mono.Linker.Steps.MarkStep.MarkMethodBody(MethodBody body) at Mono.Linker.Steps.MarkStep.ProcessMethod(MethodDefinition method) at Mono.Linker.Steps.MarkStep.ProcessQueue() at Mono.Linker.Steps.MarkStep.Process() at Mono.Linker.Steps.MarkStep.Process(LinkContext context) at Mono.Linker.Pipeline.Process(LinkContext context) at MonoDroid.Tuner.Linker.Process(LinkerOptions options, LinkContext& context) at Xamarin.Android.Tasks.LinkAssemblies.Execute() --- End of inner exception stack trace --- at Xamarin.Android.Diagnostic.Error(Int32 code, Exception innerException, String message, Object[] args) at Xamarin.Android.Tasks.LinkAssemblies.Execute() at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__20.MoveNext() Herberstein.Droid

Monitoring

I have taken a look to your xamarin forms example but I have seen that it has not a monitoring example. There is the possibility to use monitoring with your lib in XF? Have you an example for this?
Thanks

Xamarin Android error AddRangeNotifier

Hi, Chris

I'm running the example of this library and I have a mistake in this line
_beaconManager.AddRangeNotifier (_rangeNotifier);
BeaconManager has no definition for AddRangeNotifer
whit library 2.7 and 2.4, do you have other example on android or a example more simple.

Thanks Chris.

Ranging beacon reporting bad results

I am attempting to range beacons for a short amount of time while the app is open. I have set up a range notifier and I do get notifications when the beacons are ranged. The problem I'm having is when I have a beacon in range (sitting inches away from the phone) the range notifier will report 1 beacon in range, and then the next update it will report 0. It constantly flips back and forth between 0,1,0,1. The beacon and phone are clearly close enough together so I'm certain the signal strength is not an issue. This seems to be pretty consistent too. Any ideas? Maybe I'm doing something wrong?

Some 8.1 devices throwing exceptions on ScanJob (2.15 version of lib)

I'm seeing my app crashing quite regularly with a single device - a Moto G, running Android 8.1. It's using the @luposlip library version - 2.15

I get this error:

executing service com.glmobileapp/org.altbeacon.beacon.service.ScanJob, InvisibleToUser
org.altbeacon.beacon.service.ScanJob

Almost all other devices are fine, but it does this so regularly on one device that Google are pulling my app off the store.

Has anyone else come across this?

This is the stack trace:

`"main" prio=5 tid=1 Native
| group="main" sCount=1 dsCount=0 flags=1 obj=0x729279f0 self=0xabbb5000
| sysTid=4883 nice=0 cgrp=default sched=0/0 handle=0xafd334a4
| state=D schedstat=( 1926726438 51800625 338 ) utm=140 stm=51 core=6 HZ=100
| stack=0xbe259000-0xbe25b000 stackSize=8MB
| held mutexes=

#00 pc 0000000000048cd4 /system/lib/libc.so (__openat+12)

#1 pc 000000000001f3a3 /system/lib/libc.so (open+54)

#2 pc 00000000000151cb /system/lib/libopenjdk.so (handleOpen+26)

#3 pc 0000000000015285 /system/lib/libopenjdk.so (fileOpen+68)

#4 pc 00000000000149f5 /system/lib/libopenjdk.so (FileOutputStream_open0+28)

#5 pc 000000000002a989 /system/framework/arm/boot-core-oj.oat (Java_java_io_FileOutputStream_open0__Ljava_lang_String_2Z+96)

at java.io.FileOutputStream.open0 (Native method)

at java.io.FileOutputStream.open (FileOutputStream.java:287)

at java.io.FileOutputStream. (FileOutputStream.java:223)

at android.app.ContextImpl.openFileOutput (ContextImpl.java:539)

at android.content.ContextWrapper.openFileOutput (ContextWrapper.java:201)

at org.altbeacon.beacon.service.ScanState.save (ScanState.java:193)
locked <0x03137a6d> (a java.lang.Class<org.altbeacon.beacon.service.ScanState>)

at org.altbeacon.beacon.service.ScanState.applyChanges (ScanState.java:291)

at org.altbeacon.beacon.service.ScanJobScheduler.applySettingsToScheduledJob (ScanJobScheduler.java:83)

at org.altbeacon.beacon.service.ScanJobScheduler.applySettingsToScheduledJob (ScanJobScheduler.java:92)

at org.altbeacon.beacon.BeaconManager.applyChangesToServices (BeaconManager.java:983)

at org.altbeacon.beacon.BeaconManager.startMonitoringBeaconsInRegion (BeaconManager.java:923)

at org.altbeacon.beacon.startup.RegionBootstrap$InternalBeaconConsumer.onBeaconServiceConnect (RegionBootstrap.java:155)

at org.altbeacon.beacon.BeaconManager.bind (BeaconManager.java:428)
locked <0x01dbe756> (a java.util.concurrent.ConcurrentHashMap)

at org.altbeacon.beacon.startup.RegionBootstrap. (RegionBootstrap.java:77)

at md5c497ac42f3138c67aed930c79af470d4.MainApplication.n_onCreate (Native method)

at md5c497ac42f3138c67aed930c79af470d4.MainApplication.onCreate (MainApplication.java:40)

at android.app.Instrumentation.callApplicationOnCreate (Instrumentation.java:1141)

at android.app.ActivityThread.handleBindApplication (ActivityThread.java:5854)

at android.app.ActivityThread.-wrap1 (ActivityThread.java)

at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1697)

at android.os.Handler.dispatchMessage (Handler.java:106)

at android.os.Looper.loop (Looper.java:164)

at android.app.ActivityThread.main (ActivityThread.java:6626)

at java.lang.reflect.Method.invoke (Native method)

at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:438)

at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:811)`

C#-ify some of the binding APIs

With the binding as-is, some of the AltBeacon-specific APIs do not have idiomatic C# variants. I'd like to enhance this binding to C#-ify at least some of the more common use-cases.

Different behaviors on background

Hi Chris

Before everything else, thank you so much to have the time to work on this library. I'm building an app that communicates with beacons (they broadcast both iBeacon and Eddystone). I'm having a hard time though with the background on Android. The behavior I want to achieve is:

Having my app installed in the phone and closed (terminated), I would like to receive local notification every time the phone gets in the range of one of my beacons. I have this running good with iOS on background, but Android turned to be much harder to achieve. I can see from your samples, that (Android sample) work more close to my goal, but I noticed that you use a AltBeaconLibrary version (10.0.0.0). When I run your Android sample for Xamarin.Forms the behavior when the app is terminated is not as good as the Android sample. I noticed also that xamarin.forms sample for android uses another version of your library (2.7.0.0). I guess you should have different implementations on those version and that's what I would like you give me some feedback on.

I've been reading alot on how best implement background services on Android with Xamarin since I'm looking for my app to run with min API 26. On you samples I can see services, broadcast receivers, job scheduler ?

Can you give me more details on how you implemented this background behavior. In the logs I can see app activating the monitoring from time to time (5000 milisecs, the sample setup).

I'm also trying to understand the connection between Android OS and triggers when a beacon is in range.

Sorry if I'm still confuse with some parts, I'm a kind new on Xamarin/android/ios stuff :)

Any feedback is much appreciated.
Thank you,
Regards
Bruno

[question] how to be notified when ANY beacon is within range?

Sorry if this is lame. I'm just getting started w/ beacons.

All of the code I've seen so far (Find the Monkey for example) seems to be hard coded to a specific beacon. Is this correct?

I need to be able to detect any beacon that comes near my device (either an Android phone or an iPhone). The samples (both forms and classic) appear to be configured to detect Estimote beacons. Why is that? I thought iBeacon was a standard and everybody should be the same. I already have some Radius networks beacons to play with and a few others on the way (a few NFC tags too).

I'm reading the AltBeacon java docs but they aren't clearing things up for me.

Any help would be greatly appreciated.

update?

any update is on the way?

System.ArgumentException'kls' must not be IntPtr.Zero. Parameter name: kls

Hi Chris.
I have this problem

at Android.Runtime.JNIEnv.GetMethodID (IntPtr kls, System.String name, System.String signature) <0xaf5e7b48 + 0x0014c> in :0
at Android.Content.ISharedPreferencesInvoker.Edit () <0xaf5d6d20 + 0x0003f> in :0
at Acr.Notifications.NotificationsImpl.GetNextNotificationId () <0x9c478830 + 0x000bf> in :0
at Acr.Notifications.NotificationsImpl.Send (Acr.Notifications.Notification notification) <0x9c478380 + 0x0004b> in :0
at IWapp.App.m__1 (IWapp.App sender, System.String arg) <0x9c477c80 + 0x00193> in :0
at Xamarin.Forms.MessagingCenter+<>c__DisplayClass1_02[TSender,TArgs].<Subscribe>b__0 (System.Object sender, System.Object args) <0x9c477b58 + 0x000bb> in <filename unknown>:0 at Xamarin.Forms.MessagingCenter.InnerSend (System.String message, System.Type senderType, System.Type argType, System.Object sender, System.Object args) <0xaf9de070 + 0x00167> in <filename unknown>:0 at Xamarin.Forms.MessagingCenter.Send[TSender,TArgs] (Xamarin.Forms.TSender sender, System.String message, Xamarin.Forms.TArgs args) <0x9c477a88 + 0x00057> in <filename unknown>:0 at AltBeaconLibrary.Sample.Droid.Services.AltBeaconService.EnteredRegion (System.Object sender, AltBeaconLibrary.Sample.Droid.MonitorEventArgs e) <0x9c4776c0 + 0x000df> in <filename unknown>:0 at (wrapper delegate-invoke) System.EventHandler1[AltBeaconLibrary.Sample.Droid.MonitorEventArgs]:invoke_void_object_TEventArgs (object,AltBeaconLibrary.Sample.Droid.MonitorEventArgs)
at AltBeaconLibrary.Sample.Droid.MonitorNotifier.OnEnterRegionComplete (AltBeaconOrg.BoundBeacon.Region region) <0x9c477630 + 0x00067> in :0
at AltBeaconLibrary.Sample.Droid.MonitorNotifier.DidEnterRegion (AltBeaconOrg.BoundBeacon.Region region) <0x9c4775e8 + 0x0001b> in :0
at AltBeaconOrg.BoundBeacon.IMonitorNotifierInvoker.n_DidEnterRegion_Lorg_altbeacon_beacon_Region_ (IntPtr jnienv, IntPtr native__this, IntPtr native_region) <0x9c477528 + 0x00063> in :0
at (wrapper dynamic-method) System.Object:9996f0df-41f5-4bdc-95ea-96f5b8b96362 (intptr,intptr,intptr)

AltBeaconLibrary sample service start on boot

Based on testing on various Android 4.3 and 4.4 devices, we noticed there's an issue with running AltBeacon service upon device boot. It works fine if demo app is run by user or put into background mode. Service is started upon boot (it's visible in Android running services list) , but no events are triggered and doesn't seem to initiate either monitoring or ranging.

2.10.0

Upgrade to Library Version 2.10.0

Project
Milestone

Tasks

  • Update the binding library to consume the 2.10.0 native library - #28
  • Port unit tests from the root project's repo to C# - #26
  • C#-ify some APIs - #31
  • Generate 2.10.0 stable NuGet - #29
  • Port the reference app samples from the root project's repo to C# - #27
  • Generate Xamarin Component - #30

Eddystone

How is it possible to extract eddystone data, like Url, battery status, etc?
Thanks a lot.

java.io.FileNotFoundException

I Just run sample. Device Nexus 5. Android 5.1.

03-19 12:11:25.311 E/ModelSpecificDistanceCalculator( 7851): Cannot open distance model file /data/data/TestAltBeacon.TestAltBeacon/files/model-distance-calculations.json
03-19 12:11:25.311 E/ModelSpecificDistanceCalculator( 7851): java.io.FileNotFoundException: /data/data/TestAltBeacon.TestAltBeacon/files/model-distance-calculations.json: open failed: ENOENT (No such file or directory)
03-19 12:11:25.311 E/ModelSpecificDistanceCalculator( 7851): at libcore.io.IoBridge.open(IoBridge.java:456)
03-19 12:11:25.311 E/ModelSpecificDistanceCalculator( 7851): at java.io.FileInputStream.(FileInputStream.java:76)
03-19 12:11:25.311 E/ModelSpecificDistanceCalculator( 7851): at org.altbeacon.beacon.distance.ModelSpecificDistanceCalculator.loadModelMapFromFile(ModelSpecificDistanceCalculator.java:152)
03-19 12:11:25.311 E/ModelSpecificDistanceCalculator( 7851): at org.altbeacon.beacon.distance.ModelSpecificDistanceCalculator.loadModelMap(ModelSpecificDistanceCalculator.java:132)
03-19 12:11:25.311 E/ModelSpecificDistanceCalculator( 7851): at org.altbeacon.beacon.distance.ModelSpecificDistanceCalculator.(ModelSpecificDistanceCalculator.java:72)
03-19 12:11:25.311 E/ModelSpecificDistanceCalculator( 7851): at org.altbeacon.beacon.distance.ModelSpecificDistanceCalculator.(ModelSpecificDistanceCalculator.java:62)
03-19 12:11:25.311 E/ModelSpecificDistanceCalculator( 7851): at org.altbeacon.beacon.service.BeaconService.onCreate(BeaconService.java:205)
03-19 12:11:25.311 E/ModelSpecificDistanceCalculator( 7851): at android.app.ActivityThread.handleCreateService(ActivityThread.java:2761)
03-19 12:11:25.311 E/ModelSpecificDistanceCalculator( 7851): at android.app.ActivityThread.access$1800(ActivityThread.java:151)
03-19 12:11:25.311 E/ModelSpecificDistanceCalculator( 7851): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1386)
03-19 12:11:25.311 E/ModelSpecificDistanceCalculator( 7851): at android.os.Handler.dispatchMessage(Handler.java:102)
03-19 12:11:25.311 E/ModelSpecificDistanceCalculator( 7851): at android.os.Looper.loop(Looper.java:135)
03-19 12:11:25.311 E/ModelSpecificDistanceCalculator( 7851): at android.app.ActivityThread.main(ActivityThread.java:5254)
03-19 12:11:25.311 E/ModelSpecificDistanceCalculator( 7851): at java.lang.reflect.Method.invoke(Native Method)
03-19 12:11:25.311 E/ModelSpecificDistanceCalculator( 7851): at java.lang.reflect.Method.invoke(Method.java:372)
03-19 12:11:25.311 E/ModelSpecificDistanceCalculator( 7851): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
03-19 12:11:25.311 E/ModelSpecificDistanceCalculator( 7851): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
03-19 12:11:25.311 E/ModelSpecificDistanceCalculator( 7851): Caused by: android.system.ErrnoException: open failed: ENOENT (No such file or directory)
03-19 12:11:25.311 E/ModelSpecificDistanceCalculator( 7851): at libcore.io.Posix.open(Native Method)
03-19 12:11:25.311 E/ModelSpecificDistanceCalculator( 7851): at libcore.io.BlockGuardOs.open(BlockGuardOs.java:186)
03-19 12:11:25.311 E/ModelSpecificDistanceCalculator( 7851): at libcore.io.IoBridge.open(IoBridge.java:442)
03-19 12:11:25.311 E/ModelSpecificDistanceCalculator( 7851): ... 16 more

Why location services required for receiving beacon on background?

Hi Chris,
In Nexus 9 with android 7 nougat.
When the app is on foreground , Beacon detection is working without using location services.

But in Background, it is not detecting beacons.
If the location services are on. Then it is detecting beacons.
Could you please help me on this.

Setting implied filter class to ARMA.

Maybe I am just misunderstanding how to do this but I am having some issues with setting the RSSI filter class to ARMA.

In the regular android library this could be achieved with

BeaconManager.setRssiFilterImplClass(ArmaRssiFilter.class);

However c# does not support using .class so BeaconManager.RssiFilterImplClass = ArmaRssiFilter.class does not work. It expects a Java.Lang.Class so an idea was to use Java.Lang.Class.FromType to do it but I am having no luck with that either. Is this functionality available in this version of the library?

Update required to fix issues under Android 7

Please update the component dependencies!
Current AltBeacon native lib is now two years old (v2.7, actually v2.9)
The last version fixes major issues under Android 7 (
2.9.2 required)

Thanks you.

Strange exception

[BluetoothAdapter] android.os.DeadObjectException
[BluetoothAdapter] at android.os.BinderProxy.transact(Native Method)
[BluetoothAdapter] at android.bluetooth.IBluetooth$Stub$Proxy.isEnabled(IBluetooth.java:648)
[BluetoothAdapter] at android.bluetooth.BluetoothAdapter.isEnabled(BluetoothAdapter.java:501)
[BluetoothAdapter] at org.altbeacon.beacon.service.scanner.CycledLeScanner.finishScanCycle(CycledLeScanner.java:244)
[BluetoothAdapter] at org.altbeacon.beacon.service.scanner.CycledLeScanner.scheduleScanCycleStop(CycledLeScanner.java:233)
[BluetoothAdapter] at org.altbeacon.beacon.service.scanner.CycledLeScanner$1.run(CycledLeScanner.java:229)
[BluetoothAdapter] at android.os.Handler.handleCallback(Handler.java:733)
[BluetoothAdapter] at android.os.Handler.dispatchMessage(Handler.java:95)
[BluetoothAdapter] at android.os.Looper.loop(Looper.java:149)
[BluetoothAdapter] at android.app.ActivityThread.main(ActivityThread.java:5257)
[BluetoothAdapter] at java.lang.reflect.Method.invokeNative(Native Method)
[BluetoothAdapter] at java.lang.reflect.Method.invoke(Method.java:515)
[BluetoothAdapter] at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
[BluetoothAdapter] at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:609)
[BluetoothAdapter] at dalvik.system.NativeStart.main(Native Method)

Dependencies

According to the nuspec file, this package has no dependencies. Is that correct? Or would you mind updating the nuspec?

Thanks!

Error: bt-btm new address when monitoring.

I have noticed a humongous amount of errors from 'bt-btm' when I start monitoring for beacons. Very soon after calling startmonitoringbeaconsinregion, dozens of errors with bt-btm new address ab:cd:ef:gh:ij:kl start popping up. It doesn't seem to matter if there is a beacon actually broadcasting or not. The service still works correctly, both monitoring and ranging but I am curious what this could be about.

04-25 15:50:15.029 D/LAACService(24736): Beacon Service connected, starting monitoring.

04-25 15:50:15.048 D/BtGatt.GattService( 7602): registerClient() - UUID=7183e20d-2397-49e9-8b9d-11bf054f0645

04-25 15:50:15.049 D/BtGatt.GattService( 7602): onClientRegistered() - UUID=7183e20d-2397-49e9-8b9d-11bf054f0645, clientIf=9

04-25 15:50:15.049 D/BluetoothLeScanner(24736): onClientRegistered() - status=0 clientIf=9

04-25 15:50:15.050 D/BtGatt.GattService( 7602): start scan with filters

04-25 15:50:15.052 D/BtGatt.ScanManager( 7602): handling starting scan

04-25 15:50:15.059 I/WCNSS_FILTER( 7923): ibs_msm_serial_clock_vote: vote UART CLK ON using UART driver's ioctl()

04-25 15:50:15.065 D/BtGatt.GattService( 7602): onScanFilterEnableDisabled() - clientIf=9, status=0, action=1

04-25 15:50:15.065 D/BtGatt.ScanManager( 7602): callback done for clientIf - 9 status - 0

04-25 15:50:15.067 D/BtGatt.GattService( 7602): onScanFilterParamsConfigured() - clientIf=9, status=0, action=0, availableSpace=15

04-25 15:50:15.067 D/BtGatt.ScanManager( 7602): callback done for clientIf - 9 status - 0

04-25 15:50:15.067 D/BtGatt.ScanManager( 7602): configureRegularScanParams() - queue=1

04-25 15:50:15.067 D/BtGatt.ScanManager( 7602): configureRegularScanParams() - ScanSetting Scan mode=2 mLastConfiguredScanSetting=-2147483648

04-25 15:50:15.133 E/bt-btm ( 7602): new address: 50:2e:b5:8d:c6:dc

04-25 15:50:15.133 E/bt-btm ( 7602): new address: 50:2e:b5:8d:c6:dc

04-25 15:50:15.319 E/bt-btm ( 7602): new address: 50:2e:b5:8d:c6:dc

04-25 15:50:15.320 E/bt-btm ( 7602): new address: 50:2e:b5:8d:c6:dc

04-25 15:50:15.431 E/NetlinkEvent( 462): NetlinkEvent::FindParam(): Parameter 'ALERT_NAME' not found

04-25 15:50:15.431 E/NetlinkEvent( 372): NetlinkEvent::FindParam(): Parameter 'ALERT_NAME' not found

04-25 15:50:15.437 D/HeadsetStateMachine( 7602): Disconnected process message: 10, size: 0

04-25 15:50:15.441 D/KeyguardUpdateMonitor( 4259): received broadcast android.intent.action.BATTERY_CHANGED

04-25 15:50:15.455 D/KeyguardUpdateMonitor( 4259): handleBatteryUpdate

04-25 15:50:15.474 D/TaskPersister( 1101): removeObsoleteFile: deleting file=3580_task.xml

04-25 15:50:15.500 E/bt-btm ( 7602): new address: 50:2e:b5:8d:c6:dc

04-25 15:50:15.500 E/bt-btm ( 7602): new address: 50:2e:b5:8d:c6:dc

04-25 15:50:15.683 E/bt-btm ( 7602): new address: 50:2e:b5:8d:c6:dc

04-25 15:50:15.684 E/bt-btm ( 7602): new address: 50:2e:b5:8d:c6:dc

04-25 15:50:15.864 E/bt-btm ( 7602): new address: 50:2e:b5:8d:c6:dc

04-25 15:50:15.864 E/bt-btm ( 7602): new address: 50:2e:b5:8d:c6:dc

04-25 15:50:16.049 E/bt-btm ( 7602): new address: 50:2e:b5:8d:c6:dc

04-25 15:50:16.050 E/bt-btm ( 7602): new address: 50:2e:b5:8d:c6:dc

04-25 15:50:16.089 I/WCNSS_FILTER( 7923): ibs_msm_serial_clock_vote: vote UART CLK OFF using UART driver's ioctl()

04-25 15:50:16.156 D/BtGatt.GattService( 7602): stopScan() - queue size =1

04-25 15:50:16.157 D/BtGatt.GattService( 7602): unregisterClient() - clientIf=9

04-25 15:50:16.162 I/WCNSS_FILTER( 7923): ibs_msm_serial_clock_vote: vote UART CLK ON using UART driver's ioctl()

04-25 15:50:16.169 D/BtGatt.GattService( 7602): onScanFilterParamsConfigured() - clientIf=9, status=0, action=1, availableSpace=16

04-25 15:50:16.169 D/BtGatt.ScanManager( 7602): callback done for clientIf - 9 status - 0

04-25 15:50:16.169 D/BtGatt.ScanManager( 7602): stop scan

04-25 15:50:16.169 D/BtGatt.ScanManager( 7602): configureRegularScanParams() - queue=0

04-25 15:50:16.170 D/BtGatt.ScanManager( 7602): configureRegularScanParams() - ScanSetting Scan mode=-2147483648 mLastConfiguredScanSetting=2

04-25 15:50:16.170 D/BtGatt.ScanManager( 7602): configureRegularScanParams() - queue emtpy, scan stopped

04-25 15:50:16.179 D/BtGatt.GattService( 7602): registerClient() - UUID=ec563822-6c24-4c61-8412-82e1fe7604c2

04-25 15:50:16.180 D/BtGatt.GattService( 7602): onClientRegistered() - UUID=ec563822-6c24-4c61-8412-82e1fe7604c2, clientIf=9

04-25 15:50:16.180 D/BluetoothLeScanner(24736): onClientRegistered() - status=0 clientIf=9

04-25 15:50:16.181 D/BtGatt.GattService( 7602): start scan with filters

04-25 15:50:16.182 D/BtGatt.ScanManager( 7602): handling starting scan

04-25 15:50:16.189 D/BtGatt.GattService( 7602): onScanFilterEnableDisabled() - clientIf=9, status=0, action=1

04-25 15:50:16.190 D/BtGatt.ScanManager( 7602): callback done for clientIf - 9 status - 0

04-25 15:50:16.191 D/BtGatt.GattService( 7602): onScanFilterParamsConfigured() - clientIf=9, status=0, action=0, availableSpace=15

04-25 15:50:16.191 D/BtGatt.ScanManager( 7602): callback done for clientIf - 9 status - 0

04-25 15:50:16.191 D/BtGatt.ScanManager( 7602): configureRegularScanParams() - queue=1

04-25 15:50:16.192 D/BtGatt.ScanManager( 7602): configureRegularScanParams() - ScanSetting Scan mode=2 mLastConfiguredScanSetting=-2147483648

04-25 15:50:16.234 E/bt-btm ( 7602): new address: 50:2e:b5:8d:c6:dc

04-25 15:50:16.234 E/bt-btm ( 7602): new address: 50:2e:b5:8d:c6:dc

04-25 15:50:16.421 E/bt-btm ( 7602): new address: 50:2e:b5:8d:c6:dc

04-25 15:50:16.421 E/bt-btm ( 7602): new address: 50:2e:b5:8d:c6:dc

04-25 15:50:16.602 E/bt-btm ( 7602): new address: 50:2e:b5:8d:c6:dc

04-25 15:50:16.602 E/bt-btm ( 7602): new address: 50:2e:b5:8d:c6:dc

04-25 15:50:16.711 D/StatusBar.MSimNetworkController( 4259): refreshViews phoneId =0mMSimDataConnected =false

04-25 15:50:16.711 D/StatusBar.MSimNetworkController( 4259): refreshViews mMSimDataActivity =0

04-25 15:50:16.714 D/StatusBar.MSimNetworkController( 4259): refreshViews: Data not connected!! Set no data type icon / Roaming for phoneId: 0

04-25 15:50:16.784 E/bt-btm ( 7602): new address: 50:2e:b5:8d:c6:dc

04-25 15:50:16.785 E/bt-btm ( 7602): new address: 50:2e:b5:8d:c6:dc

04-25 15:50:16.967 E/bt-btm ( 7602): new address: 50:2e:b5:8d:c6:dc

04-25 15:50:16.968 E/bt-btm ( 7602): new address: 50:2e:b5:8d:c6:dc

04-25 15:50:17.151 E/bt-btm ( 7602): new address: 50:2e:b5:8d:c6:dc

04-25 15:50:17.151 E/bt-btm ( 7602): new address: 50:2e:b5:8d:c6:dc

04-25 15:50:17.198 I/WCNSS_FILTER( 7923): ibs_msm_serial_clock_vote: vote UART CLK OFF using UART driver's ioctl()

04-25 15:50:17.288 D/BtGatt.GattService( 7602): stopScan() - queue size =1

04-25 15:50:17.290 D/BtGatt.GattService( 7602): unregisterClient() - clientIf=9

04-25 15:50:17.298 I/WCNSS_FILTER( 7923): ibs_msm_serial_clock_vote: vote UART CLK ON using UART driver's ioctl()

04-25 15:50:17.302 D/BtGatt.GattService( 7602): onScanFilterParamsConfigured() - clientIf=9, status=0, action=1, availableSpace=16

04-25 15:50:17.303 D/BtGatt.ScanManager( 7602): callback done for clientIf - 9 status - 0

04-25 15:50:17.303 D/BtGatt.ScanManager( 7602): stop scan

04-25 15:50:17.303 D/BtGatt.ScanManager( 7602): configureRegularScanParams() - queue=0

04-25 15:50:17.303 D/BtGatt.ScanManager( 7602): configureRegularScanParams() - ScanSetting Scan mode=-2147483648 mLastConfiguredScanSetting=2

04-25 15:50:17.303 D/BtGatt.ScanManager( 7602): configureRegularScanParams() - queue emtpy, scan stopped

04-25 15:50:17.315 D/BtGatt.GattService( 7602): registerClient() - UUID=e35c21ce-d1bb-4115-b3d2-7ee957ef2d10

04-25 15:50:17.316 D/BtGatt.GattService( 7602): onClientRegistered() - UUID=e35c21ce-d1bb-4115-b3d2-7ee957ef2d10, clientIf=9

04-25 15:50:17.317 D/BluetoothLeScanner(24736): onClientRegistered() - status=0 clientIf=9

04-25 15:50:17.318 D/BtGatt.GattService( 7602): start scan with filters

04-25 15:50:17.319 D/BtGatt.ScanManager( 7602): handling starting scan

04-25 15:50:17.325 D/BtGatt.GattService( 7602): onScanFilterEnableDisabled() - clientIf=9, status=0, action=1

04-25 15:50:17.325 D/BtGatt.ScanManager( 7602): callback done for clientIf - 9 status - 0

04-25 15:50:17.327 D/BtGatt.GattService( 7602): onScanFilterParamsConfigured() - clientIf=9, status=0, action=0, availableSpace=15

04-25 15:50:17.327 D/BtGatt.ScanManager( 7602): callback done for clientIf - 9 status - 0

04-25 15:50:17.327 D/BtGatt.ScanManager( 7602): configureRegularScanParams() - queue=1

04-25 15:50:17.327 D/BtGatt.ScanManager( 7602): configureRegularScanParams() - ScanSetting Scan mode=2 mLastConfiguredScanSetting=-2147483648

04-25 15:50:17.334 E/bt-btm ( 7602): new address: 50:2e:b5:8d:c6:dc

04-25 15:50:17.334 E/bt-btm ( 7602): new address: 50:2e:b5:8d:c6:dc

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.