0

my app has two activity. 1. To show the names of all the user connected to the server in a recyler view. 2. On clicking a name, a new activity is created which will be there to show and have a private chat with the user.

I am using Nodejs as server and Socketio. I want the socket.emit() and socket.on() in android to work in background and can be used for all the activities. i.e I do not want to call socket.connect() each time the activity changes. Is there a way to do it?

heroxxx
  • 29
  • 6
  • You can check this other question: https://stackoverflow.com/questions/38095293/android-storing-socket-io-object-for-multiple-activities – Marcos Casagrande Apr 05 '19 at 11:19
  • And this: https://stackoverflow.com/questions/32102332/best-way-to-implement-socket-io-in-android – Marcos Casagrande Apr 05 '19 at 11:20
  • Possible duplicate of [Android Storing Socket.io object for multiple activities](https://stackoverflow.com/questions/38095293/android-storing-socket-io-object-for-multiple-activities) – Torsten Ojaperv Apr 05 '19 at 11:50

0 Answers0