can't retrieve shared preference from other apps Android
<p>i've read that shared preferences can be retrieved from outside my application, i mean if i save a preference in X app i can retrieve it from Y app, the thing is, that's not working to me, and the question is how to do it? Here's is my code, i don't know where i went wrong: </p>

<pre><code>final String APP = "Test"; 
        final String USER_ID = "User Id";
        String myId;

        SharedPreferences prefs = getSharedPreferences(APP, MODE_PRIVATE);

        if (prefs.getString(USER_ID, null) == null){
            if(phoneNumber != null){
                myId = phoneNumber;
                prefs.edit().putString(USER_ID, myId).commit();
            }
            if(deviceId != null){
                myId = deviceId;
                prefs.edit().putString(USER_ID, myId).commit();
            }else{
                myId = randomId.toString();
                prefs.edit().putString(USER_ID, myId).commit();
            }
        }
</code></pre>

<p>Then i try to retrieve this preference from a different app like this:</p>

<pre><code>final String APP = "Test"; 
        final String USER_ID = "User Id";

        SharedPreferences sp = getSharedPreferences(APP, MODE_PRIVATE);
        String s = sp.getString(USER_ID, null);
</code></pre>

<p>but i only get a null object, what did i do wrong? I don't my the mistake. </p>

<p>Thanks in advance.</p>
