Skip to Content.
Sympa Menu

ndt-dev - [ndt-dev] [ndt] r499 committed - Tweak layout of results, add average latency and jitter.

Subject: NDT-DEV email list created

List archive

[ndt-dev] [ndt] r499 committed - Tweak layout of results, add average latency and jitter.


Chronological Thread 
  • From:
  • To:
  • Subject: [ndt-dev] [ndt] r499 committed - Tweak layout of results, add average latency and jitter.
  • Date: Tue, 16 Aug 2011 20:13:00 +0000

Revision: 499
Author:

Date: Tue Aug 16 13:12:16 2011
Log: Tweak layout of results, add average latency and jitter.
http://code.google.com/p/ndt/source/detail?r=499

Modified:
/branches/android/Android/res/layout/results.xml
/branches/android/Android/res/values/strings.xml
/branches/android/Android/res/values/styles.xml
/branches/android/Android/src/net/measurementlab/ndt/ResultsActivity.java
/branches/android/Android/src/net/measurementlab/ndt/TestsActivity.java

=======================================
--- /branches/android/Android/res/layout/results.xml Tue Aug 16 11:38:31 2011
+++ /branches/android/Android/res/layout/results.xml Tue Aug 16 13:12:16 2011
@@ -16,12 +16,13 @@
<LinearLayout android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
- android:padding="15sp"
+ android:paddingTop="5sp"
+ android:paddingBottom="5sp"
+ android:paddingLeft="25sp"
android:layout_marginTop="5sp"
android:layout_marginLeft="35sp"
android:layout_marginRight="35sp"
- android:background="@drawable/speed_box"
- android:layout_gravity="center_horizontal">
+ android:background="@drawable/speed_box">
<TextView android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="10sp"
@@ -47,12 +48,13 @@
<LinearLayout android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
- android:padding="5sp"
+ android:paddingTop="5sp"
+ android:paddingBottom="5sp"
+ android:paddingLeft="25sp"
android:layout_marginTop="10sp"
android:layout_marginLeft="35sp"
android:layout_marginRight="35sp"
- android:background="@drawable/speed_box"
- android:layout_gravity="center_horizontal">
+ android:background="@drawable/speed_box">
<TextView android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="10sp"
@@ -75,5 +77,35 @@
style="@style/NdtResultsMbps" />
</LinearLayout>
</LinearLayout>
+ <LinearLayout android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:orientation="horizontal"
+ android:paddingLeft="15sp">
+ <TextView android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:paddingTop="15sp"
+ android:id="@+id/LatencyLabel"
+ android:text="@string/results_latency_label"
+ style="@style/NdtResultsMoreLabel"/>
+ <TextView android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:paddingTop="15sp"
+ android:id="@+id/Latency"
+ style="@style/NdtResultsMoreInfo"/>
+ </LinearLayout>
+ <LinearLayout android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:orientation="horizontal"
+ android:paddingLeft="15sp">
+ <TextView android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:id="@+id/JitterLabel"
+ android:text="@string/results_jitter_label"
+ style="@style/NdtResultsMoreLabel"/>
+ <TextView android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:id="@+id/Jitter"
+ style="@style/NdtResultsMoreInfo"/>
+ </LinearLayout>
</LinearLayout>
</ScrollView>
=======================================
--- /branches/android/Android/res/values/strings.xml Tue Aug 16 11:38:31 2011
+++ /branches/android/Android/res/values/strings.xml Tue Aug 16 13:12:16 2011
@@ -48,4 +48,8 @@
<string name="results_upload_speed_header">UPLOAD SPEED</string>
<string name="results_download_speed_header">DOWNLOAD SPEED</string>
<string name="results_mpbs">mb/s</string>
+ <string name="results_latency_label">Network latency:</string>
+ <string name="results_latency">{0} msec round trip time</string>
+ <string name="results_jitter_label">Jitter:</string>
+ <string name="results_jitter">{0} msec</string>
</resources>
=======================================
--- /branches/android/Android/res/values/styles.xml Tue Aug 16 11:38:31
2011
+++ /branches/android/Android/res/values/styles.xml Tue Aug 16 13:12:16
2011
@@ -62,6 +62,23 @@
<item name="android:layout_height">wrap_content</item>
<item name="android:layout_width">fill_parent</item>
</style>
+ <style name="NdtResultsMoreLabel" parent="@android:style/TextAppearance">
+ <item name="android:textColor">#000</item>
+ <item name="android:textSize">10sp</item>
+ <item name="android:textStyle">bold</item>
+ <item name="android:gravity">left</item>
+ <item name="android:layout_height">wrap_content</item>
+ <item name="android:layout_width">wrap_content</item>
+ <item name="android:paddingLeft">25sp</item>
+ </style>
+ <style name="NdtResultsMoreInfo" parent="@android:style/TextAppearance">
+ <item name="android:textColor">#000</item>
+ <item name="android:textSize">10sp</item>
+ <item name="android:gravity">left</item>
+ <item name="android:layout_height">wrap_content</item>
+ <item name="android:layout_width">wrap_content</item>
+ <item name="android:layout_marginLeft">5sp</item>
+ </style>
<style name="NdtButton" parent="@android:style/Widget.Button">
<item name="android:layout_height">wrap_content</item>
<item name="android:layout_width">wrap_content</item>
=======================================
--- /branches/android/Android/src/net/measurementlab/ndt/ResultsActivity.java Tue Aug 16 11:38:31 2011
+++ /branches/android/Android/src/net/measurementlab/ndt/ResultsActivity.java Tue Aug 16 13:12:16 2011
@@ -1,6 +1,7 @@
package net.measurementlab.ndt;

import java.text.DecimalFormat;
+import java.text.MessageFormat;
import java.util.Map;

import android.app.Activity;
@@ -18,12 +19,14 @@
Typeface typeFace = Typeface.createFromAsset(getAssets(), "fonts/League_Gothic.otf");
TextView textView = (TextView)
findViewById(R.id.ResultsHeader);
textView.setTypeface(typeFace);
+
textView = (TextView) findViewById(R.id.UploadSpeedHeader);
textView.setTypeface(typeFace);
textView = (TextView) findViewById(R.id.UploadSpeed);
textView.setTypeface(typeFace);
textView = (TextView) findViewById(R.id.UploadSpeedMbps);
textView.setTypeface(typeFace);
+
textView = (TextView) findViewById(R.id.DownloadSpeedHeader);
textView.setTypeface(typeFace);
textView = (TextView) findViewById(R.id.DownloadSpeed);
@@ -48,5 +51,21 @@
Double downloadSpeed = (Double) variables.get("pub_s2cspd");
textView = (TextView) findViewById(R.id.DownloadSpeed);
textView.setText(format.format(downloadSpeed));
+
+ Integer maxRtt = (Integer) variables.get("pub_MaxRTT");
+ Integer minRtt = (Integer) variables.get("pub_MinRTT");
+ Double avgRtt = (Double) variables.get("pub_avgrtt");
+
+ String latency =
getResources().getString(R.string.results_latency);
+ latency = MessageFormat.format(latency, (int)(double)avgRtt);
+
+ textView = (TextView) findViewById(R.id.Latency);
+ textView.setText(latency);
+
+ String jitter =
getResources().getString(R.string.results_jitter);
+ jitter = MessageFormat.format(jitter, maxRtt - minRtt);
+
+ textView = (TextView) findViewById(R.id.Jitter);
+ textView.setText(jitter);
}
}
=======================================
--- /branches/android/Android/src/net/measurementlab/ndt/TestsActivity.java Tue Aug 16 11:38:31 2011
+++ /branches/android/Android/src/net/measurementlab/ndt/TestsActivity.java Tue Aug 16 13:12:16 2011
@@ -105,6 +105,8 @@
TextView textView = (TextView)
findViewById(R.id.TestServerValue);
textView.setText(serverAddress);
}
+ ImageView imageView = (ImageView)
findViewById(R.id.NdtTestsProgress);
+ imageView.setImageDrawable(getResources().getDrawable(R.drawable.progress_bar));
// TODO show preparation animation
}

@@ -127,6 +129,8 @@
private void complete(Intent status) {
Log.i(LOG_TAG, "Testing Complete.");
updateHeader(R.string.tests_complete_header);
+ ImageView imageView = (ImageView)
findViewById(R.id.NdtTestsProgress);
+ imageView.setImageDrawable(null);
Intent intent = new Intent(getApplicationContext(), ResultsActivity.class);
intent.putExtra(NdtService.EXTRA_VARS, status.getSerializableExtra(NdtService.EXTRA_VARS));
startActivity(intent);
@@ -214,8 +218,7 @@
InetAddress server = InetAddress.getByName(Constants.SERVER_HOST[Constants.DEFAULT_SERVER]);
return server.getHostAddress();
} catch (UnknownHostException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
+ Log.e(LOG_TAG, "Error resolving server hosts.", e);
}
return null;
}


  • [ndt-dev] [ndt] r499 committed - Tweak layout of results, add average latency and jitter., ndt, 08/16/2011

Archive powered by MHonArc 2.6.16.

Top of Page