3232public class LoginActivity extends Activity {
3333 // The Button that calls the authentication function
3434 Button login_buttons ;
35- // The EditText that holds the username entered by the user
35+ // The Button that calls the create user function
36+ Button createuser_buttons ;
37+ // The EditText that holds the username entered by the user
3638 EditText Username_Text ;
3739 // The EditText that holds the password entered by the user
3840 EditText Password_Text ;
@@ -59,6 +61,15 @@ public void onClick(View v) {
5961 // TODO Auto-generated method stub
6062 performlogin ();
6163 }
64+ });
65+ createuser_buttons = (Button ) findViewById (R .id .button_CreateUser );
66+ createuser_buttons .setOnClickListener (new View .OnClickListener () {
67+
68+ @ Override
69+ public void onClick (View v ) {
70+ // TODO Auto-generated method stub
71+ createUser ();
72+ }
6273 });
6374 fillData_button = (Button ) findViewById (R .id .fill_data );
6475 fillData_button .setOnClickListener (new View .OnClickListener () {
@@ -77,11 +88,22 @@ public void onClick(View v) {
7788
7889 }
7990
80- /*
81- The function that allows the user to autofill the credentials
82- if the user has logged in successfully atleast one earlier using
83- that device
84- */
91+ /*
92+ The function that allows the user to create new user credentials.
93+ This functionality is available only to the admin user.
94+ <<WIP Code>>
95+ ToDo: Add functionality here.
96+ */
97+ protected void createUser () {
98+ Toast .makeText (this , "Create User functionality is still Work-In-Progress!!" , Toast .LENGTH_LONG ).show ();
99+
100+ }
101+
102+ /*
103+ The function that allows the user to autofill the credentials
104+ if the user has logged in successfully atleast one earlier using
105+ that device
106+ */
85107 protected void fillData () throws UnsupportedEncodingException , InvalidKeyException , NoSuchAlgorithmException , NoSuchPaddingException , InvalidAlgorithmParameterException , IllegalBlockSizeException , BadPaddingException {
86108 // TODO Auto-generated method stub
87109 SharedPreferences settings = getSharedPreferences (MYPREFS , 0 );
0 commit comments