AI2 Component  (Version nb184)
com.google.appinventor.components.runtime.util.BluetoothReflection Class Reference

Static Public Member Functions

static Object getBluetoothAdapter ()
 
static boolean isBluetoothEnabled (Object bluetoothAdapter)
 
static Set getBondedDevices (Object bluetoothAdapter)
 
static boolean checkBluetoothAddress (Object bluetoothAdapter, String address)
 
static Object getRemoteDevice (Object bluetoothAdapter, String address) throws IllegalArgumentException
 
static Object listenUsingRfcommWithServiceRecord (Object bluetoothAdapter, String name, UUID uuid) throws IOException
 
static Object listenUsingInsecureRfcommWithServiceRecord (Object bluetoothAdapter, String name, UUID uuid) throws IOException
 
static String getBluetoothDeviceName (Object bluetoothDevice)
 
static String getBluetoothDeviceAddress (Object bluetoothDevice)
 
static boolean isBonded (Object bluetoothDevice)
 
static Object getBluetoothClass (Object bluetoothDevice)
 
static Object createRfcommSocketToServiceRecord (Object bluetoothDevice, UUID uuid) throws IOException
 
static Object createInsecureRfcommSocketToServiceRecord (Object bluetoothDevice, UUID uuid) throws IOException
 
static int getDeviceClass (Object bluetoothClass)
 
static void connectToBluetoothSocket (Object bluetoothSocket) throws IOException
 
static boolean isBluetoothSocketConnected (Object bluetoothSocket)
 
static InputStream getInputStream (Object bluetoothSocket) throws IOException
 
static OutputStream getOutputStream (Object bluetoothSocket) throws IOException
 
static void closeBluetoothSocket (Object bluetoothSocket) throws IOException
 
static Object accept (Object bluetoothServerSocket) throws IOException
 
static void closeBluetoothServerSocket (Object bluetoothServerSocket) throws IOException
 

Detailed Description

Provides access to Android Bluetooth classes via Java reflection.

Author
lizlo.nosp@m.oney.nosp@m.@goog.nosp@m.le.c.nosp@m.om (Liz Looney)

Definition at line 29 of file BluetoothReflection.java.

Member Function Documentation

◆ accept()

static Object com.google.appinventor.components.runtime.util.BluetoothReflection.accept ( Object  bluetoothServerSocket) throws IOException
static

Invokes the method android.bluetooth.BluetoothServerSocket#accept().

Parameters
bluetoothServerSocketa android.bluetooth.BluetoothServerSocket object
Returns
a android.bluetooth.BluetoothSocket object

Definition at line 328 of file BluetoothReflection.java.

◆ checkBluetoothAddress()

static boolean com.google.appinventor.components.runtime.util.BluetoothReflection.checkBluetoothAddress ( Object  bluetoothAdapter,
String  address 
)
static

Invokes the method android.bluetooth.BluetoothAdapter#checkBluetoothAddress(String).

Parameters
bluetoothAdaptera android.bluetooth.BluetoothAdapter object
addressa string that might be a bluetooth MAC address
Returns
true if the address is valid, false otherwise

Definition at line 90 of file BluetoothReflection.java.

◆ closeBluetoothServerSocket()

static void com.google.appinventor.components.runtime.util.BluetoothReflection.closeBluetoothServerSocket ( Object  bluetoothServerSocket) throws IOException
static

Invokes the method android.bluetooth.BluetoothServerSocket#close().

Parameters
bluetoothServerSocketa android.bluetooth.BluetoothServerSocket object

Definition at line 339 of file BluetoothReflection.java.

◆ closeBluetoothSocket()

static void com.google.appinventor.components.runtime.util.BluetoothReflection.closeBluetoothSocket ( Object  bluetoothSocket) throws IOException
static

Invokes the method android.bluetooth.BluetoothSocket#close().

Parameters
bluetoothSocketa android.bluetooth.BluetoothSocket object

Definition at line 314 of file BluetoothReflection.java.

◆ connectToBluetoothSocket()

static void com.google.appinventor.components.runtime.util.BluetoothReflection.connectToBluetoothSocket ( Object  bluetoothSocket) throws IOException
static

Invokes the method android.bluetooth.BluetoothSocket#connect().

Parameters
bluetoothSocketa android.bluetooth.BluetoothSocket object

Definition at line 263 of file BluetoothReflection.java.

◆ createInsecureRfcommSocketToServiceRecord()

static Object com.google.appinventor.components.runtime.util.BluetoothReflection.createInsecureRfcommSocketToServiceRecord ( Object  bluetoothDevice,
UUID  uuid 
) throws IOException
static

Invokes the method android.bluetooth.BluetoothDevice#createInsecureRfcommSocketToServiceRecord(Object, UUID).

Parameters
bluetoothDevicea android.bluetooth.BluetoothDevice object
uuidthe service record uuid
Returns
a android.bluetooth.BluetoothSocket object

Definition at line 230 of file BluetoothReflection.java.

◆ createRfcommSocketToServiceRecord()

static Object com.google.appinventor.components.runtime.util.BluetoothReflection.createRfcommSocketToServiceRecord ( Object  bluetoothDevice,
UUID  uuid 
) throws IOException
static

Invokes the method android.bluetooth.BluetoothDevice#createRfcommSocketToServiceRecord(UUID).

Parameters
bluetoothDevicea android.bluetooth.BluetoothDevice object
uuidthe service record uuid
Returns
a android.bluetooth.BluetoothSocket object

Definition at line 212 of file BluetoothReflection.java.

◆ getBluetoothAdapter()

static Object com.google.appinventor.components.runtime.util.BluetoothReflection.getBluetoothAdapter ( )
static

Invokes the method android.bluetooth.BluetoothAdapter#getDefaultAdapter().

Returns
a android.bluetooth.BluetoothAdapter object, or null if Bluetooth is not available

Definition at line 44 of file BluetoothReflection.java.

◆ getBluetoothClass()

static Object com.google.appinventor.components.runtime.util.BluetoothReflection.getBluetoothClass ( Object  bluetoothDevice)
static

Invokes the method android.bluetooth.BluetoothDevice#getBluetoothClass().

Parameters
bluetoothDevicea android.bluetooth.BluetoothDevice object
Returns
the BluetoothClass of the given android.bluetooth.BluetoothDevice

Definition at line 198 of file BluetoothReflection.java.

◆ getBluetoothDeviceAddress()

static String com.google.appinventor.components.runtime.util.BluetoothReflection.getBluetoothDeviceAddress ( Object  bluetoothDevice)
static

Invokes the method android.bluetooth.BluetoothDevice#getAddress().

Parameters
bluetoothDevicea android.bluetooth.BluetoothDevice object
Returns
the address of the given android.bluetooth.BluetoothDevice

Definition at line 171 of file BluetoothReflection.java.

◆ getBluetoothDeviceName()

static String com.google.appinventor.components.runtime.util.BluetoothReflection.getBluetoothDeviceName ( Object  bluetoothDevice)
static

Invokes the method android.bluetooth.BluetoothDevice#getName().

Parameters
bluetoothDevicea android.bluetooth.BluetoothDevice object
Returns
the name of the given android.bluetooth.BluetoothDevice

Definition at line 158 of file BluetoothReflection.java.

◆ getBondedDevices()

static Set com.google.appinventor.components.runtime.util.BluetoothReflection.getBondedDevices ( Object  bluetoothAdapter)
static

Invokes the method android.bluetooth.BluetoothAdapter#getBondedDevices().

Parameters
bluetoothAdaptera android.bluetooth.BluetoothAdapter object
Returns
a Set of android.bluetooth.BluetoothDevice objects

Definition at line 76 of file BluetoothReflection.java.

◆ getDeviceClass()

static int com.google.appinventor.components.runtime.util.BluetoothReflection.getDeviceClass ( Object  bluetoothClass)
static

Invokes the method android.bluetooth.BluetoothClass#getDeviceClass().

Parameters
bluetoothClassa android.bluetooth.BluetoothClass object
Returns
the (major and minor) device class component of the given android.bluetooth.BluetoothClass

Definition at line 249 of file BluetoothReflection.java.

◆ getInputStream()

static InputStream com.google.appinventor.components.runtime.util.BluetoothReflection.getInputStream ( Object  bluetoothSocket) throws IOException
static

Invokes the method android.bluetooth.BluetoothSocket#getInputStream().

Parameters
bluetoothSocketa android.bluetooth.BluetoothSocket object
Returns
the InputStream

Definition at line 287 of file BluetoothReflection.java.

◆ getOutputStream()

static OutputStream com.google.appinventor.components.runtime.util.BluetoothReflection.getOutputStream ( Object  bluetoothSocket) throws IOException
static

Invokes the method android.bluetooth.BluetoothSocket#getOutputStream().

Parameters
bluetoothSocketa android.bluetooth.BluetoothSocket object
Returns
the OutputStream

Definition at line 301 of file BluetoothReflection.java.

◆ getRemoteDevice()

static Object com.google.appinventor.components.runtime.util.BluetoothReflection.getRemoteDevice ( Object  bluetoothAdapter,
String  address 
) throws IllegalArgumentException
static

Invokes the method android.bluetooth.BluetoothAdapter#getRemoteDevice(String).

Parameters
bluetoothAdaptera android.bluetooth.BluetoothAdapter object
addressthe bluetooth MAC address of the device
Returns
a android.bluetooth.BluetoothDevice object

Definition at line 105 of file BluetoothReflection.java.

◆ isBluetoothEnabled()

static boolean com.google.appinventor.components.runtime.util.BluetoothReflection.isBluetoothEnabled ( Object  bluetoothAdapter)
static

Invokes the method android.bluetooth.BluetoothAdapter#isEnabled().

Parameters
bluetoothAdaptera android.bluetooth.BluetoothAdapter object
Returns
true if Bluetooth is enabled, false otherwise

Definition at line 63 of file BluetoothReflection.java.

◆ isBluetoothSocketConnected()

static boolean com.google.appinventor.components.runtime.util.BluetoothReflection.isBluetoothSocketConnected ( Object  bluetoothSocket)
static

Invokes the method android.bluetooth.BluetoothSocket#isConnected().

Parameters
bluetoothSocketa android.bluetooth.BluetoothSocket object

Definition at line 275 of file BluetoothReflection.java.

◆ isBonded()

static boolean com.google.appinventor.components.runtime.util.BluetoothReflection.isBonded ( Object  bluetoothDevice)
static

Invokes the method android.bluetooth.BluetoothDevice#getBondState().

Parameters
bluetoothDevicea android.bluetooth.BluetoothDevice object
Returns
the bond state of the given android.bluetooth.BluetoothDevice

Definition at line 184 of file BluetoothReflection.java.

◆ listenUsingInsecureRfcommWithServiceRecord()

static Object com.google.appinventor.components.runtime.util.BluetoothReflection.listenUsingInsecureRfcommWithServiceRecord ( Object  bluetoothAdapter,
String  name,
UUID  uuid 
) throws IOException
static

◆ listenUsingRfcommWithServiceRecord()

static Object com.google.appinventor.components.runtime.util.BluetoothReflection.listenUsingRfcommWithServiceRecord ( Object  bluetoothAdapter,
String  name,
UUID  uuid 
) throws IOException
static

Invokes the method android.bluetooth.BluetoothAdapter#listenUsingRfcommWithServiceRecord(String,UUID).

Parameters
bluetoothAdaptera android.bluetooth.BluetoothAdapter object
nameservice name for SDP record
uuiduuid for SDP record
Returns
a listening RFCOMM android.bluetooth.BluetoothServerSocket

Definition at line 122 of file BluetoothReflection.java.


The documentation for this class was generated from the following file: