Saving and retrieving values with SharedPreferences
<p>I want to save two values using shared preferences and get those values in other classes. Can any one please give me information about how to set shared preferences and getting value from shared preferences.</p>

<p>I am using following code:</p>

<pre><code>SharedPreferences settings =  
        getSharedPreferences("MyGamePreferences", MODE_WORLD_READABLE); 

    SharedPreferences gameSettings = getSharedPreferences("MyGamePreferences", MODE_WORLD_READABLE);  
    SharedPreferences.Editor prefEditor = gameSettings.edit();  
    prefEditor.putString("KEY", "e6c77c29021c9b3bd55aa0e9b7687ad9");  
    prefEditor.putString("SECRET", "ca85fa3fe86edaf2");
    prefEditor.commit();
</code></pre>
