Skip to Content.
Sympa Menu

ndt-dev - [ndt-dev] [ndt] r797 committed - commit patch for http://code.google.com/p/ndt/issues/detail?id=72 Add ...

Subject: NDT-DEV email list created

List archive

[ndt-dev] [ndt] r797 committed - commit patch for http://code.google.com/p/ndt/issues/detail?id=72 Add ...


Chronological Thread 
  • From:
  • To:
  • Subject: [ndt-dev] [ndt] r797 committed - commit patch for http://code.google.com/p/ndt/issues/detail?id=72 Add ...
  • Date: Tue, 22 Jan 2013 22:41:03 +0000

Revision: 797
Author:

Date: Tue Jan 22 14:40:35 2013
Log: commit patch for http://code.google.com/p/ndt/issues/detail?id=72 Add MLabNS support to replace DONAR.
http://code.google.com/p/ndt/source/detail?r=797

Modified:
/branches/android/Android/.project
/branches/android/Android/AndroidManifest.xml
/branches/android/Android/res/values/strings.xml
/branches/android/Android/src/net/measurementlab/ndt/InitialActivity.java
/branches/android/Android/src/net/measurementlab/ndt/NdtService.java
/branches/android/Android/src/net/measurementlab/ndt/SelectServerActivity.java
/branches/android/Android/src/net/measurementlab/ndt/TestsActivity.java
/branches/android/java/net/measurementlab/ndt/NdtTests.java

=======================================
--- /branches/android/Android/.project Fri Jun 10 12:53:42 2011
+++ /branches/android/Android/.project Tue Jan 22 14:40:35 2013
@@ -34,7 +34,7 @@
<link>
<name>java</name>
<type>2</type>
-
<location>/home/cmdln/Developer/svn/ndt/java</location>
+ <location>${PARENT-1-PROJECT_LOC}/java</location>
</link>
</linkedResources>
</projectDescription>
=======================================
--- /branches/android/Android/AndroidManifest.xml Wed Dec 5 15:09:48
2012
+++ /branches/android/Android/AndroidManifest.xml Tue Jan 22 14:40:35
2013
@@ -1,7 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android";
- package="net.measurementlab.ndt" android:versionCode="3"
- android:versionName="1.0b3">
+ package="net.measurementlab.ndt" android:versionCode="4"
+ android:versionName="1.0b4">
+ <uses-sdk android:targetSdkVersion="8" android:minSdkVersion="8" />
+ <uses-permission android:name="android.permission.INTERNET" />
+ <uses-permission android:name="android.permission.WAKE_LOCK" />
+ <uses-permission android:name="android.permission.READ_PHONE_STATE" />
+ <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
+ <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
+ <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<application android:icon="@drawable/ndt" android:label="@string/app_name" android:theme="@style/NdtTheme">
<activity android:name=".InitialActivity" android:screenOrientation="portrait" android:label="@string/app_name" android:theme="@style/NdtTheme.Blue">
<intent-filter>
@@ -14,11 +21,4 @@
<activity android:name=".SelectServerActivity" android:screenOrientation="portrait" android:label="@string/app_name" />
<service android:name=".NdtService" />
</application>
- <uses-sdk android:minSdkVersion="8" />
- <uses-permission android:name="android.permission.INTERNET" />
- <uses-permission android:name="android.permission.WAKE_LOCK" />
- <uses-permission android:name="android.permission.READ_PHONE_STATE" />
- <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
- <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
- <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
</manifest>
=======================================
--- /branches/android/Android/res/values/strings.xml Wed Dec 5 15:09:48 2012
+++ /branches/android/Android/res/values/strings.xml Tue Jan 22 14:40:35 2013
@@ -1,6 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
- <string name="app_name">NDT Mobile Client (beta 3)</string>
+ <string name="app_name">NDT Mobile Client (beta 4)</string>
+ <string name="app_name_short">NDT-1.0b4</string>
+ <string name="default_user_agent">(Linux; Android)</string>
<string name="about">About</string>
<string name="start">Start</string>
<string name="label_about_description">This software is based in part on NDT: Copyright (c) 2003 University of Chicago.</string>
=======================================
--- /branches/android/Android/src/net/measurementlab/ndt/InitialActivity.java Thu Dec 15 08:12:46 2011
+++ /branches/android/Android/src/net/measurementlab/ndt/InitialActivity.java Tue Jan 22 14:40:35 2013
@@ -35,10 +35,9 @@

@Override
public void onClick(View v) {
- Intent intent = new
Intent(getApplicationContext(),
- TestsActivity.class);
- intent.putExtra(NdtService.EXTRA_SERVER_HOST,
-
SelectServerActivity.SERVER_LIST[serverNumber][1]);
+ Intent intent = new Intent(getApplicationContext(), TestsActivity.class);
+ String hostName = SelectServerActivity.lookupHostname(getBaseContext(), serverNumber);
+ intent.putExtra(NdtService.EXTRA_SERVER_HOST,
hostName);
startActivity(intent);
}
});
@@ -85,7 +84,7 @@

SelectServerActivity.EXTRA_SERVER_NUMBER);
Toast serverSelected =
Toast.makeText(getApplicationContext(),
"Selected " +
SelectServerActivity.SERVER_LIST[serverNumber][0],
- 10);
+ Toast.LENGTH_LONG);
serverSelected.show();
}
}
=======================================
--- /branches/android/Android/src/net/measurementlab/ndt/NdtService.java Thu Dec 15 08:12:46 2011
+++ /branches/android/Android/src/net/measurementlab/ndt/NdtService.java Tue Jan 22 14:40:35 2013
@@ -132,7 +132,7 @@

String serverHost = intent.getStringExtra(EXTRA_SERVER_HOST);
if (null == serverHost) {
- serverHost = SelectServerActivity.SERVER_LIST[SelectServerActivity.DEFAULT_SERVER][1];
+ serverHost = SelectServerActivity.lookupHostname(getBaseContext(), SelectServerActivity.DEFAULT_SERVER);
}

try {
=======================================
--- /branches/android/Android/src/net/measurementlab/ndt/SelectServerActivity.java Wed Dec 5 15:09:48 2012
+++ /branches/android/Android/src/net/measurementlab/ndt/SelectServerActivity.java Tue Jan 22 14:40:35 2013
@@ -1,6 +1,7 @@
package net.measurementlab.ndt;

import android.app.Activity;
+import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
@@ -25,35 +26,35 @@
private RadioGroup radioGroup;

static final String SERVER_LIST[][] = {
- {"Closest Server (DONAR)", "ndt.iupui.donar.measurement-lab.org"},
- {"Auckland, New Zealand", "ndt.iupui.akl.donar.measurement-lab.org"},
- {"Amsterdam, Netherlands", "ndt.iupui.ams.donar.measurement-lab.org"},
- {"Stockholm, Sweden", "ndt.iupui.arn.donar.measurement-lab.org"},
- {"Athens, Greece", "ndt.iupui.ath.donar.measurement-lab.org"},
- {"Atlanta, Georgia", "ndt.iupui.atl.donar.measurement-lab.org"},
- {"Chicago, Illinois", "ndt.iupui.ord.donar.measurement-lab.org"},
- {"Dallas, Texas", "ndt.iupui.dfw.donar.measurement-lab.org"},
- {"Dublin, Ireland", "ndt.iupui.dub.donar.measurement-lab.org"},
- {"Washington Dulles Intl Washington, DC", "ndt.iupui.iad.donar.measurement-lab.org"},
- {"Hamburg, Germany", "ndt.iupui.ham.donar.measurement-lab.org"},
- {"Tokyo, Japan", "ndt.iupui.hnd.donar.measurement-lab.org"},
- {"Los Angeles, California",
"ndt.iupui.lax.donar.measurement-lab.org"},
- {"Leeds, United Kingdom", "ndt.iupui.lba.donar.measurement-lab.org"},
- {"London, United Kingdom", "ndt.iupui.lhr.donar.measurement-lab.org"},
- {"New York City, New York",
"ndt.iupui.lga.donar.measurement-lab.org"},
- {"Ljubljana, Slovenia", "ndt.iupui.lju.donar.measurement-lab.org"},
- {"Madrid, Spain", "ndt.iupui.mad.donar.measurement-lab.org"},
- {"Miami, Florida", "ndt.iupui.mia.donar.measurement-lab.org"},
- {"Milan, Italy", "ndt.iupui.mil.donar.measurement-lab.org"},
- {"Mountain View, California",
"ndt.iupui.nuq.donar.measurement-lab.org"},
- {"Paris, France", "ndt.iupui.par.donar.measurement-lab.org"},
- {"Seattle, Washington", "ndt.iupui.sea.donar.measurement-lab.org"},
- {"Sydney, Australia", "ndt.iupui.syd.donar.measurement-lab.org"},
- {"Stavanger, Norway", "ndt.iupui.svg.donar.measurement-lab.org"},
- {"Taipei, Taiwan", "ndt.iupui.tpe.donar.measurement-lab.org"},
- {"Turin, Italy", "ndt.iupui.trn.donar.measurement-lab.org"},
- {"Vienna, Austria", "ndt.iupui.vie.donar.measurement-lab.org"},
- {"Wellington, New Zealand", "ndt.iupui.wlg.donar.measurement-lab.org"}
+ {"Closest Server (MLabNS)", "default"},
+ {"Auckland, New Zealand", "akl"},
+ {"Amsterdam, Netherlands", "ams"},
+ {"Stockholm, Sweden", "arn"},
+ {"Athens, Greece", "ath"},
+ {"Atlanta, Georgia", "atl"},
+ {"Chicago, Illinois", "ord"},
+ {"Dallas, Texas", "dfw"},
+ {"Dublin, Ireland", "dub"},
+ {"Washington Dulles Intl Washington, DC", "iad"},
+ {"Hamburg, Germany", "ham"},
+ {"Tokyo, Japan", "hnd"},
+ {"Los Angeles, California", "lax"},
+ {"Leeds, United Kingdom", "lba"},
+ {"London, United Kingdom", "lhr"},
+ {"New York City, New York", "lga"},
+ {"Ljubljana, Slovenia", "lju"},
+ {"Madrid, Spain", "mad"},
+ {"Miami, Florida", "mia"},
+ {"Milan, Italy", "mil"},
+ {"Mountain View, California", "nuq"},
+ {"Paris, France", "par"},
+ {"Seattle, Washington", "sea"},
+ {"Sydney, Australia", "syd"},
+ {"Stavanger, Norway", "svg"},
+ {"Taipei, Taiwan", "tpe"},
+ {"Turin, Italy", "trn"},
+ {"Vienna, Austria", "vie"},
+ {"Wellington, New Zealand", "wlg"}

};

@@ -70,6 +71,17 @@
// dynamically.
static final int DEFAULT_SERVER = 0;

+ public static String lookupHostname(Context context, int index) {
+ if ( index <= -1 ) {
+ index = 0;
+ }
+ if ( index >= SelectServerActivity.SERVER_LIST.length ) {
+ index = 0;
+ }
+ String metroCode = SelectServerActivity.SERVER_LIST[index][1];
+ return MLabNS.Lookup(context, "ndt", "ipv4", metroCode);
+ }
+
/**
* Reads the server list from Constants class. Records the user's choice and
* send it back to the main activity.
=======================================
--- /branches/android/Android/src/net/measurementlab/ndt/TestsActivity.java Wed Dec 5 15:09:48 2012
+++ /branches/android/Android/src/net/measurementlab/ndt/TestsActivity.java Tue Jan 22 14:40:35 2013
@@ -223,12 +223,12 @@
private String getServerAddress() {
try {
InetAddress server = null;
- if ( serverHost != null ) {
- server = InetAddress.getByName(serverHost);
- } else {
+ if ( null == serverHost ) {
// use default
- server = InetAddress.getByName(SelectServerActivity.SERVER_LIST[SelectServerActivity.DEFAULT_SERVER][1]);
+ Log.e(NdtSupport.LOG_TAG, "Error: This really
shouldn't happen.");
+ serverHost = SelectServerActivity.lookupHostname(getBaseContext(), SelectServerActivity.DEFAULT_SERVER);
}
+ server = InetAddress.getByName(serverHost);
return server.getHostAddress();
} catch (UnknownHostException e) {
Log.e(NdtSupport.LOG_TAG, "Error resolving server
hosts.", e);
=======================================
--- /branches/android/java/net/measurementlab/ndt/NdtTests.java Wed Dec 5 15:09:48 2012
+++ /branches/android/java/net/measurementlab/ndt/NdtTests.java Tue Jan 22 14:40:35 2013
@@ -1141,7 +1141,7 @@
{
while (!finalized) {
try {
- Thread.currentThread().sleep(1000);
+ Thread.sleep(1000);
}
catch (InterruptedException e) {
// do nothing.


  • [ndt-dev] [ndt] r797 committed - commit patch for http://code.google.com/p/ndt/issues/detail?id=72 Add ..., ndt, 01/22/2013

Archive powered by MHonArc 2.6.16.

Top of Page