Skip to Content.
Sympa Menu

ndt-dev - [ndt-dev] [ndt] r760 committed - Remove unused class.

Subject: NDT-DEV email list created

List archive

[ndt-dev] [ndt] r760 committed - Remove unused class.


Chronological Thread 
  • From:
  • To:
  • Subject: [ndt-dev] [ndt] r760 committed - Remove unused class.
  • Date: Thu, 15 Dec 2011 16:11:19 +0000

Revision: 760
Author:

Date: Thu Dec 15 08:07:03 2011
Log: Remove unused class.
http://code.google.com/p/ndt/source/detail?r=760

Deleted:
/branches/android/Android/src/net/measurementlab/ndt/AndroidNdt.java
/branches/android/Android/src/net/measurementlab/ndt/NdtLocation.java

=======================================
--- /branches/android/Android/src/net/measurementlab/ndt/AndroidNdt.java Tue Aug 23 13:36:59 2011
+++ /dev/null
@@ -1,83 +0,0 @@
-// Copyright 2009 Google Inc. All Rights Reserved.
-
-package net.measurementlab.ndt;
-
-import android.app.Activity;
-import android.content.Context;
-import android.os.Bundle;
-import android.os.PowerManager;
-import android.util.Log;
-import android.widget.Toast;
-
-/**
- * UI Thread and Entry Point of NDT mobile client.
- */
-public class AndroidNdt extends Activity {
- private PowerManager powerManager;
- private PowerManager.WakeLock wakeLock;
- private NdtLocation ndtLocation;
-
- /**
- * Initializes the activity.
- */
- @Override
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- checkServerListValid();
- // Set the default server
- ndtLocation = new NdtLocation(this);
- ndtLocation.startListen();
- powerManager = (PowerManager) getSystemService(Context.POWER_SERVICE);
- wakeLock = powerManager.newWakeLock(PowerManager.SCREEN_DIM_WAKE_LOCK, "Network Testing");
- }
-
- /**
- *
{@inheritDoc}
- */
- @Override
- protected void onDestroy() {
- Log.v(Constants.LOG_TAG, "onDestory");
- if (wakeLock != null && wakeLock.isHeld()) {
- wakeLock.release();
- Log.v(Constants.LOG_TAG, "Release Wake Lock onDestroy");
- }
- super.onDestroy();
- }
-
- /**
- *
{@inheritDoc}
- */
- @Override
- protected void onStart() {
- Log.v(Constants.LOG_TAG, "onStart");
- ndtLocation.startListen();
- super.onStart();
- }
-
- /**
- *
{@inheritDoc}
- */
- @Override
- protected void onStop() {
- Log.v(Constants.LOG_TAG, "onStop");
- ndtLocation.stopListen();
- super.onStop();
- }
-
- /**
- * Called when server length is invalid.
- *
- * @see Constants#NUMBER_OF_SERVERS
- */
- private void checkServerListValid() {
- if ((Constants.SERVER_NAME.length != Constants.SERVER_HOST.length)
- || (Constants.NUMBER_OF_SERVERS == 0)) {
- Log.v(Constants.LOG_TAG, "Server list corrupted.");
- Toast toast =
- Toast.makeText(getApplicationContext(), R.string.serverlist_corrupted_tip,
- Toast.LENGTH_SHORT);
- toast.show();
- finish();
- }
- }
-}
=======================================
--- /branches/android/Android/src/net/measurementlab/ndt/NdtLocation.java Wed Jun 9 15:23:05 2010
+++ /dev/null
@@ -1,68 +0,0 @@
-// Copyright 2009 Google Inc. All Rights Reserved.
-
-package net.measurementlab.ndt;
-
-import android.content.Context;
-import android.location.Criteria;
-import android.location.Location;
-import android.location.LocationListener;
-import android.location.LocationManager;
-import android.os.Bundle;
-
-/**
- * Handle the location related functions and listeners.
- */
-public class NdtLocation implements LocationListener {
- /**
- * Location variable, publicly accessible to provide access to geographic data.
- */
- public Location location;
- private LocationManager locationManager;
- private Criteria criteria;
-
- /**
- * Passes context to this class to initialize members.
- *
- * @param context context which is currently running
- */
- public NdtLocation(Context context) {
- locationManager = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE);
- criteria = new Criteria();
- criteria.setAccuracy(Criteria.ACCURACY_FINE);
- criteria.setCostAllowed(true);
- criteria.setPowerRequirement(Criteria.POWER_LOW);
- }
-
- public void onLocationChanged(Location location) {
- this.location = location;
- }
-
- public void onProviderDisabled(String provider) {
- // Don't care when the provider is disabled.
- }
-
- public void onProviderEnabled(String provider) {
- // Don't care when the provider is enabled.
- }
-
- public void onStatusChanged(String provider, int status, Bundle extras) {
- // Don't care when the provider is temporarily unavailable.
- }
-
- /**
- * Stops requesting the location update.
- */
- public void stopListen() {
- locationManager.removeUpdates(this);
- }
-
- /**
- * Begins to request the location update.
- */
- public void startListen() {
- locationManager.requestLocationUpdates(locationManager.getBestProvider(criteria, true), 0, 0,
- this);
- location =
- locationManager.getLastKnownLocation(locationManager.getBestProvider(criteria, true));
- }
-}


  • [ndt-dev] [ndt] r760 committed - Remove unused class., ndt, 12/15/2011

Archive powered by MHonArc 2.6.16.

Top of Page