Data collection and processing in the background Android

I am trying to collect data in the background and do some processing on it (accelerometer). I am having trouble getting a reference to the board outside of the onServiceConnected function. Is there some kind of data event listener that I can use? Thanks in advance,

Comments

Hey
I am also streaming data and write it to a database. It happened that for about 30 minutes the board seemed to loose connection. Right now I adapted the code from the sample app. Do you start streaming in a background service and have experiences with that?
Best regards!