title: Android Twilio Programmable Chat disconnect when app goes to background
body: <p>I developed chat application using Twilio Programmable Chat SDK on Android.</p>
  
  <p><strong>Issue :</strong> </p>
  
  <p>There are two users <strong>A &amp; B</strong> joined to a Channel <strong>"AB_Private"</strong> and doing chat working fine.</p>
  
  <p>Now user <strong>A press home button</strong> and put application in <strong>background</strong>. Twilio SDK detect inactivity and start sending ping to server to keep connection a live. </p>
  
  <p>Working fine for 4-5 minutes but after that twilio disconnect from the socket and start retrieving request. But it never connects till user app is in background.</p>
  
  <p>Now when app comes to foreground, twilio reset the session and try to reconnect but it takes more time to connect, sometime it takes up to 5 minutes.</p>
  
  <p><strong>So my question is how can I keep connection alive with Twilio when application is in background?</strong></p>
  
  <p>Any Help will be appreciated.</p>