Android : Android, get the object of a running service

on Thursday, July 10, 2014


Background: I'm running a background service (independent of the app opened or not) to maintain connection with Tizen-based app on Gear2 (not Android, hence the manual maintenance).


Whenever my phone apps (multiple apps) have data to send to send to the service, I need to get the 'connection' object inside the service and call 'send'.


So my question is: how can I get running service object?


If I can get that service, my code will be like this:



MyConnection connection = runningService.getConnection()
connect.send(message);


Thanks.


0 comments:

Post a Comment