Android Open Source - BikeStation Account Activity






From Project

Back to project page BikeStation.

License

The source code is released under:

GNU General Public License

If you think the Android project BikeStation listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.bikestation.app.activity;
/*from   w ww  .  j a va2s . c o  m*/
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ListView;

import com.kdravolin.smartlock.app.R;

import butterknife.ButterKnife;
import butterknife.InjectView;


public class AccountActivity extends ActionBarActivity {

    @InjectView(R.id.btEnter)
    Button btnEnter;
    @InjectView(R.id.etLogin)
    EditText etLogin;
    @InjectView(R.id.etPassword)
    EditText etPassword;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_account);
        ButterKnife.inject(this);

        SharedPreferences settings = getSharedPreferences("bike", 0);
        String login = settings.getString("login", null);
        String password = settings.getString("password", null);

        if (login != null){
            etLogin.setText(login);
        }

        btnEnter.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                SharedPreferences settings = getSharedPreferences("bike", 0);
                SharedPreferences.Editor editor = settings.edit();
                editor.putString("login", etLogin.getText().toString());
                editor.putString("password", etPassword.getText().toString());
                editor.commit();

                Intent intent = new Intent(AccountActivity.this, DeviceActivity.class);
                AccountActivity.this.startActivity(intent);
            }
        });
    }

}




Java Source Code List

com.bikestation.app.BluetoothConnector.java
com.bikestation.app.BluetoothWorker.java
com.bikestation.app.ExtApp.java
com.bikestation.app.History.java
com.bikestation.app.Lock.java
com.bikestation.app.User.java
com.bikestation.app.account.AccountAuthenticator.java
com.bikestation.app.account.AuthenticationService.java
com.bikestation.app.activity.AccountActivity.java
com.bikestation.app.activity.BikesActivity.java
com.bikestation.app.activity.DeviceActivity.java
com.bikestation.app.activity.TimeActivity.java
com.bikestation.app.adapter.BikesAdapter.java
com.bikestation.app.adapter.DeviceAdapter.java