Welcome Guest,Register Now
Log In

ANT Forum

Welcome guest, please Login or Register

   

New ANT Android SDKs released (ANT C.B3 and ANT+ P.B2)

RankRankRankRank

Total Posts: 313

Joined 2011-09-12

PM

Attention ANT and ANT+ Android Developers:

Today we are happy to announce the release of a new version of both the ANT and ANT+ Android SDKs. There are many bug fixes and many improvements and new features such as support for ANT+ Remote Control profile and requesting common pages.

New Versions:
Today (8 Aug 2014) we are releasing:
-ANT SDK v.C.B3
-ANT+ SDK v.P.B2
-ANT+ SDK v.P.B2.MO1(members-only release with trainer support)

The included ANT Radio Service 4.7.0 and ANT+ Plugins Service 3.1.0 will be pushed to the Play Store on Monday.

Distribution:
* GitHub at https://github.com/ant-wireless/ANT-Android-SDKs. We encourage everyone to sign up as a watcher on that repo so you will be notified whenever SDK changes are made.
* ThisIsAnt (only source for Members Only Release)http://www.thisisant.com/developer/resources/downloads/. [NOTE: Will go live on Tuesday, use GitHub until then]

The members-only version includes support for the Fitness Equipment Controls - including trainer and stationary bike devices. To use it download the members-only zip and reference the PluginLib 'MO' version contained therein in your apps.

Changelogs:
Instead of making a massive post here, the full changelogs are easily viewable on GitHub:
ANT+ SDK: https://github.com/ant-wireless/ANT-Android-SDKs/tree/master/ANT Android SDK
ANT SDK: https://github.com/ant-wireless/ANT-Android-SDKs/tree/master/ANT+ Android SDK

Note on Future Announcements:
Major updates will always be posted in the forums here, but moving forward any minor updates to the SDKs may only be posted to GitHub. So, if you want to monitor all updates, subscribe as a watcher on the GitHub project.      

Signature

Dynastream Developer

RankRankRankRank

Total Posts: 313

Joined 2011-09-12

PM

Edit: thisisant zips will be live in the downloads section tomorrow morning. I will comment here when they are up.      

Signature

Dynastream Developer

RankRankRankRank

Total Posts: 313

Joined 2011-09-12

PM

The SDK zips, including the member-only versions are now live on thisisant.com: http://www.thisisant.com/developer/resources/downloads/      

Signature

Dynastream Developer

RankRankRankRank

Total Posts: 313

Joined 2011-09-12

PM

Just as a public notice, we have received a few comments on our decision to push the services to the Play Store without giving some type of developer testing time. In this previous case the timing of the updates was not flexible because a very important customer requested we post some fixes immediately. Additionally, the changeset was specifically controlled to mitigate possible problems since the release candidate posted here a couple weeks ago. Apart from an exceptional circumstance like this, we do agree with you in principle and our strategy going forward is to have a week time span between posting SDK updates to GitHub/thisisant,com and pushing live versions to the Play Store.

Just as a reminder, the following notification mechanisms are available to stay up to date:

GitHub - If you subscribe as a watcher to the GitHub repo, you can set up receiving a notification every time there is a published release. Unfortunately we did not use the publish mechanism properly in the past, but you can count on it for the future.

Forum post (http://www.thisisant.com/forum/viewforum/30/) - We will make a new sticky post in the mobile forums for new versions. We will also comment on the sticky note for the previous release so if you are subscribed for notifications on that one, you can follow to the next.

Critcal Bytes RSS feed (http://www.thisisant.com/feeds/cbytes/) - For public apk releases we will always push a critical bytes post after the resources are available      

Signature

Dynastream Developer

Avatar
RankRankRankRank

Total Posts: 149

Joined 2014-04-02

PM

Just updated to this version of the ANT+ API. There was a compile error (would be good to have some warning that an update introduces breaking changes) due to the new supplementalSoftwareRevision parameter of AntPlusCommonPcc.IProductInformationReceiver.onNewProductInformation(). This is easy enough to deal with (the version string is now built from both revision numbers), but my question is where I can find constants for the 'supplemental version invalid' and 'supplemental version unknown' values?

Edit: These values aren't actually the best way to check for a valid value. Instead I just check that the value is >= 0 and < 0xFF, or else there is no supplemental software revision.      

Signature

blackramlabs.com

RankRankRankRank

Total Posts: 313

Joined 2011-09-12

PM

The javadoc for onNewProductInformation() explains the values you can expect. An example of a recommended usage is in the plugin sampler:
textView_mainSoftwareRevision.setText(String.valueOf(mainSoftwareRevision));

if (
supplementalSoftwareRevision == -2)
    
// Plugin Service installed does not support supplemental revision
    
textView_supplementalSoftwareRevision.setText("?");
else if (
supplementalSoftwareRevision == 0xFF)
    
// Invalid supplemental revision
    
textView_supplementalSoftwareRevision.setText("");
else
    
// Valid supplemental revision
    
textView_supplementalSoftwareRevision.setText(", " String.valueOf(supplementalSoftwareRevision)); 
     

Signature

Dynastream Developer

Avatar
RankRankRankRank

Total Posts: 149

Joined 2014-04-02

PM

I was looking for the constants used by the API internally, rather than having to use magic numbers. Reading the profile doc I see that this is actually coming from a byte, and only 0-0xFE are valid values anyway. The Plugin Sampler also does not deal with constructing a single version number from the main and supplemental parts.

I ended up with this:
@Override
  
public void onNewProductInformation(long estTimestampEnumSet<EventFlageventFlags,
    
int mainSoftwareRevisionint supplementalSoftwareRevisionlong serialNumber{
   
// Build up the firmware version from main and supplemental revision numbers.
   
StringBuilder softwareRevision =
     new 
StringBuilder(Integer.toString(mainSoftwareRevision));
   if((
supplementalSoftwareRevision >= 0
     && (
supplementalSoftwareRevision 0xFF)) {
    
// Append the supplemental version number
    
softwareRevision.append('.');
    
softwareRevision.append(Integer.toString(supplementalSoftwareRevision));
   
}

   AntPlusSensor
.this.updateSoftwareRevision(softwareRevision.toString());
   
AntPlusSensor.this.updateSerialNumber(serialNumber);
  


I am using the version as a String, but you could convert this to a number too.      

Signature

blackramlabs.com

RankRankRankRank

Total Posts: 313

Joined 2011-09-12

PM

Announcement: Beta releases for the new version of the SDK are being posted, refer to http://www.thisisant.com/forum/viewthread/4516/ for more information or to ask questions.      

Signature

Dynastream Developer