Welcome Guest,Register Now
Log In

ANT Forum

Welcome guest, please Login or Register

   

Getting Started with Development of ANT+ Android Apps

Avatar
RankRankRankRank

Total Posts: 140

Joined 2008-12-09

PM

If you are new to ANT and ANT+, the following post contains several useful resources to learn about the protocol, as well the different development tools that are available. While most of the information is aimed towards development of PC applications, the concepts are the same and will help you ramp up on ANT.
http://www.thisisant.com/component/option,com_fireboard/Itemid,146/func,view/catid,25/id,1169/

You can find the Android API for ANT, along with a list of supported handsets, here
http://www.thisisant.com/pages/developer-zone/android-api


Important

Decoding raw ANT messages corresponding to a device profile requires bitwise operations and unsigned arithmetic. Java does not have unsigned types, so keep this in mind when developing your app.
     

Signature

For a complete list of frequently asked questions and answers, please view the FAQ user profile by clicking on the FAQ user name. 

RankRankRankRank

Total Posts: 523

Joined 2012-11-15

PM

For Android ANT+ mobile development what sort of resource ( including hardware and software) are required apart from ANT+ android APIs ?      
Rank

Total Posts: 0

Joined 2012-11-29

PM

Hi all,

I found in the document "ANT+ Device Profile/Heart Rate Monitor" some helpful code snippets. Helpful because they make things easy to understand. Less helpful because they're written in C, whereas I'm writing an App for Android and therefore use the Android API in Java.

Question now comes down to one thing: How do I implement the "WaitAck" C-function you use in the snippet on page 10, figure 3? Is there a similar method in the Java interface? Which?

A first example to get heart rate from a Garmin belt is running but does not look very stable, so I need further assistance to get into a good working state.

Thank you for your help!
Juergen      
Avatar
RankRankRankRank

Total Posts: 662

Joined 2012-10-09

PM

The code snippets in the device profile document are outdated, and will be removed in the next release.

Please refer to the source code of ANTPlusDemo (included with the Android SDK) for an example of decoding heart rate using the Android API.      
Rank

Total Posts: 0

Joined 2012-11-29

PM

Hmmm, that explains a lot.

It took me more than a week to even roughly understand, what the Demo-Code does. AntPlusManager.java is the central implementation and with over 1.700 lines of code it is really really difficult to read.
For a Demo App it's a problem. A Function to wait for acknowledge would help a lot.

Any ideas how to implement such? Especially with Android and its single-threaded model?

Any ideas welcome.      
RankRankRankRank

Total Posts: 122

Joined 2010-10-25

PM

Android is not single threaded. As said previously the demo code is the way to go but I think you need to improve your Android understanding as well. Coming from an old style C coding style Android is quite a big learning curve I would recomend going though some of that Android tutorials.

Ifor      
Rank

Total Posts: 0

Joined 2012-11-29

PM

You're maybe right. I hope I never stop to learn.
This time I would like to learn more about the ANT API for Android, than about Android itself.

Has anybody a good explanation for these pairs of statements:
init/releaseService, claim/releaseInterface, assign/unassignChannel, open/closeChannel and enable/disbale?

What are they doing internally? When does the designer expect they're called?

Grgts, Juergen      
Avatar
RankRankRankRank

Total Posts: 213

Joined 2011-05-02

PM

Hello,

Prior to starting, I suggest taking a look here. It gives you everything you need to know to get started with Android.

As for open/close channel etc., these details can be found in ANT Message Protocol and Usage.

For more information on the claim/release interface and enable/disable etc, you will need to look at the documentation accompanying the Android SDK. The Android SDK can be found here.

I strongly recommend becoming familiar with Android, how it works, etc before jumping right into the ANT API. There are some really great 'Hello, Android' tutorials available on the site mentioned above to help get you familiar with the various aspects of Android development.

Cheers,

Kassandra      
Rank

Total Posts: 22

Joined 0

PM

Hello

Where is the API hosted now? I can't seem to get there (broken links)

Thanks
Chris      
Avatar
RankRankRankRank

Total Posts: 744

Joined 2012-09-14

PM

Hi,

You can find the API either on the Downloads page under the "Android API" section along with the PC Emulator Bridge, or on the Starting Your Project page in the "I want to create: A Mobile App" section.

Cheers,
Harrison      
Rank

Total Posts: 27

Joined 2013-04-21

PM

As indicated in one of the post of this thread, the ANT and ANT+ code samples you provide, require very java high-skilled knowledge ....

I understand that you have provided good examples, but would it be possible to have step by step examples instead of full complete examples where analysis is complicated ? like for dummies ?

     
Rank

Total Posts: 5

Joined 2014-01-20

PM

For Android ANT and ANT+ mobile development what resource ( including hardware and software( Eclipse ,Java Version)) and API are required ?      
Rank

Total Posts: 5

Joined 2014-01-20

PM

Currently I am using Eclipse Indigo..and Java version 7. We have downloaded the Android ANT SDK 4.0, and gone through the sample code. But it allows me to toggle the "On/Off" button but the RX and Open Channel buttons are greyed out and unable to activate. Please Help ...I need it very urgent...      
Avatar
RankRankRankRank

Total Posts: 129

Joined 2010-11-30

PM

Followed up on Mahesh's query in this thread.