title: When is a shared preferences file first created?
body: <p>I wanted to know when is a shared preference file created for the first time?</p>
  
  <p>I have the following code:  </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;  
  &lt;PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"&gt;  
      &lt;PreferenceCategory android:title="User settings"&gt;  
          &lt;EditTextPreference android:title="User Name"
          android:key="userName" android:summary="Please Enter User Name"&gt;&lt;/EditTextPreference&gt;  
          &lt;EditTextPreference android:title="Password"
          android:key="password" android:summary="Password Here"
          android:inputType="textPassword"&gt;&lt;/EditTextPreference&gt;
  &lt;/PreferenceCategory&gt;  
  
  &lt;/PreferenceScreen&gt;  
  
  
    public class PrefsActivity extends PreferenceActivity {  
      /** Called when the activity is first created. */  
      @Override  
      public void onCreate(Bundle savedInstanceState) {  
          super.onCreate(savedInstanceState);  
          addPreferencesFromResource(R.xml.prefs);  
      }  
  }  
  </code></pre>
  
  <p>Also, how can i use getSharedpreference(), with filename? I don't know if I have to first create this file and place it in app's data directory?  </p>
  
  <p>I meant When is a shared preferences file first created: when the application is installed, or some time later? If later, when?</p>