@@ -0,0 +1,2219 @@
+package com.example.drinkingapp;%0Aimport java.util.ArrayList;%0Aimport java.util.Date;%0A%0Aimport android.app.Activity;%0Aimport android.os.Bundle;%0Aimport android.view.View;%0Aimport android.view.View.OnClickListener;%0Aimport android.view.Window;%0Aimport android.view.WindowManager;%0Aimport android.widget.Button;%0Aimport android.widget.TextView;%0A%0Aimport com.example.drinkingapp.DatabaseHandler;%0Aimport com.example.drinkingapp.DatabaseStore;%0Aimport com.example.drinkingapp.R;%0A%0A%0Apublic class DrinkReview extends Activity implements OnClickListener %7B%0A%09private DatabaseHandler db;%0A%09private TextView drinks, bac;%0A%09private Button finish;%0A%09%0A%09String drinkCount;%0A%09Double maxBac;%0A%09%0A%09@Override%0A%09protected void onCreate(Bundle savedInstanceState) %7B%0A%09%09super.onCreate(savedInstanceState);%0A%09%09%0A%09%09db = new DatabaseHandler(this);%0A%09%09%0A%09%09requestWindowFeature(Window.FEATURE_NO_TITLE);%0A%09%09getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,%0A%09%09%09%09WindowManager.LayoutParams.FLAG_FULLSCREEN);%0A%09%09setContentView(R.layout.drinkreview);%0A%09%09%0A%09%09drinks = (TextView)findViewById(R.id.review_drinks);%0A%09%09bac = (TextView)findViewById(R.id.review_bac);%0A%09%09getDrinkCount();%0A%09%09getMaxBac();%0A%09%09%0A%09%09drinks.setText(%22You recorderd having %22 + drinkCount + %22 drinks last night.%22);%0A%09%09bac.setText(%22Your maximum Estimated Blood Alcohol Level for the night was %22 + maxBac.toString());%0A%09%09%0A%09%09finish = (Button) findViewById(R.id.review_finish);%0A%09%09finish.setOnClickListener(this);%0A%09%7D%0A%09%0A%09private void getMaxBac()%7B%0A%09%09Date date = new Date();%0A%09%09ArrayList%3CDatabaseStore%3E bacs = (ArrayList%3CDatabaseStore%3E)db.getVarValuesForYesterday(%22bac%22, date);%0A%09%09maxBac = Double.valueOf(0);%0A%09%09for (int i=0; i%3Cbacs.size(); i++)%7B%0A%09%09%09Double cur = Double.valueOf(bacs.get(i).value);%0A%09%09%09if(cur %3C maxBac)%7B%0A%09%09%09%09maxBac = cur;%0A%09%09%09%7D%0A%09%09%7D%0A%09%7D%0A%09%0A%09//returns the number of drinks for the previous night%0A%09private void getDrinkCount()%7B%0A%09%09Date date = new Date();%0A%09%09ArrayList%3CDatabaseStore%3E drink_vals = (ArrayList%3CDatabaseStore%3E)db.getVarValuesForYesterday(%22drink_count%22, date);%0A%09%09drink_vals = DatabaseStore.sortByTime(drink_vals);%0A%09%09drinkCount = String.valueOf(drink_vals.size());%0A%09%7D%0A%09%0A%09@Override%0A%09public void onClick(View view)%7B%0A%09%09switch (view.getId()) %7B%0A%09%09case R.id.review_finish:%0A%09%09%09finish();%0A%09%09%09break;%0A%09%09%7D%0A%09%7D%0A%7D%0A

Add DrinkReview page