What I am trying to accomplish:
I am trying to communicate from Android Emulator (via the ANT bridge) to an Ant-enabled Android device. I am using the SampleAcquireChannel application found on the download page of thisisant.
Problem description:
Acquiring channels with PredefinedNetwork.PUBLIC network without any other capabilities throws ChannelNotAvailableReason.NETWORK_NOT_AVAILABLE. When I try with PredefinedNetwork.ANT_FS, it does not throw, however, the Android device cannot find the emulator (gives No Device Found).
What I have tried:
http://www.thisisant.com/APIassets/Android_ANT_API/com/dsi/ant/channel/AntChannelProvider.html says that "If the reason code is ChannelNotAvailableReason.NETWORK_NOT_AVAILABLE, applications should attempt to acquire a channel again when receiving a ACTION_CHANNEL_PROVIDER_STATE_CHANGED with NEW_CHANNELS_AVAILABLE being true as a network slot may have become available as well."
I do not know to change the code to use "NEW_CHANNELS_AVAILABLE " flag on trying to acquire the channel again. How do I do this?
My environment: I have the Ant Radio Service, Ant USB service both installed and tested on the emulator and the test device. I tested both of them by connecting to Stride SDM sensor from Garmin. The emulator is running on Windows machine with the bridge enabled at port 9050. The test device is Galaxy S3 and I have a Ant USB stick with micro-to-usb cable hooked up to it so it can use Ant Radio Services.
Please help me. Any pointers are appreciated. Thank you for your time.