title: Read shared preference of another android application
body: <p>I need to access the Shared Preference file of another application. (<strong>The device is rooted!</strong>) Currently I seem to be facing a permission issues. Here is the current code that I run:</p>
  
  <pre><code>Context con = createPackageContext("com.sam.sample", CONTEXT_IGNORE_SECURITY);
  SharedPreferences sharedPref = con.getSharedPreferences("namefile", MODE_PRIVATE);
  Map data = sharedPref.getString("name", "");
  Log.d("Name", "name:" + name);
  </code></pre>
  
  <p>When I run this code I get the following error:</p>
  
  <blockquote>
    <p>Attempt to read preferences file <strong>/data/data/com.sam.sample/shared_prefs/namefile.xml</strong> without permission</p>
  </blockquote>
  
  <p>I have also tried to run <code>su</code> command but I dont want the user to be notified that I want to get read access with <code>chmod 775</code> on the XML file.</p>
  
  <p>Any help is appreciated.</p>