diff options
author | Tor Lillqvist <tml@iki.fi> | 2013-02-12 23:00:51 +0200 |
---|---|---|
committer | Michael Meeks <michael.meeks@suse.com> | 2013-02-13 11:32:35 +0000 |
commit | 0a77fd88fd5c4c5fb645fa01bd2d028be6cf9a01 (patch) | |
tree | 52c5b934652cc3ce4dab633383c037388b3b6715 /android | |
parent | 9dcb78991f92acb8fb01ca8d3f6c0b0817044f82 (diff) |
Use android.util.Log instead of printing to System.out
Change-Id: I314066086827d283938c6f402733da3f801ad55b
Signed-off-by: Michael Meeks <michael.meeks@suse.com>
Diffstat (limited to 'android')
6 files changed, 40 insertions, 14 deletions
diff --git a/android/sdremote/src/org/libreoffice/impressremote/Globals.java b/android/sdremote/src/org/libreoffice/impressremote/Globals.java new file mode 100644 index 000000000000..a767bb13c290 --- /dev/null +++ b/android/sdremote/src/org/libreoffice/impressremote/Globals.java @@ -0,0 +1,17 @@ +/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ +package org.libreoffice.impressremote; + +public class Globals { + + public static final String TAG = "sdremote"; + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/android/sdremote/src/org/libreoffice/impressremote/SelectorActivity.java b/android/sdremote/src/org/libreoffice/impressremote/SelectorActivity.java index e9d0686992b5..e8f4703ed4e9 100644 --- a/android/sdremote/src/org/libreoffice/impressremote/SelectorActivity.java +++ b/android/sdremote/src/org/libreoffice/impressremote/SelectorActivity.java @@ -30,6 +30,7 @@ import android.content.ServiceConnection; import android.os.Bundle; import android.os.IBinder; import android.support.v4.content.LocalBroadcastManager; +import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.View.OnClickListener; @@ -252,10 +253,8 @@ public class SelectorActivity extends SherlockActivity { private HashMap<Server, View> mNetworkServers = new HashMap<Server, View>(); private void deleteServer(View aView) { + Log.i(Globals.TAG, "SelectorActivity.deleteServer(" + aView + ")"); for (Entry<Server, View> aEntry : mNetworkServers.entrySet()) { - System.out.println(aEntry.getKey().getName()); - System.out.println(aView); - System.out.println(aEntry.getValue()); if (aEntry.getValue() == aView .findViewById(R.id.selector_sub_label) || aEntry.getValue().findViewById( diff --git a/android/sdremote/src/org/libreoffice/impressremote/communication/BluetoothClient.java b/android/sdremote/src/org/libreoffice/impressremote/communication/BluetoothClient.java index b3951693eb83..fe6ce6f01530 100644 --- a/android/sdremote/src/org/libreoffice/impressremote/communication/BluetoothClient.java +++ b/android/sdremote/src/org/libreoffice/impressremote/communication/BluetoothClient.java @@ -13,11 +13,14 @@ import java.io.IOException; import java.io.InputStreamReader; import java.util.UUID; +import org.libreoffice.impressremote.Globals; + import android.bluetooth.BluetoothAdapter; import android.bluetooth.BluetoothDevice; import android.bluetooth.BluetoothSocket; import android.content.Intent; import android.support.v4.content.LocalBroadcastManager; +import android.util.Log; /** * Standard Network client. Connects to a server using Sockets. @@ -49,7 +52,7 @@ public class BluetoothClient extends Client { mSocket = aDevice.createRfcommSocketToServiceRecord(UUID .fromString("00001101-0000-1000-8000-00805F9B34FB")); mSocket.connect(); - System.out.println("Connected"); + Log.i(Globals.TAG, "BluetoothClient: connected"); mInputStream = mSocket.getInputStream(); mReader = new BufferedReader(new InputStreamReader(mInputStream, @@ -57,7 +60,7 @@ public class BluetoothClient extends Client { mOutputStream = mSocket.getOutputStream(); String aTemp = mReader.readLine(); - System.out.println("SF:waited"); + Log.i(Globals.TAG, "BluetoothClient: got line " + aTemp); if (!aTemp.equals("LO_SERVER_SERVER_PAIRED")) { return; } diff --git a/android/sdremote/src/org/libreoffice/impressremote/communication/BluetoothFinder.java b/android/sdremote/src/org/libreoffice/impressremote/communication/BluetoothFinder.java index c3a54afee066..dc0db45744fc 100644 --- a/android/sdremote/src/org/libreoffice/impressremote/communication/BluetoothFinder.java +++ b/android/sdremote/src/org/libreoffice/impressremote/communication/BluetoothFinder.java @@ -11,6 +11,7 @@ package org.libreoffice.impressremote.communication; import java.util.Collection; import java.util.HashMap; +import org.libreoffice.impressremote.Globals; import org.libreoffice.impressremote.communication.Server.Protocol; import android.bluetooth.BluetoothAdapter; @@ -21,6 +22,7 @@ import android.content.Intent; import android.content.IntentFilter; import android.os.Handler; import android.support.v4.content.LocalBroadcastManager; +import android.util.Log; public class BluetoothFinder { @@ -69,9 +71,9 @@ public class BluetoothFinder { @Override public void onReceive(Context context, Intent aIntent) { if (aIntent.getAction().equals(BluetoothDevice.ACTION_FOUND)) { - System.out.println("Found"); BluetoothDevice aDevice = (BluetoothDevice) aIntent.getExtras() .get(BluetoothDevice.EXTRA_DEVICE); + Log.i(Globals.TAG, "BluetoothFinder.onReceive: found " + aDevice.getName() + " at " + aDevice.getAddress()); Server aServer = new Server(Protocol.BLUETOOTH, aDevice.getAddress(), aDevice.getName(), System.currentTimeMillis()); @@ -92,8 +94,8 @@ public class BluetoothFinder { aHandler.postDelayed(new Runnable() { @Override public void run() { - System.out.println("Looping"); - + // Looping, huh? + Log.i(Globals.TAG, "BluetothFinder: looping"); } }, 1000 * 15); } @@ -103,4 +105,4 @@ public class BluetoothFinder { }; } -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/android/sdremote/src/org/libreoffice/impressremote/communication/NetworkClient.java b/android/sdremote/src/org/libreoffice/impressremote/communication/NetworkClient.java index 3da51544d3a1..595d643d435c 100644 --- a/android/sdremote/src/org/libreoffice/impressremote/communication/NetworkClient.java +++ b/android/sdremote/src/org/libreoffice/impressremote/communication/NetworkClient.java @@ -15,10 +15,13 @@ import java.net.Socket; import java.net.UnknownHostException; import java.util.Random; +import org.libreoffice.impressremote.Globals; + import android.content.Intent; import android.content.SharedPreferences; import android.content.SharedPreferences.Editor; import android.support.v4.content.LocalBroadcastManager; +import android.util.Log; /** * Standard Network client. Connects to a server using Sockets. @@ -84,9 +87,9 @@ public class NetworkClient extends Client { while (mReader.readLine().length() != 0) { // Get rid of extra lines - System.out.println("SF: empty line"); + Log.i(Globals.TAG, "NetworkClient: extra line"); } - System.out.println("SD: empty"); + Log.i(Globals.TAG, "NetworkClient: calling startListening"); startListening(); } diff --git a/android/sdremote/src/org/libreoffice/impressremote/communication/ServerFinder.java b/android/sdremote/src/org/libreoffice/impressremote/communication/ServerFinder.java index 70bfa60bebfd..bd15c438bd90 100644 --- a/android/sdremote/src/org/libreoffice/impressremote/communication/ServerFinder.java +++ b/android/sdremote/src/org/libreoffice/impressremote/communication/ServerFinder.java @@ -17,11 +17,13 @@ import java.net.SocketException; import java.util.Collection; import java.util.HashMap; +import org.libreoffice.impressremote.Globals; import org.libreoffice.impressremote.communication.Server.Protocol; import android.content.Context; import android.content.Intent; import android.support.v4.content.LocalBroadcastManager; +import android.util.Log; public class ServerFinder { @@ -78,7 +80,7 @@ public class ServerFinder { .getAddress().getHostAddress(), aName, System.currentTimeMillis()); mServerList.put(aServer.getAddress(), aServer); - System.out.println("Contains:<<" + aName + ">>"); + Log.i(Globals.TAG, "ServerFinder.listenForServer: contains " + aName); notifyActivity(); } catch (java.net.SocketTimeoutException e) { @@ -161,7 +163,7 @@ public class ServerFinder { private void checkAndAddEmulator() { try { if (InetAddress.getByName("10.0.2.2").isReachable(100)) { - System.out.println("NulledNot"); + Log.i(Globals.TAG, "ServerFinder.checkAndAddEmulator: NulledNot, whatever that is supposed to mean"); Server aServer = new Server(Protocol.NETWORK, "10.0.2.2", "Android Emulator Host", 0); aServer.mNoTimeout = true; @@ -185,4 +187,4 @@ public class ServerFinder { return mServerList.values(); } } -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |