title: Firebase didn't update the online status using ".info/connected", what is the problem?
body: <p>I am developing an android dating app, where I want to show the user online status. Here I use Firebase realtime database technology. But I didn't find any working presence system over the internet. I am stuck in here please help me to solve the issue.</p>
  <pre><code>public void manageConnections(String gender, String uid){
      DatabaseReference onlineStatus = FirebaseDatabase.getInstance().getReference(&quot;Users&quot;).child(gender).child(uid).child(&quot;ol&quot;);
      DatabaseReference connectedRef = FirebaseDatabase.getInstance().getReference(&quot;.info/connected&quot;);
      connectedRef.addValueEventListener(new ValueEventListener() {
          @Override
          public void onDataChange(@NonNull DataSnapshot snapshot) {
              boolean connected = snapshot.getValue(Boolean.class);
              if (connected) {
                  Log.d(TAG, &quot;onDataChange: connected&quot;);
                  onlineStatus.onDisconnect().setValue(false);
                  onlineStatus.setValue(true);
              } else {
                  Log.d(TAG, &quot;onDataChange: disconnected&quot;);
                  onlineStatus.setValue(false);
              }
          }
  
          @Override
          public void onCancelled(@NonNull DatabaseError error) {
          }
      });
  }
  </code></pre>