Keeping Socket.IO connection alive after Android Crosswalk Embedded Webview onStop

479 views Asked by At

I have a Crosswalk Embedded WebView implementing Socket.IO and when the activity is stopped the connection is dropped after about 20 seconds. How can I keep the connection alive?

  • Crosswalk v12.41.296.9
  • Socket.IO v1.3.5
  • Android SDK v22
1

There are 1 answers

0
user3291590 On

If you want to keep connection alive you have to keep socket.io connection alive. For socket.io connection keep alive you have to use service (not Activity). Your service will carry socket.io connection. when activity start your service start, service will run background of the application and when activity stop service will not stop, until you tell him to stop. You can get more knowledge about service from here.