terzis/Speedometer — comment on commit 013230e3dc90734f7024b905d67c2b1f6568a386
File: android/src/com/google/wireless/speed/speedometer/measurements/UDPBurstTask.java line 44
By terzis:

Let me try to repeat what I said and what my understanding of how things work is:

-OnCreate() in MeasurementCreationActivity creates the entries in the pull down menu from the keys of the measurementDescToType HashMap in MeasurementTask. This HashMap maps description strings (the things that are shown in the pull down menu) to measurement types.

-Then the user selects one of the entries in the pull down menu (e.g., traceroute, HTTP, etc.). onItemSelected() in MeasurementCreationActivity is called. This method sets measurentTypeUnderEdit by looking up the string the user selected into the measurementDescToType HashMap. This HashMap maps the user-visible measurement descriptions to Measurement type names (see MeasurementTask.java).

-Next, ButtonOnClickListener() in MeasurementCreationActivity is called and it creates the appropriate MeasurementTask based on the value of the measurementTypeUnderEdit string. The value of this string is the only thing we have to decide whether we will do a UDP Burst Up or UDP Burst Down measurement. This is why I have defined UDPBurstTask.TYPE_UP and TYPE_DOWN.

One possible solution is to name these strings MEAS_UP and MEAS_DOWN and have a single UDPBurstUp.TYPE. Do you thing is good or do you have another suggestion?