|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Thread
ims.devicemanager.BluetoothConnectThread
public class BluetoothConnectThread
If a Bluetooth-Device is selected from the device list this class is called.
It opens sockets to connect with the device and manages the connection (calls
the BluetoothDataManager
class if the connection stands) until
shutdown.
Copyright © 2014 by Daniela Blum
This file is part of GPSChildFinder.
GPSChildFinder is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option) any
later version.
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
details.
You should have received a copy of the GNU General Public License along with
this program. If not, see http://www.gnu.org/licenses.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.lang.Thread |
---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
Field Summary | |
---|---|
static boolean |
DEVICE_CONNECTED
true if a device is connected via Bluetooth or rather a Bluetooth socket is connected to a remote device |
static boolean |
GETTING_GPS_INPUT
true if the phone receives GPS input from the GPS-Bluetooth-device, false otherwise |
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Method Summary | |
---|---|
void |
cancel(boolean triggered)
Called when something goes wrong with the Bluetooth-connection or the user want's to disconnect the device from the phone. |
static BluetoothConnectThread |
getInstance(android.content.Context context,
android.bluetooth.BluetoothDevice device,
android.app.Activity currentActivity)
|
void |
run()
Tries to connect the Bluetooth socket with the Bluetooth device when no device is connected so far. |
Methods inherited from class java.lang.Thread |
---|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static boolean DEVICE_CONNECTED
public static boolean GETTING_GPS_INPUT
Method Detail |
---|
public static BluetoothConnectThread getInstance(android.content.Context context, android.bluetooth.BluetoothDevice device, android.app.Activity currentActivity)
public void run()
BluetoothDataManager.readNMEASentences()
is called to handle the
incomming sentences from the device.
run
in interface java.lang.Runnable
run
in class java.lang.Thread
public void cancel(boolean triggered)
DeviceHandler.cleanUp()
method, cleans out the values and updates
the screen if necessary.
triggered
- true if the user triggered the cancellation of the connection,
false otherwise
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |