title: Creating SQLite database on Internal storage ANDROID
body: <p>I am trying to create a SQLIte database on Internal Storage in my Xamarin application. I am creating a system for an offline environment where at least 3 applications are inter-connected with shared data. So if one application creates some data the other application should be able to read that.</p>
  
  <p>The Database project is a Portable Class Library which I plan to include in all three applications.</p>
  
  <p>My DbHelper is as follows:</p>
  
  <pre><code>public Database()
  {
      string folder = "/data/data/Anchor.Main";
      _dbPath = System.IO.Path.Combine(folder, "Anchor.db");
  
      try
      {
          if (!System.IO.Directory.Exists(folder))
          {
              System.IO.Directory.CreateDirectory(folder); //Getting error here
          }
  
          _connection = new SQLiteConnection(_dbPath);
          _connection.CreateTable&lt;Orders&gt;();
          _connection.CreateTable&lt;Items&gt;();    
  
      }
      catch(Exception ex)
      {  }
  
  }
  </code></pre>
  
  <p>I get error which says </p>
  
  <blockquote>
    <p>Access to the path "/data/data/Anchor.Main" is denied.</p>
  </blockquote>
  
  <p>Following is the stack trace</p>
  
  <blockquote>
    <p>at System.IO.Directory.CreateDirectoriesInternal (System.String path)
    [0x0004b] in &lt;3fd174ff54b146228c505f23cf75ce71>:0    at
    System.IO.Directory.CreateDirectory (System.String path) [0x00075] in
    &lt;3fd174ff54b146228c505f23cf75ce71>:0    at
    anchorapp.db.Helper.Database..ctor () [0x0002e]</p>
  </blockquote>
  
  <p>I understand this is because of the permissions, but what permissions do I need to set in order to write to the Internal storage from a PCL?</p>