Home › Forums › Ask the Flomies › How can I see connected readers using the Android SDK?
Tagged: FloBLE Plus
-
AuthorPosts
-
April 12, 2017 at 11:42 pm #59291
When the Bluetooth reader (Floble Plus) connects I receive the reader in a message as a FMBluetoothDevice. This works perfectly, but when I navigate away and I come back to the activity the reader is obviously gone as a variable. I can store it in my own data structure if I have to, but I was curious if there is a way to view connected devices using the SDK.
April 13, 2017 at 12:37 am #59295It seems if I keep the reader stored and recreate the activity and the scan event is fired, but when I call GetNDEF I just get an exception. Is it due to the activity being a new instance?
I boostrap a FMSessionManager in the ONCreate of the Activity.
BlueToothReaderSessionHandler.Context = this;
BlueToothReaderSessionHandler.Delegate(delegateHandler);
BlueToothReaderSessionHandler.Start();FYI, I ported the SDK to Xamarin so some of the naming conventions have changed.
April 13, 2017 at 9:43 am #59299Hello:
The SessionManager class is a Singleton. It holds the created Devices.
So you should use:
SessionManager.getInstance().getDevices()
April 13, 2017 at 10:27 am #59304Darien, I don’t have a getDevices and I’m running on v2.2 All I see related is mDeviceAddress and mDeviceName which are always null.
April 15, 2017 at 5:24 pm #59338hi Tyler:
In order to support you can you show me the code?? If you need personal support we can set a brief call using skype or zoom…
Thanks
April 16, 2017 at 12:48 am #59341Sure, Darien. Thanks!
Here’s the snippet of code. https://pastebin.com/SiCKyY6c
Please keep in mind that this is Xamarin so the code will look slightly different.
Here’s the contract for FMSessionManager.
April 16, 2017 at 1:07 am #59342My issue is the second time I come to an activity, the FMBluetoothDevice is already connected and I have no way to access it. When an NFC tag is scanned, I get the SDKdidFindUUID event, but I no longer have access to the FMBluetoothDevice . If I attempt to store the FMBluetoothDevice in a static variable, it doesn’t work I assume because the new instance of the activity.
April 19, 2017 at 4:43 am #59477Hi Tyler, we’re working on your support request. Seems your issue is resolved by a new release we’ve been working on so we’re trying to get that to you. Our release process on Android isn’t as mature and automated as on iOS so this has been the challenge. Darien is working on it though and we will get back to you as soon as it’s ready.
Apologies for the delay.
Richard -
AuthorPosts
You must be logged in to reply to this topic.