Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
47f6db64
Kaydet (Commit)
47f6db64
authored
Şub 12, 2013
tarafından
Tor Lillqvist
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Use android.util.Log instead of printing to System.out
Change-Id: I314066086827d283938c6f402733da3f801ad55b
üst
56f4d7dc
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
40 additions
and
16 deletions
+40
-16
Globals.java
...d/sdremote/src/org/libreoffice/impressremote/Globals.java
+17
-0
SelectorActivity.java
...e/src/org/libreoffice/impressremote/SelectorActivity.java
+2
-3
BluetoothClient.java
...reoffice/impressremote/communication/BluetoothClient.java
+5
-2
BluetoothFinder.java
...reoffice/impressremote/communication/BluetoothFinder.java
+6
-5
NetworkClient.java
...ibreoffice/impressremote/communication/NetworkClient.java
+5
-2
ServerFinder.java
...libreoffice/impressremote/communication/ServerFinder.java
+5
-4
No files found.
android/sdremote/src/org/libreoffice/impressremote/Globals.java
0 → 100644
Dosyayı görüntüle @
47f6db64
/* -*- 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: */
android/sdremote/src/org/libreoffice/impressremote/SelectorActivity.java
Dosyayı görüntüle @
47f6db64
...
...
@@ -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
(
...
...
android/sdremote/src/org/libreoffice/impressremote/communication/BluetoothClient.java
Dosyayı görüntüle @
47f6db64
...
...
@@ -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
(
"C
onnected"
);
Log
.
i
(
Globals
.
TAG
,
"BluetoothClient: c
onnected"
);
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
;
}
...
...
android/sdremote/src/org/libreoffice/impressremote/communication/BluetoothFinder.java
Dosyayı görüntüle @
47f6db64
...
...
@@ -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: */
android/sdremote/src/org/libreoffice/impressremote/communication/NetworkClient.java
Dosyayı görüntüle @
47f6db64
...
...
@@ -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
();
}
...
...
android/sdremote/src/org/libreoffice/impressremote/communication/ServerFinder.java
Dosyayı görüntüle @
47f6db64
...
...
@@ -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: */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment