Welcome Guest,Register Now
Log In

ANT Forum

Welcome guest, please Login or Register

   

call antplus sdk API’s from withtin an android service

Rank

Total Posts: 9

Joined 0

PM

hello,

I would like to create a android service which uses the latest sdk. is it feasible ?
all the samples assume you are starting from an android activity :-(

I tried from a service and got the following error "java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()"

any help appreciate.
thanks      
Avatar
RankRankRankRank

Total Posts: 149

Joined 2014-04-02

PM

What version of the ANT+ API are you using? The same issue has been reported for a couple of cases before (here and here), and was meant to be fixed. You can still follow the advice given as a work around:
ShaneG - 03 December 2013 01:23 PM
-Call the methods from a thread that has a running looper (such as your main thread, or initialize the looper on a different thread)
     

Signature

blackramlabs.com

Rank

Total Posts: 9

Joined 0

PM

I'am using the version: ANT+_Android_SDK_v.P.B2.
I will try the workaround