Welcome Guest,Register Now
Log In

ANT Forum

Welcome guest, please Login or Register

   

AsyncScanController - connect after first connection?

Rank

Total Posts: 1

Joined 2020-05-21

PM

Hello,
I'm developing an app that shows a scan UX side-by-side with a connected device UX. I'm seeing behaviour where, when I connect to a device via the AsyncScanController API: https://www.thisisant.com/APIassets/Android_ANT_plus_plugins_API/com/dsi/ant/plugins/antplus/pccbase/AsyncScanController.html
I can no longer connect to any devices found by that scan via the scan controller. Based on the documentation, this makes sense as the docs suggest the scan controller is in fact closed when we connect to a device.

My problem is that I'd like to offer the users the ability to connect to a *different* device, hopefully without starting a new scan. Is that possible?      
Avatar
RankRankRankRank

Total Posts: 741

Joined 2012-09-14

PM

Hi,

I would encourage you to take a look at the MultiDeviceSearch API instead, which uses a single, separate ANT channel rather than the active channel to scan for multiple devices.

There is an example activity included with the Plugin Sampler source code.      
Rank

Total Posts: 6

Joined 0

PM

I gave this api a shot so many times now that i am giving up. It seems like BLE is taking over anyway but just wanted to put this out there.
The sample app is way too cluttered with UI (i am only talking about android here).
I really want to use the Library but each time i go down one path i keep having to pass activity contexts and the UI is created for me. The dialogs are ugly and don't have the proper margins. Up until 2 months ago the shared preferences were world read and caused issues on new android versions. WOrld read went away in android 5 years ago.
The api should not include ui. It should be a rich set of methods that return data structures. Unless I am missing something here. I can't find really any example of this and from the other posts it appears others have the same problem. I want to use this and i don't want to be a complainer but new people coming to ant shouldn''t have to already know how to use the api. there should be examples that are simple the FitnessEquipmentSampler is 2000 lines long!.
I am giving up and going to BLE permanently.