@@ -0,0 +1,2080 @@
+package com.example.drinkingapp;%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.EditText;%0Aimport android.widget.SeekBar;%0Aimport android.widget.SeekBar.OnSeekBarChangeListener;%0A%0A%0Apublic class DrinkAssessment extends Activity implements OnClickListener %7B %0A%0A%09private DatabaseHandler db;%0A%09private EditText drink_num;%0A%09private SeekBar excess_drinks;%0A%09private int progress_changed;%0A%09private Button finish;%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%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.drink_assessment);%0A%09%09finish = (Button) findViewById(R.id.drink_assess_finish);%0A%09%09finish.setOnClickListener(this);%0A%09%09%0A%09%09drink_num = (EditText)findViewById(R.id.number_drinks);%0A%09%09%0A%09%09progress_changed = 0;%0A%09%09excess_drinks = (SeekBar)findViewById(R.id.excess_drinks);%09%09%0A%09%09%0A%09%09excess_drinks.setOnSeekBarChangeListener(new OnSeekBarChangeListener() %7B%0A%09%09%09public void onProgressChanged(SeekBar seekbar, int progress, boolean fromUser)%7B%0A%09%09%09%09progress_changed = progress;%0A%09%09%09%7D%0A%09%09%09%0A%09%09%09public void onStartTrackingTouch(SeekBar seekbar)%7B%0A%09%09%09%09%0A%09%09%09%7D%0A%09%09%09public void onStopTrackingTouch(SeekBar seekbar)%7B%0A%09%09%09%09%0A%09%09%09%7D%0A%09%09%7D);%0A%09%09excess_drinks.setProgress(0); %0A%09%09excess_drinks.setMax(100);%0A%09%09%0A%09%09%0A%09%7D%0A%09%0A%09private void saveToDB()%7B%0A%09%09//Add the users guess for num drinks to db%0A%09%09if(drink_num.getText() != null)%7B%0A%09%09%09db.addValue(%22drink_guess%22, Integer.parseInt(drink_num.getText().toString()));%0A%09%09%7D%0A%09%09//Add the value for the excess slider to db%0A%09%09db.addValue(%22drink_excess%22,progress_changed);%0A%09%09db.addValue(%22drink_assess%22, %22True%22);%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.drink_assess_finish:%0A%09%09%09saveToDB();%0A%09%09%09finish();%0A%09%09%09break;%0A%09%09%7D%0A%09%7D%0A%7D%0A%0A

Add DrinkAssessment survey.