Im building an Android App in Xamarin that plays music. I have a service that plays the music and a fragment that display the playlist, some times i want a small feedback from the service and so far i was using MessageBus for the communication.

For now the only time that i want a feedback is when the user has select to loop the whole list and when the current track is finished i need to inform the fragment which is the next track in order to highlight it. maybe in the future i will need for feedback.

Is this a bad idea? i should better change the service with a boundService? I have select this method because it is much simpler and the feedback i want is very limited but now i have second thoughts. Thanks

1

There are 1 answers

2
GreyBeardedGeek On BEST ANSWER

As long as you only need to communicate within your own application, there's nothing wrong with using a message bus.

I do this quite a bit, and it works well, and is much less complicated than other methods.

Just make sure that you know the threading model that your event bus is using, and be careful to do non-ui things on a background thread, and ui updates on the main ui thread.