I'm (sort of) new to android development and I'd like to create an android messenger app based on the PircBot library. There're several constraints I am aware of right now:
I've tried to bind the service from my activity but binder seems to only work with services in the same process. (I'm not sure on this one, search didn't return anything useful)
What's the preferred way to structure my project so that all the constraints can be satisfied? Also what other problems might I ran into?
Sorry for the bad english
IRC service needs to run in its own process so it doesn't interfere with UI while listening to IRC
I don't see any reason why the IRC service would need to run in its own process. A service, is, by definition, an element that does not interact with the user, as stated in the docs:
A Service is an application component representing either an application's desire to perform a longer-running operation while not interacting with the user or to supply functionality for other applications to use.
And, as you said, by making this service run in its own process, it becomes impossible to bind to it (indeed, you need to do IPC communication at that point).
I'm using different activities for different screens so all activities will need to use the service (logged in, joined channel, send/recieve message) and different activities should be notified based on the current state of the connection.
To satisfy this requirement, you can simply use the LocalBroadcastManager to share information from the service to all the activities. Your activities could have BroadcastReceivers for the events they wish to hear (connectionStateChange, MessageReceived, etc.), and would act accordingly.
Finally, because reading other people's code is always a good idea, check out these two similar projects, brought to you by your friendly search engine: