Commit e35a03c1 authored by Tanmim Hanifa's avatar Tanmim Hanifa
Browse files

Updating files
parent c4c7f785
......@@ -37,7 +37,7 @@
<ConfirmationsSetting value="0" id="Add" />
<ConfirmationsSetting value="0" id="Remove" />
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">
......
......@@ -29,7 +29,8 @@ public class MainMenuActivity extends AppCompatActivity {
Intent intent = getIntent();
final String username = intent.getStringExtra("username");
final String name = intent.getStringExtra("name");
final int age = intent.getIntExtra("age", -1);
final String dob = intent.getStringExtra("dob");
final String email = intent.getStringExtra("email");
......@@ -40,7 +41,9 @@ public class MainMenuActivity extends AppCompatActivity {
Intent userIntent = new Intent(MainMenuActivity.this, UserAreaActivity.class);
userIntent.putExtra("name", name);
userIntent.putExtra("username", username);
userIntent.putExtra("age", age);
userIntent.putExtra("dob", dob);
userIntent.putExtra("email", email);
MainMenuActivity.this.startActivity(userIntent);
}
});
......
......@@ -22,10 +22,11 @@ public class RegisterActivity extends AppCompatActivity {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_register);
final EditText etAge = (EditText) findViewById(R.id.etAge);
final EditText etDob = (EditText) findViewById(R.id.etDob);
final EditText etName = (EditText) findViewById(R.id.etName);
final EditText etUsername = (EditText) findViewById(R.id.etUsername);
final EditText etPassword = (EditText) findViewById(R.id.etPassword);
final EditText etEmail = (EditText) findViewById(R.id.etEmail);
final Button btnRegister = (Button) findViewById(R.id.btnRegister);
......@@ -35,7 +36,9 @@ public class RegisterActivity extends AppCompatActivity {
final String name = etName.getText().toString();
final String username = etUsername.getText().toString();
final String password = etPassword.getText().toString();
final int age = Integer.parseInt(etAge.getText().toString());
final String dob = etDob.getText().toString();
final String email = etEmail.getText().toString();
Response.Listener<String> responseListener = new Response.Listener<String>(){
......@@ -62,10 +65,11 @@ public class RegisterActivity extends AppCompatActivity {
}
};
RegisterRequest registerRequest = new RegisterRequest(name, username, age, password, responseListener);
RegisterRequest registerRequest = new RegisterRequest(name, username, dob, email, password, responseListener);
RequestQueue queue = Volley.newRequestQueue(RegisterActivity.this);
queue.add(registerRequest);
}
});
}
......
......@@ -11,16 +11,17 @@ import java.util.Map;
public class RegisterRequest extends StringRequest {
private static final String REGISTER_REQUEST_URL = "http://doc.gold.ac.uk/~thani001/travelpals/Register.php";
private static final String REGISTER_REQUEST_URL = "http://doc.gold.ac.uk/~thani001/travelpals/RegisterTDB.php";
private Map<String, String> params;
public RegisterRequest(String name,String username, int age, String password, Response.Listener<String> listener){
public RegisterRequest(String name, String username, String dob, String email, String password, Response.Listener<String> listener){
super(Method.POST, REGISTER_REQUEST_URL, listener, null);
params = new HashMap<>();
params.put("name", name);
params.put("username", username);
params.put("password", password);
params.put("age", age + "");
params.put("dob", dob + "");
params.put("email", email);
}
@Override
......
......@@ -13,18 +13,22 @@ public class UserAreaActivity extends AppCompatActivity {
setContentView(R.layout.activity_user_area);
final EditText etUsername = (EditText) findViewById(R.id.etUsername);
final EditText etAge = (EditText) findViewById(R.id.etAge);
final EditText etDob = (EditText) findViewById(R.id.etDob);
final EditText etName = (EditText) findViewById(R.id.etName);
final EditText etEmail = (EditText) findViewById(R.id.etEmail);
Intent userIntent = getIntent();
String name = userIntent.getStringExtra("name");
int age = userIntent.getIntExtra("age", -1);
String email = userIntent.getStringExtra("email");
String dob = userIntent.getStringExtra("dob");
String username = userIntent.getStringExtra("username");
etUsername.setText(username);
etName.setText(name);
etAge.setText(age + "");
etDob.setText(dob);
etEmail.setText(email);
}
}
......@@ -52,13 +52,15 @@ public class loginActivity extends AppCompatActivity {
if(success){
String name = jsonResponse.getString("name");
int age = jsonResponse.getInt("age");
String dob = jsonResponse.getString("dob");
String username = jsonResponse.getString("username");
String email = jsonResponse.getString("email");
Intent intent = new Intent(loginActivity.this, MainMenuActivity.class);
intent.putExtra("name", name);
intent.putExtra("age", age);
intent.putExtra("dob", dob);
intent.putExtra("username", username);
intent.putExtra("email", email);
loginActivity.this.startActivity(intent);
......
......@@ -26,14 +26,27 @@
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:inputType="number"
android:inputType="date"
android:ems="10"
android:id="@+id/etAge"
android:hint="Age"
android:id="@+id/etDob"
android:hint="YYYY-MM-DD"
android:layout_marginBottom="10dp"
android:layout_below="@id/etName"
android:layout_alignStart="@id/etName" />
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:inputType="textEmailAddress"
android:ems="10"
android:id="@+id/etEmail"
android:hint="Email Address"
android:layout_marginBottom="10dp"
android:layout_alignStart="@id/etDob"
android:layout_below="@id/etDob"/>
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
......@@ -41,8 +54,8 @@
android:ems="10"
android:id="@+id/etUsername"
android:hint="Username"
android:layout_below="@id/etAge"
android:layout_alignStart="@+id/etAge"
android:layout_below="@id/etEmail"
android:layout_alignStart="@+id/etEmail"
android:layout_marginBottom="10dp" />
<EditText
......
......@@ -33,9 +33,9 @@
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:inputType="number"
android:inputType="date"
android:ems="10"
android:id="@+id/etAge"
android:id="@+id/etDob"
android:layout_below="@+id/textView2"
android:layout_alignStart="@+id/etUsername"
tools:ignore="LabelFor" />
......@@ -45,7 +45,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView3"
android:layout_below="@+id/etAge"
android:layout_below="@+id/etDob"
android:layout_centerHorizontal="true"
android:layout_marginTop="18dp"
tools:ignore="HardcodedText" />
......@@ -67,6 +67,28 @@
android:ems="10"
android:id="@+id/etName"
android:layout_below="@+id/textView3"
android:layout_alignStart="@+id/etAge"
android:layout_alignStart="@+id/etDob"
tools:ignore="LabelFor" />
<TextView
android:text="E-Mail"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="18dp"
android:id="@+id/textView4"
android:layout_below="@+id/etName"
android:layout_centerHorizontal="true"
tools:ignore="HardcodedText" />
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:inputType="textEmailAddress"
android:ems="10"
android:id="@+id/etEmail"
android:layout_below="@+id/textView4"
android:layout_alignStart="@+id/etName"
tools:ignore="LabelFor" />
</RelativeLayout>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment