diff --git a/src/main/AndroidManifest.xml b/src/main/AndroidManifest.xml
index f96e9d3..4389266 100644
--- a/src/main/AndroidManifest.xml
+++ b/src/main/AndroidManifest.xml
@@ -16,12 +16,7 @@
-
-
-
-
+
memberData = new HashMap();
+ memberData.put(id, "id");
+ memberData.put(name, "name");
+ memberData.put(dob_month, "dob_month");
+ memberData.put(dob_day, "dob_day");
+ memberData.put(dob_year, "dob_year");
+ memberData.put(city, "city");
+ memberData.put(state, "state");
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+
}
+
public void checkOut(int memberId, int bookId) {
// TODO This method is called when the member with the given ID checks
// out the book with the given ID. Update the system accordingly.
@@ -34,6 +93,7 @@ public boolean checkIn(int memberId, int bookId) {
}
public void button_getMember_onClick(View view) {
+ MySQLiteHelper db = new MySQLiteHelper(this);
String name = inputParameter.getText().toString();
// TODO Display member information for the member with the given name.
diff --git a/src/main/java/nyc/c4q/ListActivity.java b/src/main/java/nyc/c4q/ListActivity.java
index 08894ac..8d0cac3 100644
--- a/src/main/java/nyc/c4q/ListActivity.java
+++ b/src/main/java/nyc/c4q/ListActivity.java
@@ -1,45 +1,58 @@
package nyc.c4q;
import android.app.Activity;
+import android.content.Context;
+import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
+import android.view.View;
+import android.widget.AdapterView;
+import android.widget.ArrayAdapter;
+import android.widget.BaseAdapter;
+import android.widget.Button;
import android.widget.ListView;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Map;
+
public class ListActivity extends Activity {
public ListView list;
+ public Button button_name;
+ Context mContext;
public static final Person[] PEOPLE = {
- new Person("Hannah", "Abbott", House.Hufflepuff),
- new Person("Katie", "Bell", House.Gryffindor),
- new Person("Susan", "Bones", House.Hufflepuff),
- new Person("Terry", "Boot", House.Ravenclaw),
- new Person("Lavender", "Brown", House.Gryffindor),
- new Person("Cho", "Chang", House.Ravenclaw),
- new Person("Michael", "Corner", House.Ravenclaw),
- new Person("Colin", "Creevey", House.Gryffindor),
- new Person("Marietta", "Edgecombe", House.Ravenclaw),
- new Person("Justin", "Finch-Fletchley", House.Hufflepuff),
- new Person("Seamus", "Finnigan", House.Gryffindor),
- new Person("Anthony", "Goldstein", House.Ravenclaw),
- new Person("Hermione", "Granger", House.Gryffindor),
- new Person("Angelina", "Johnson", House.Gryffindor),
- new Person("Lee", "Jordan", House.Gryffindor),
- new Person("Neville", "Longbottom", House.Gryffindor),
- new Person("Luna", "Lovegood", House.Ravenclaw),
- new Person("Ernie", "Macmillan", House.Hufflepuff),
- new Person("Parvati", "Patil", House.Gryffindor),
- new Person("Padma", "Patil", House.Ravenclaw),
- new Person("Harry", "Potter", House.Gryffindor),
- new Person("Zacharias", "Smith", House.Hufflepuff),
- new Person("Alicia", "Spinnet", House.Gryffindor),
- new Person("Dean", "Thomas", House.Gryffindor),
- new Person("Fred", "Weasley", House.Gryffindor),
- new Person("George", "Weasley", House.Gryffindor),
- new Person("Ginny", "Weasley", House.Gryffindor),
- new Person("Ron", "Weasley", House.Gryffindor)
+ new Person("Hannah", "Abbott", House.Hufflepuff),
+ new Person("Katie", "Bell", House.Gryffindor),
+ new Person("Susan", "Bones", House.Hufflepuff),
+ new Person("Terry", "Boot", House.Ravenclaw),
+ new Person("Lavender", "Brown", House.Gryffindor),
+ new Person("Cho", "Chang", House.Ravenclaw),
+ new Person("Michael", "Corner", House.Ravenclaw),
+ new Person("Colin", "Creevey", House.Gryffindor),
+ new Person("Marietta", "Edgecombe", House.Ravenclaw),
+ new Person("Justin", "Finch-Fletchley", House.Hufflepuff),
+ new Person("Seamus", "Finnigan", House.Gryffindor),
+ new Person("Anthony", "Goldstein", House.Ravenclaw),
+ new Person("Hermione", "Granger", House.Gryffindor),
+ new Person("Angelina", "Johnson", House.Gryffindor),
+ new Person("Lee", "Jordan", House.Gryffindor),
+ new Person("Neville", "Longbottom", House.Gryffindor),
+ new Person("Luna", "Lovegood", House.Ravenclaw),
+ new Person("Ernie", "Macmillan", House.Hufflepuff),
+ new Person("Parvati", "Patil", House.Gryffindor),
+ new Person("Padma", "Patil", House.Ravenclaw),
+ new Person("Harry", "Potter", House.Gryffindor),
+ new Person("Zacharias", "Smith", House.Hufflepuff),
+ new Person("Alicia", "Spinnet", House.Gryffindor),
+ new Person("Dean", "Thomas", House.Gryffindor),
+ new Person("Fred", "Weasley", House.Gryffindor),
+ new Person("George", "Weasley", House.Gryffindor),
+ new Person("Ginny", "Weasley", House.Gryffindor),
+ new Person("Ron", "Weasley", House.Gryffindor)
};
@Override
@@ -48,6 +61,26 @@ protected void onCreate(Bundle savedInstanceState) {
setContentView(R.layout.activity_list);
list = (ListView) findViewById(R.id.list);
- }
+ Button button_name = (Button) findViewById(R.id.button_name);
+ Button button_color = (Button) findViewById(R.id.button_color);
+
+ final ArrayAdapter adapter = new ArrayAdapter(this, android.R.layout.simple_list_item_1, PEOPLE);
+ list.setAdapter(adapter);
+
+ button_name.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ adapter.getItem(1);
+ adapter.getItem(0);
+// list.setOnItemClickListener(new AdapterView.OnItemClickListener() {
+// public void onItemClick(AdapterView> parent, View view, int position, long id) {
+// HashMap obj = (HashMap) adapter.getItem(position);
+// String lastName = (String) obj.get("lastName");
+// String firstName = (String) obj.get("firstName");
+
+ }
+ });
+
+ }
}
diff --git a/src/main/java/nyc/c4q/Members.java b/src/main/java/nyc/c4q/Members.java
new file mode 100644
index 0000000..dafa23a
--- /dev/null
+++ b/src/main/java/nyc/c4q/Members.java
@@ -0,0 +1,95 @@
+package nyc.c4q;
+
+/**
+ * Created by c4q-vanice on 8/30/15.
+ */
+public class Members {
+
+ protected String id;
+ protected String name;
+ protected String dob_month;
+ protected String dob_day;
+ protected String dob_year;
+ protected String city;
+ protected String state;
+ protected String location;
+
+ public Members(){
+
+ }
+
+ public Members(String id, String name, String dob_month, String dob_day, String dob_year, String location) {
+ this.id = id;
+ this.name = name;
+ this.dob_month = dob_month;
+ this.dob_day = dob_day;
+ this.dob_year = dob_year;
+ this.location = location;
+ }
+
+ public String getId() {
+
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getDob_month() {
+ return dob_month;
+ }
+
+ public void setDob_month(String dob_month) {
+ this.dob_month = dob_month;
+ }
+
+ public String getDob_day() {
+ return dob_day;
+ }
+
+ public void setDob_day(String dob_day) {
+ this.dob_day = dob_day;
+ }
+
+ public String getDob_year() {
+ return dob_year;
+ }
+
+ public void setDob_year(String dob_year) {
+ this.dob_year = dob_year;
+ }
+
+ public String getCity() {
+ return city;
+ }
+
+ public void setCity(String city) {
+ this.city = city;
+ }
+
+ public String getState() {
+ return state;
+ }
+
+ public void setState(String state) {
+ this.state = state;
+ }
+
+ public String getLocation(){
+ return location;
+ }
+
+ public void location(String city, String state ){
+ this.state = state;
+ this.city = city;
+ }
+}
diff --git a/src/main/java/nyc/c4q/MySQLiteHelper.java b/src/main/java/nyc/c4q/MySQLiteHelper.java
new file mode 100644
index 0000000..ff1b2dc
--- /dev/null
+++ b/src/main/java/nyc/c4q/MySQLiteHelper.java
@@ -0,0 +1,71 @@
+package nyc.c4q;
+
+import android.content.ContentValues;
+import android.content.Context;
+import android.database.sqlite.SQLiteDatabase;
+import android.database.sqlite.SQLiteOpenHelper;
+
+/**
+ * Created by c4q-vanice on 8/30/15.
+ */
+public class MySQLiteHelper extends SQLiteOpenHelper {
+
+ public static final String DATABASE_MEMBERS = "members.db";
+ public static final String TABLE_MEMBERS = "members";
+ public static final String TABLE_COLUMN_ID = "id";
+ public static final String TABLE_COLUMN_NAME = "name";
+ public static final String TABLE_COLUMN_MONTH = "dob_month";
+ public static final String TABLE_COLUMN_DAY = "dob_day";
+ public static final String TABLE_COLUMN_YEAR = "dob_year";
+ public static final String TABLE_COLUMN_LOCATION = "location";
+
+ public static final int VERSION = 1;
+ private static MySQLiteHelper INSTANCE;
+
+ public static synchronized MySQLiteHelper getInstance(Context context)
+ {
+ if(INSTANCE == null)
+ {
+ INSTANCE = new MySQLiteHelper(context.getApplicationContext());
+ }
+
+ return INSTANCE;
+ }
+
+ protected MySQLiteHelper(Context context) {
+ super(context, DATABASE_MEMBERS, null, VERSION);
+ }
+
+
+ @Override
+ public void onCreate(SQLiteDatabase db) {
+ String CREATE_TABLE = "CREATE TABLE" + DATABASE_MEMBERS + "(" + TABLE_COLUMN_ID + "id," + TABLE_COLUMN_NAME
+ + "name, " + TABLE_COLUMN_DAY + "dob_day, " + TABLE_COLUMN_MONTH + "dob_month, " + TABLE_COLUMN_YEAR + "dob_year, " +
+ TABLE_COLUMN_LOCATION + "location, " + ")";
+ db.execSQL(CREATE_TABLE);
+
+ }
+
+ @Override
+ public void onUpgrade(SQLiteDatabase sqLiteDatabase, int i, int i1) {
+
+ }
+
+ public Members addMembers(Members members ){
+ SQLiteDatabase db = this.getWritableDatabase();
+
+ ContentValues values = new ContentValues();
+
+ values.put(TABLE_COLUMN_ID, members.getId());
+ values.put(TABLE_COLUMN_NAME, members.getName());
+ values.put(TABLE_COLUMN_MONTH, members.getDob_month());
+ values.put(TABLE_COLUMN_DAY, members.getDob_day());
+ values.put(TABLE_COLUMN_YEAR, members.getDob_year());
+ values.put(TABLE_COLUMN_LOCATION, members.getCity() + members.getState());
+
+ db.insert(TABLE_MEMBERS, null, values);
+ db.close();
+
+ return members;
+ }
+}
diff --git a/src/main/java/nyc/c4q/PaceCalculatorActivity.java b/src/main/java/nyc/c4q/PaceCalculatorActivity.java
index 5c0616e..625b6b8 100644
--- a/src/main/java/nyc/c4q/PaceCalculatorActivity.java
+++ b/src/main/java/nyc/c4q/PaceCalculatorActivity.java
@@ -2,13 +2,33 @@
import android.support.v4.app.FragmentActivity;
import android.os.Bundle;
+import android.view.View;
+import android.widget.Button;
+import android.widget.EditText;
public class PaceCalculatorActivity extends FragmentActivity {
+ EditText inputDistance,inputTimeMin,inputTimeSec,inputPaceMin, inputPaceSec;
+
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_pace_calculator);
+
+ }
+
+ public double button_calculate_onClick(View view){
+
+
+ EditText inputDistance = (EditText) findViewById(R.id.input_distance);
+ EditText inputTimeMin = (EditText) findViewById(R.id.input_time_min);
+ EditText inputTimeSec = (EditText) findViewById(R.id.input_time_sec);
+ EditText inputPaceMin = (EditText) findViewById(R.id.input_pace_min);
+ EditText inputPaceSec = (EditText) findViewById(R.id.input_pace_sec);
+
+
+ return 0.0;
+ }
+
}
-}
diff --git a/src/main/java/nyc/c4q/Person.java b/src/main/java/nyc/c4q/Person.java
index 2f2f167..47160ec 100644
--- a/src/main/java/nyc/c4q/Person.java
+++ b/src/main/java/nyc/c4q/Person.java
@@ -10,4 +10,9 @@ public Person(String firstName, String lastName, House house) {
this.lastName = lastName;
this.house = house;
}
+
+ @Override
+ public String toString() {
+ return this.firstName + this.lastName + this.house;
+ }
}
diff --git a/src/main/java/nyc/c4q/adapter.java b/src/main/java/nyc/c4q/adapter.java
new file mode 100644
index 0000000..2d404ef
--- /dev/null
+++ b/src/main/java/nyc/c4q/adapter.java
@@ -0,0 +1,39 @@
+package nyc.c4q;
+
+import android.content.Context;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.ArrayAdapter;
+import android.widget.BaseAdapter;
+import android.widget.TextView;
+
+import java.util.ArrayList;
+
+/**
+ * Created by c4q-vanice on 8/30/15.
+ */
+public class adapter extends ArrayAdapter{
+ public adapter(Context context, int persons) {
+ super(context, persons);
+ }
+ @Override
+ public View getView(int position, View convertView, ViewGroup parent) {
+
+ Person person = getItem(position);
+
+ if (convertView == null) {
+ convertView = LayoutInflater.from(getContext()).inflate(R.layout.listitem_member, parent, false);}
+
+ TextView textName = (TextView) convertView.findViewById(R.id.text_name);
+ TextView textHouse = (TextView) convertView.findViewById(R.id.text_house);
+
+ textName.setText(person.firstName);
+ textName.setText(person.lastName);
+ // textHouse.setText(person.house);
+
+ return convertView;
+ }
+ }
+
+
diff --git a/src/main/res/layout/activity_list.xml b/src/main/res/layout/activity_list.xml
index 3e82945..05e1164 100644
--- a/src/main/res/layout/activity_list.xml
+++ b/src/main/res/layout/activity_list.xml
@@ -17,6 +17,7 @@
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:text="@string/last_first"
+ android:onClick="onNameClick"
/>
+ tools:context="nyc.c4q.PaceCalculatorActivity">
+
+
+
+
+
+
diff --git a/src/main/res/raw/books.json b/src/main/res/raw/books.json
index 8cc9673..79b378e 100644
--- a/src/main/res/raw/books.json
+++ b/src/main/res/raw/books.json
@@ -838,7 +838,7 @@
"isbn": "0439554934",
"isbn13": "9780439554930",
"publisher": "Scholastic",
- "publishyear": 2003.
+ "publishyear": 2003,
"checkedout": true,
"checkedoutby": 38,
"checkoutdateyear": 2015,