title: Android prevent deleting application offline data or database on Clear data event
body: <p>In case of <strong>network unavailability</strong>, <strong>storing some important information</strong> into the <strong>sqlite database</strong> and <strong>file</strong> on internal storage. When <strong>network available</strong>, it will sync to the server in background.</p>
  
  <p>But when a user <strong>performs Clear Data</strong>, it <strong>deletes database</strong> and <strong>file</strong> stored on internal storage. Because of that, I am facing lot much data loss.</p>
  
  <p>I already search on, how to catch clear data event and related below questions:</p>
  
  <ul>
  <li><a href="https://stackoverflow.com/questions/10700146/is-there-any-way-to-capture-the-clear-data-action-programmatically-in-applicatio">Prevent deleting data</a></li>
  <li><a href="https://stackoverflow.com/questions/10700146/is-there-any-way-to-capture-the-clear-data-action-programmatically-in-applicatio">Catch Clear data event</a></li>
  <li><a href="https://stackoverflow.com/questions/6531173/how-to-disable-the-clear-data-button-in-application-info-of-manage-application">Disable Clear data option</a></li>
  </ul>
  
  <p>Also <strong>I can not store that data on external storage</strong>, because it can
  easily access by user using File managers and they can delete it
  manually.</p>
  
  <p>So my questions are:</p>
  
  <ol>
  <li><p>How I can prevent my offline data from deleting?</p></li>
  <li><p>Is there any way to save offline data at secure place and access it only through application?</p></li>
  </ol>