how to use shared preference concept in loginpage in android
<p>when I give username and password on clicking login button means login will get successfully.
when I give username and password on clicking check box and after if I login successfully and I close the application now if I again open the application username and password has to be their in textboxes. now I directly click on login button and it has to be login success fully.</p>

<p>I try this code</p>

<pre><code>public class Login extends Activity {
    CheckBox check;

    private static final String UPDATE_URL = "http://202.62.91.45/NewCozyDine/login1.php3";
    public ProgressDialog progressDialog;
    private EditText UserEditText;
    private EditText PassEditText;

    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        progressDialog = new ProgressDialog(this);
        progressDialog.setMessage("Please wait...");
        progressDialog.setIndeterminate(true);
        progressDialog.setCancelable(false);
        UserEditText = (EditText) findViewById(R.id.username);
        PassEditText = (EditText) findViewById(R.id.password);
        check=(CheckBox) findViewById(R.id.checkbox);
        Button button = (Button) findViewById(R.id.okbutton);
        button.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {
                int usersize = UserEditText.getText().length();
                int passsize = PassEditText.getText().length();
                if(usersize &gt; 0 &amp;&amp; passsize &gt; 0) {
                    progressDialog.show();
                    String user = UserEditText.getText().toString();
                    String pass = PassEditText.getText().toString();
                    doLogin(user, pass);
                } else createDialog("Error","Please enter Username and Password");
            }
        });
</code></pre>

<p>I wrote for login button for xml parser(Validating from server database). how can wrote for check box for remember</p>
