DrinksDiary for Windows Phone

DrinksDiary is a simple app to let you keep track of your alcohol intake. It calculates the number of units of alcohol in each drink and provides you with a daily total. You can also see summaries for previous weeks consisting of the weekly total and maximum number of units consumed in any one day.

DrinksDiary for Windows Phone can be obtained from Marketplace, where it is filed under Health. The URL is here: http://www.windowsphone.com/en-GB/apps/7cf5952d-7772-e011-81d2-78e7d1fa76f8.

Notes below are for the older Pocket PC/ Windows Mobile version.

DrinksDiary for Pocket PC / Windows Mobile

Installation

DrinksDiary needs three files: drinksdiary.exe, drinktypes.txt and drinkmeasures.txt. The first file needs to be in a directory where program files reside while the other two files need to be in the MyDocuments folder of your device. If you download and run the drinksdiary.cab installation file it should put all these files in the correct directories automatically.

If the program says it does not have the right version of .NET you will need to download and install it from here: http://www.pocketpcfreeware.com/en/index.php?soft=1187

Note: I have not been able to get the installation to work correctly onto a storage card. If I attempt this what seems to happen is that the application initially runs correctly but then after the device gets rebooted it can no longer find the executable file. So I recommend that you install to device rather than to storage card. The executable file is very small so this shouldn't be a problem.

Files

As well as needing drinktypes.txt and drinkmeasures.txt, DrinksDiary writes a file called drinksdiary.txt which contains a record of the entries you have made. It tries to read all these three files when it runs. If either of the first two files is missing or unreadable then it presents an error message saying it cannot read them and that it will use default types and/or measures. If you get this message then you should check that the files are present in the MyDocuments folder and that they contain information in the correct format as described below. You can try reinstalling them. When DrinksDiary runs for the very first time it will try to read drinksdiary.txt and will not find it and will present a message saying that it cannot find it. This is entirely normal. DrinksDiary writes drinksdiary.txt to the MyDocuments folder when it exits and on subsequent occasions it should find it OK.

The file drinkmeasures.txt appears as follows:

Name Millilitres
SmallGlass 125
LargeGlass 250
WineBottle 750
BeerBottle 330
Pint 568
HalfPint 284
Single 25
Double 50
HalfLitre 500
Litre 1000
35ml 35
70ml 70

The first line is ignored while subsequent lines give the name of each measure and the number of millilitres it consists of.

The file drinktypes.txt appears as follows:

Name Measure Units
Wine SmallGlass 1.5
Beer Pint 2.3
Cider Pint 2.3
Spirits Single 1
Sherry Double 1

The first line is ignored. Subsequent lines give the name of the drink, a measure which must be named in drinkmeasures.txt and the number of units of alcohol contained in that measure of that type of drink. The app uses this information to calculate the strength of the drink so that if it is consumed in other measures (say a bottle rather than a glass) the number of units involved can be calculated.

Both these files can be edited to add new measures and new types of drink, or to remove entries which will not be needed. No names should be more than ten characters long or they will throw out the alignment of the columns in drinksdiary.txt.

When drinksdiary.txt has been created it will appear as follows:

Date     Number Measure    Substance  Units
24/01/10      2 SmallGlass Wine         3.0
24/01/10      1 SmallGlass Wine         1.5
25/01/10      1 SmallGlass Wine         1.5
25/01/10      2 SmallGlass Wine         3.0
25/01/10      1 Single     Spirits      1.0
26/01/10      1 SmallGlass Wine         1.5
26/01/10      1 SmallGlass Wine         1.5
27/01/10      1 SmallGlass Wine         1.5
27/01/10      1 SmallGlass Wine         1.5
28/01/10      1 SmallGlass Wine         1.5
28/01/10      2 BeerBottle Beer         2.7
28/01/10      1 BeerBottle Beer         1.3
29/01/10      4 SmallGlass Wine         6.0
30/01/10      2 Single     Spirits      2.0
30/01/10      1 SmallGlass Wine         1.5
31/01/10      2 SmallGlass Wine         3.0
Entries are recorded in the order in which they were made, not necessarily in date order. If you make any mistakes when entering information then you will have to edit this file in order to correct them, for example by removing the offending line. Please note that if you make an alteration then the number of units for that entry will not be recalculated.

It is possible that the performance of the app may deteriorate if very large numbers of entries accumulate. If this seems to be happening then just edit drinksdiary.txt to remove some of the older entries.

Important notes about editing files

The three files listed above are all plain text files. This means that they can be viewed and edited in a text editor - for example if you copy them to and from your PC they can be edited with notepad. (It should also be possible to import drinksdiary.txt into Excel.) However if you open one of these files using File Explorer on your device then it will be opened in Word. It is very important that you do not subsequently save the file in Word format because it will then become unreadable by DrinksDiary. You must save it as a plain text file.

Typically, when you exit Word or try to save the file you will see the following message:

"Saving this document in this format may remove some formatting. Do you want to save as Word instead?"

You must click "No" as the response - that is you do want to save the file in text format and not in Word format.

Also note that DrinksDiary writes drinksdiary.txt when it exits. Therefore you must make sure that you exit the app first before making any alterations to drinksdiary.txt, otherwise your changes will get overwritten.

Remember that installing the app from drinksdiary.cab will overwrite both drinkmeasures.txt and drinktypes.txt with the standard versions. So if you do make alterations to these files and then want to reinstall the app, make sure you first make copies of them elsewhere and then you can return these copies to MyDocuments after the installation.

Other notes

You can get more information about alcoholic drinks and the numbers of units they contain from this site: http://www.drinking.nhs.uk/questions/number-of-units/

When you view the weekly summaries, week zero is the week up to and including the day before the date shown on the calendar. The idea is that usually this date will be today and you may not have finished entering drinks for today so the totals are calculated on the week up to the day before.

Feel free to contact me with any questions or problems regarding the app - it's the first one I've written for Windows Mobile.

Downloads

Click and save on one of the files below:

Version history

1.1 Date for adding drink is same as date for main screen. Added ability to delete an entry.

Back to Dave Curtis junk page