title: SharedPreferences managing between different packages
body: <p>I'm developing one app, with the package <code>com.example1</code> and I'm doing another module to use as a library with the package <code>com.example2</code>.</p>
  
  <p>On my module (<code>com.example2</code>) I'm using this static functions:</p>
  
  <pre><code>    public static void saveLastDownload(Activity mActivity, long numberLong) {
          SharedPreferences sharedPref = mActivity.getPreferences(Context.MODE_APPEND);
          SharedPreferences.Editor editor = sharedPref.edit();
          editor.putLong(dataLastDownloadKey, numberLong);
          boolean commit = editor.commit();
      }
  
      public static long readLastDownload(Activity mActivity, long defaultValue) {
          SharedPreferences sharedPref = mActivity.getPreferences(Context.MODE_PRIVATE);
          return sharedPref.getLong(dataLastDownloadKey, defaultValue);
      }
  </code></pre>
  
  <p>I'm trying to <code>saveDownload</code> and <code>readLastDownload</code> from <code>com.example1</code> but I haven't got any value on these shared preferences. How can I read this value in a modern way (without any security holes, although I'm not interested in making it private).</p>
  
  <p>How could I do it?</p>
  
  <p>Thank you very much in advance.</p>