• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 442
  • Last Modified:

Guidance re; creating a simple timing app using Azure

I was looking for some rough guidance re; making a race timing app. for Android phone using Windows Azure to build it.
Basically, there will be a list of riders, each with a start time, finish time, and the resultant race time.
WhatI envisage happening is that the rider waits at the Start point and the marshall hits a RECORD (start) TIME button using this app on their Android phone.
Then the rider arrives at the finish point and the marshall who is waiting there presses a RECORD (finish) TIME button using this app on their Android phone.
Both phones write their respective Start/Finish times to a web-based Azure SQL database, the database then simply returns the race time (FINISH TIME minus START TIME) for that rider.

Appreciate any pointers/rough guidance!
1 Solution
Sounds doable, but you'll be hit hard by data loss.

a) When the Marshall at the start forgets to log the start
b) When the Marshall at the end forgets to log the end

So you'll need to write code to cater for these situations.
I.E; you know that Rider A started at the same time as Rider B; copy the start time from A to B, if the start time for Rider B is missing. Then log that the time is approximate.

Use a DateTime2 data type for your start and stop times, and you'll have more that 3 mS precision. If you use DateTime2(7) it will be logged with 100 nS precision.

If the accuracy of the time keeping in Android in is that good, I do not know.
Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
Have you done any research on race timing?  I think it is more complex than just recording a start and stop time.    

Are you recording the time "the gun" fires or the "the chip" time when they cross the matt?   Do you have any built in safeguards for cheaters? or false positive cheaters?

Is a phone reliable enough to start and stop accurately with acceptable lag times?

Are you doing this for fun or club where time is nice to know? Or for real racing?    I think the app would be better suited for receiving unofficial data and final results than starting and stopping.

Otherwise, in super simple terms, the start device hit's an end point on the server that inserts a row of data to the db. One field would be a timestamp that defaults to getdate() so all you need to to is insert a record to start the timer.  At the finish, the phone sends signal to another end point that inserts another record to the db.  Now you have 2 rows of data both with a time stamp.  Do the subtraction.

I would check with any governing entities what the rules are for recording times an acceptable lag from start to server.
Bob SchneiderCo-OwnerCommented:
As a professional timer (www.gopherstateevents.com) I can say that it is kind of amazing the things that people will do to mess up the results.  First of all let me say that there is no reason that you can't create an app for timing a race like this, although it is hard for me to envision doing any kind of a large race with it, unless it was an app with multiple users....that is, a crew of timers each using different functionality on different devices on the same app.

You could have one timer just click as each finisher crosses the finish line, generating a list of times.  You could have another timer entering just bib numbers.  That gives you two independent lists (times and bibs).  To cover for a missed time or a missed bib, you would have a third timer that is recording bib AND time for as many as possible (those that finish alone) to use to find areas where the other lists were missing data (a missing time or a missing bib).  This is called "Select" timing

Here are some problems you will encounter:  if you get multiple finishers simultaneously it would be all but impossible to give them accurate times by having one person enter the bib numbers and times for all and recording the exact time that they finished.  You will almost invariably get finishers whose bib numbers are not visible, or they didn't wear them, or they came off, etc.

Having said this, there is an app out there similar to this called Racesplitter.  It is typically used by coaches to time splits for their own team and it not designed to (typically) replace professionally timed events.

Finally, your idea is intriguing because it would remove the need to buy timing devices...the app results from the droids could feed a database that a laptop could then be used for results processing.  Of course all of this relies on being in a location with a good signal.

I hope this helps...
A proven path to a career in data science

At Springboard, we know how to get you a job in data science. With Springboard’s Data Science Career Track, you’ll master data science  with a curriculum built by industry experts. You’ll work on real projects, and get 1-on-1 mentorship from a data scientist.

Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
I like the idea of multiple people at once.

I'm not a race timer, just been to a lot...

First you would have to have some type of master user that enters in a code for the days race.  Each team member would log in to the race with the code or possibly be scanning another bar code or qr code.  This would get the team all on the same 'page'.

Beforehand, I would imagine  you have all heats programmed in, each with their own id number.  

Whoever is managing the timing, would activate a heat when read to go.

Then each team member that is logged in would get an alert the timer is ready and perhaps press a button to acknowledge.

When the master timer sees everybody is ready via the app (assuming you are talking about outside of eye shot distance), the race can start.

Master timer presses the start button which sends a call to the endpoint on the server (or if you are within a few yards of the laptop, perhaps bluetooth it).   For this part, I would still be interested to find the lag time from pressing the button to hitting a remote server.  For sure this would have to be a native function and not rely on something like phone gap.

At the finish line, one person could click a button, I would think the volume button on the side makes sense, each time somebody crosses the finish line.     You could probably use motion or a swipe or a bump as well (think of the app called bump).  Doing one of these actions would send a call to the server's end point that inserts a row of data with an automatic time stamp an incremental number and the heat_id and race_id via a stored procedure.

You could have multiple people doing this as long as it is understood which team member is timing which person.

Then other team members are scanning bibs or on occasion using the number pad.  This will insert rows into a new table with the bib number, heat_id, race_id and another timestamp.

Using an sql query, you would marry the timing results order with the bib order.  Another sql table would contain the check in info (bib number and racer_id) and a racer table would have the racer_id and contact info

Everything does seem doable...  My biggest concern is any lag time hitting the data server and the reliability of a phone that it does not freeze up, or somebody gets a call (I think the app can shut off the phone).  

I have done some html apps and the complaint is always lag time when pressing buttons.  Pure native would be a must.
fjkilkenAuthor Commented:
Thanks for th eposts but I'm more specifically looking for coding pointers/advice as opposed to administration concerns of the race.
Multiple riders finishing at a time/missed riders is not a concern as this will not happen in the type of event I'm looking to run
Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
It's all related.  How you administer has a direct correlation to your programming.

1) Do this natively,  not via phone gap or similar.

2) Create end points for each function  

What else are you looking for?
fjkilkenAuthor Commented:
Can you advise what you mean by "natively" ?
Those links don't appear to work - what am I supposed to be seeing when I click them?

I currently just need a very basic app - a way to write a start time and an end time for a single record, eg; to a SQL database, then I can develop/learn from there.
This needs to be done from a phone via Android app. as the race will be run outdoors
Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
The links are fake, notice "mydomain.com".   The url is set up how you might set your endpoints.     /app/race/123/abc/start would be used instead of  www.mydomain.com/app/?raceID=123&heatID=abc&function=start

It sounds like you are really at the very beginning.  Have you gone beyond hello world http://developer.android.com/training/basics/firstapp/index.html

Natively means you are creating an app using the Android SDK as opposed to something like phonegap or using jquery mobile/html5 as a webview.  There will be too much lag and you will want to learn to code in java using the android sdk.

I would suggest starting with the hello world link I gave you.  

Your 2nd step should be making your app static without using the database.

Next you will want to learn about creating endpoints on azzure.  This might be a good walkthrough  http://www.windowsazure.com/en-us/develop/mobile/tutorials/get-started-android/

Finally you will want to learn how to secure your app http://msdn.microsoft.com/en-us/library/windowsazure/hh696898.aspx

This is not a quick or simple process.  There is a big difference between an app and website.  When you make a website, you control the server.  For an app, each phone is a server and you can't afford to load all of our credentials on each server (the phone).

Start with hello world, build your interface with static data is the best place to start.
fjkilkenAuthor Commented:
great - thanks for that
Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
Good luck
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now