I am creating an xmpp chat client for android. Everything related to asmack has been done and i can retrieve and show the friends list in the main activity. also i am able to receive chat messages from my friends. i am unable to send data from chat window to the service. so that i can reply and send chat messages to my friends. i have looked into examples but no one has exactly what i want. notice that i cant use onbind method because the service is not bound to any activity in particular but a number of activities can send data to the service.
a logical explanation would be good. if some one knows about some code sample which exactly does this would be great.
also i need to update chat window from the service when the xmpp connection recieves a chat message.
Thanks in advance
You have to Override onStart Method in your service.OnStart method you can get intent of Activity. If you want to pass ArrayList from activity to service,you can convert your arraylist to array.
In you Activity
in you service