Welcome Guest,Register Now
Log In

ANT Forum

Welcome guest, please Login or Register

   

ANT Android Emulator Tools

Avatar
RankRankRankRank

Total Posts: 662

Joined 2012-10-09

PM

A beta version of the tools required to add ANT support in the Android Emulator (using an ANT USB Stick attached to a Windows PC) has been made available for ANT+ Alliance Members. The package can be found in the Beta Downloads section of the ANT+ Members zone.

If you are using these tools, please report back to us on your experience. Depending on this feedback, we will release a version for all ANT+ Adopters as soon as possible.      
RankRankRankRank

Total Posts: 118

Joined 2010-10-25

PM

OK I am giving it a go. Where do you want me to send feedback?

ifor at blueyonder.co.uk      
Avatar
RankRankRankRank

Total Posts: 129

Joined 2010-11-30

PM

Just let us know in this thread - then everyone is kept up-to-date.      
RankRankRankRank

Total Posts: 118

Joined 2010-10-25

PM

Some feedback.

README.txt
I think there are version differences of some form here as things did not match up totally for the instructions. I am using.

Android Development Toolkit
Version: 12.0.0.v201106281929-138431

5.1 I needed (Menu > Window> Android SDK and AVD Manager)
5.2 I needed Available packages, Add Add-on Site... I got a file not found error of some sort doing the addition but it looked to work and not be related to you...

Failed to fetch URL https://dl-ssl.google.com/android/repository/addons_list.xml reaso,n: File not found

Googeling it looks fairly common but I have not been able to get the various fixes working for me.

5.3 I got errors.

Downloading ANT Radio by ANT Wireless, Android API 10, revision 1
File not found: C:\\PROGRA~2\\Android\\android-sdk\\temp\\addon-ant_radio-ant_wireless-10-rev1.zip (Access is denied)
Downloading ANT Radio by ANT Wireless, Android API 7, revision 1
File not found: C:\\PROGRA~2\\Android\\android-sdk\\temp\\addon-ant_radio-ant_wireless-7-rev1.zip (Access is denied)

This is because you need to run the Sdk Manager in Administrator mode. I found http://forum.xda-developers.com/showthread.php?p=19335222 which sorted me out.

5.4 In ‘Android SDK and AVD Manager’ I use the Virtual devices page for this step.

5.5 OK


In use, starting the bridge no trouble, no problem with the configuration tool. First off I tried my own App which has been working well on an Xperia X8 (still waiting on my Active) I had an error first time off. Basically it was a security exception saying I did not have the com.dsi.ant.permission.ANT This is in my manifest. I then tried with a locally built version of ANTPlusDemo and it worked testing with a heart rate strap. I then went back to my App and it worked... After further investigation it looks like the first time I run my app on a newly created emulator I intermittently get this error. It is not every time. I have tried running the ANTPlusDemo as the first thing and have not had a problem with it. I don’t believe I have had a problem running my app after running the demo. Once my App has run I have had no problems with it. I have had this on both the API 7 and the API 10 version.

I have a google doc I can share with ACRA crash reports for the problem in it. There is some stuff in the Logcat from the AntRadioEmulator that may make sense to people. I have also just got the Ant radio bit of my system packaged to a state where I will let people try it. I have separated the Ant interfacing into a separate App from my main App so as to potentially have multiple Apps working with the Ant system simultaneously. There is a separate thread on this issue here somewhere.

Once working I have had no problems. I have not tried changing the buffering things are just working for me.      
Avatar
RankRank

Total Posts: 39

Joined 2011-06-29

PM

Thanks for the feedback ifor!

The README was written to be used with the latest version of ADT (currently 15.0.1), but should work with older versions (just a little more exploring for the correct page).

Google moved dl-ssl.google.com/android/repository/addons_list.xml to .../addons_list-1.xml if anyone else has that problem.

Those Access is Denied errors are that eclipse is not allowed to write to C:/Program Files. I HIGHLY recommend you don't run eclipse as administrator as it can seriously mess up your eclipse settings. Either run the SDK manager as admin or give the local user write permissions to the android-sdk folder.

Lastly the permissions error on the emulator is that your app uses the ANT permission
<uses-permission android:name="com.dsi.ant.permission.ANT" >
which is normally defined in the HAL Service. But the emulator doesn't have that layer, so it gets defined in the Emulator Service apk. If your app gets installed BEFORE the Emulator Service, then that permission gets resolved to unknown, and when you try to use it (bind to ANT service) you get the SecurityException.
Easiest way to avoid this is to install the Emulator APK first.

-Maurits      
RankRankRankRank

Total Posts: 118

Joined 2010-10-25

PM

OK thanks for the feedback.

I will try and get my ADT to update itself, as I look to be behind. I deliberately did not update as soon as ICS came out but now look to be having trouble getting it to update which is a bit anoying. I guess I may have to resort to a reinstall...

Thanks for the explanation on the Permissions issue. Understanding the cause of the problem is reasuring. There are enough things already to test for on inital installation to make checking time consumming. I will take more care with the ordering of the setup in future.

Ifor      
RankRankRankRank

Total Posts: 118

Joined 2010-10-25

PM

I guess it's not posible to combine the ANT Android Emulator with the Google API's version I look to need to use to get the google maps stuff working?

Ifor      
Avatar
RankRankRankRank

Total Posts: 129

Joined 2010-11-30

PM

You may be able to use both the Google Maps API and the ANT emulator by telling your application project to target a Google API version, but running it on an AVD which targets ANT. If this doesn't work, we are able to build a combined target of Google API and ANT - but we would prefer to keep the number of targets to a minimum (it can get confusing enough already).      
RankRankRankRank

Total Posts: 118

Joined 2010-10-25

PM

Ok I gave this a try and I get an error about the google maps library not being avalible when it tries to install my app from eclips.

The main reason for wanting to do it would be testing on the 4.0. Especialy as SE sound like they plan on upgrading there 2011 phones at some point. I can work around by just using OSM and removing the google map support for testing if I end up having to do substantial work with the emulator so it's not too bad.      
Avatar
RankRank

Total Posts: 39

Joined 2011-06-29

PM

I modified the Android 4.0 Google API system image to include the ANT libraries. This should work for any Google target. Just target any Google add-on, say Google APIs 7, and run it on an emulator using the modified 4.0 image
EDIT: The steps to download it and use it are the same as the other ANT add-ons      
RankRankRankRank

Total Posts: 118

Joined 2010-10-25

PM

Thanks I got that downloaded and at least a simple test looks to work with Ant and the map.

Spoted a slight issue with killing the emulator before the bridge, the warning notification looked to being continuasly updated which was a bit anoying till I killed the bridge off.      
Avatar
RankRank

Total Posts: 39

Joined 2011-06-29

PM

I've added that bug to our JIRA (bug tracking) and It will be fixed in the next release. When an ANT channel is active and you kill the emulator it keeps trying to forward the ANT messages, even when it is in the error state.      
RankRankRankRank

Total Posts: 524

Joined 2012-11-15

PM

I am trying out the emulator tools and have followed the readme instructions in the package.

When I launch the ANT Android VM, it makes it through the screen with the small font Android and the blinking underscore after the d. However, it never makes it past the next screen with the large ANDROID and the wave going through the letters. Eclipse console hangs at the "Waiting for HOME ('android.process.acore') to be launched..." message.

If I try to connect via adb to install the Service and Configuration apks, I cannot connect presumably because the VM has not fully loaded yet.

I've created ANT Android emulators for both version 2.1 and 4.0.3 and get the same behavior in both.

I've not had this problem with any of the non-ANT emulators and have successfully written and debugged code using the same Eclipse and SDK installation as I'm using with this.

I'm very eager to get this going and move forward. Any suggestions for getting the VM to fully launch are greatly appreciated.


Thanks,
Tom