title: How to save a part of firebase realtime database in offline mode
body: <p>I wanted to store the specific path in Firebase database (JSON) in local phone storage, not all data at the realtime-Firebase database. Say I have a news-feed path for each user in my Firebase-database and I want to save only the news-feed which is specified for the user instead of loading whole useless data on the local storage of user's mobile.</p>
  
  <p>I read this paragraph from the official <a href="https://firebase.google.com/docs/database/android/offline-capabilities#section-prioritizing-the-local-cache" rel="nofollow noreferrer">Firabase site</a> which mentioned that </p>
  
  <blockquote>
    <p>The Firebase Real-time Database synchronizes and stores a local copy of the data for active listeners. In addition, you can keep specific locations in sync.</p>
  </blockquote>
  
  <pre><code>DatabaseReference scoresRef = FirebaseDatabase.getInstance().getReference("scores");
      scoresRef.keepSynced(true);
  </code></pre>
  
  <p>If this is the solution to my question, then I can use this line directly without writing that line</p>
  
  <pre><code>FirebaseDatabase.getInstance().setPersistenceEnabled(true);
  </code></pre>