Project Name: Alcometer

Group 4

Jouni Pänkäläinen (0312386)

Niko Kurvinen (0312302)

Ananta Bhadra Lamichhane (0331749)

Idea

This application estimates your current blood alcohol concentration (BAC) based on your input. It is useful to calculate the time to drive safe to back home after you enjoy the party.

BAC represents the amount of alcohol contains on your blood. BAC constants varies depending upon the personal body weight and gender. So, it also effects for the duration of time required to neutralize the alcohol concentration from your blood.

This application will help you to know your level of BAC on the party and also to get informed about the duration of time required to get neutralize.

Inputs

Your Gender

Your Weight

Amount of alcohol you have consumed

Outputs

Amount of Blood Alcohol Concentration (BAC) on your body

Time required for BAC to be neutralize from blood

Description

The application consists of four interfaces as listed below:

Main Interface

Settings Dialog

Manage Drinks Dialog

Drinks Log Dialog

1. Main Interface

It is landing homepage of the application. It consists of three sections as explained below:

Output Section of the application contains two parts, an image illustrating the current status of BAC and percentage of BAC. BAC percentage is automatically updated in a small interval indicating the remaining effect of the alcohol on the body of the consumer, since with the delay of time, the effect of alcohol on the consumer's body diminishes.

Drink List contains various kinds of drinks. When user presses a drink, its BAC value is calculated based upon the preset weight, gender and alcohol percentage of the particular drink. There is a small delay managed after each press on the drink button to minimize the unwanted repeated press.

Menu will be activated on pressing 'Menu' button on the phone. Menu contains four options:

Manage Drinks: It will load a dialog to manage current list of drinks. It allows to add new drink, delete existing drink and edit the details of the existing drink including its name, volume, alcohol percentage and image.

Drink Log: It presents the list of the drinks you selected on this application session.

Settings: It loads a dialog to update gender and weight of the user.

Exit: It closes the application.

2. Settings Dialog

It allows to update the gender and weight of the user.

3. Manage Drinks Dialog

It allows to manage existing drinks list with the features as listed below:

Add a new custom drink: User can create a new drink to be populated on drink list with the input of drink name, percentage of alcohol present on the particular drink, volume of the drink and a custom image to be selected from a set of predefined images.

Edit a drink: User can modify existing drink to change any of the attribute associated with the existing drink including its name, image, percentage of alcohol and volume of the drink.

Delete a drink: User can delete a drink from the current drink list by selecting the particular drink and then pressing the delete button.

4. Drink Log Dialog

It allows to manage the drink log with the features as listed below:

Remove a drink from the log: User can remove any drink from the log entry by selecting the particular drink and then pressing Remove button. It will also update the current BAC percentage and countdown of the timer on output window to refresh the modified BAC after removing the previously selected drink.

Reset the Log: It will reset the entire history of the drinks consumed by the user. It will result the BAC to be reset to have a fresh initialization.

Features

1 = most critical or core .. 3 least critical or core feature

Feature	Priority	Status
Layout	1	Completed
- Main Interface	1	Completed
- Settings Dialog	1	Completed
- Drink List Dialog	1	Completed
- Drink Update Dialog	1	Completed
- Drink Log Dialog	2	Completed
Basic Operations	1	Completed
- BAC Calculation	1	Completed
- Current Drink List populated	1	Completed
- Edit and update existing Drink	1	Completed
- Delete Existing Drink	1	Completed
- Add New custom Drink	3	Completed
Management	1	Completed
- Interaction between main interface and dialogs	1	Completed
- Output and Layout mapping	1	Completed
- Dynamic Update of BAC and output image	1	Completed
- Code optimization and polishing	1	Completed
- Bug Fixing	2	Completed
- Dynamic Update of countdown of BAC to be neutralized from Blood (in hh:mm)	2	Completed
- Button Delay to minimize accidental press	2	Completed
- Toast alerts	2	Completed
- Notifications	2	Completed
- Log of latest consumed drinks	3	Completed
- Rollback latest input drink	3	Completed
- Reset drink log	3	Completed
Documentation	1	Completed
- Wiki Update	1	Completed
- Code Upload	1	Completed
- Presentation Ready	1	Completed

Mini Goals

Get the layout working.

Buttons

Menus

Improving the grid layout

Get the basic calculations right.

Get the art done.

Database connections

Manage Drinks

Add New Drink

Edit Drink

Delete Drink

Menu Items

Settings

Manage Drink

Drink Log

Bug Fixing - fixed if found

Code Optimization and Finalizing

Documentation

Presentation

Design

Following diagram presents the basic design flow of the project:

This diagram shows the main interface of the application. The interface is divided into three sections as Output Section, Drink List and underneath menu to be activated on pressing 'menu' button of the phone.

This diagram shows the overall flow of the application.

Screenshots

Main screen just after the application has started.
Main screen just after the application has started
Main screen in action.
Main screen in action.
Drinks drunk during this session.
Drinks drunk during this session.
Drink management window.
Drink management window.
Settings window.
Settings window.

Implementation Comments

At first Android seemed pretty confusing and complicated. It became less confusing, but no less complicated. Sometimes even the most basic operations seemed to take tens of lines of code. For example a simple Yes/No-dialog was pretty complex. Given that comparing to Symbian, this was way easier to get into (most probably due to Java on the background).

We did discover a lot of good sides in Android too. For example the Views-system is pretty handy and incredibly flexible. All the buttons in our main view are actually mini-Layouts constructed dynamically from a simple XML-resource. Our click-selection in drink manager and drink log is self-implemented, because we couldn't find any sensible way to do it otherwise.

Our implementation doesn't conform to well to any coding practises (a LOT of static stuff). It's pretty much just patched together to make it work. We mostly just wanted to learn Android, not focus on how well-formed the code is. Please don't shoot us.

In the end our application is fully functional. We got in all the features we wanted to get.

Presentation

Final presentation: alcometer.ppt

Package

alcometer_grp4.zip

How to run

It needs no specific method. The general procedure of running any Android application is applicable for running this application as well.

Conclusion of your work

Android Code Camp 2010 was a very impressive learning experience to get to know Android 2.1. Though continuous work sometimes seemed depressing but it is always enjoyable to play with the code around rather than to mess with snow outside. Anyway Codecamp spirit is always in mind, so encouragement to accomplish the task and get it done anyway was the driving force to make it happen.

And, when it finally completed, it made the whole week!