com.sensorcon.sensordrone.android.tools
Class DroneConnectionHelper

java.lang.Object
  extended by com.sensorcon.sensordrone.android.tools.DroneConnectionHelper

public class DroneConnectionHelper
extends java.lang.Object

This class contains some useful connection methods to aid in the development of Apps for the Sensordrone.


Constructor Summary
DroneConnectionHelper()
           
 
Method Summary
 boolean isBTEnabled(Context context, BluetoothAdapter btAdapter)
          Check if Bluetooth is currently enabled and, if not, asks the user to enable it.
 void scanToConnect(Drone drone, Activity activity, Context context, boolean includePairedDevices)
          scantoConnect will launch an alert dialog, which will scan for Bluetooth devices, and populate a list.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DroneConnectionHelper

public DroneConnectionHelper()
Method Detail

scanToConnect

public void scanToConnect(Drone drone,
                          Activity activity,
                          Context context,
                          boolean includePairedDevices)
scantoConnect will launch an alert dialog, which will scan for Bluetooth devices, and populate a list. Selecting an item from this list will attempt connection. It also checks if Bluetooth is currently enabled on the device.

Parameters:
drone - The Drone to connect
activity - Your apps activity
context - Your apps context
includePairedDevices - True if you want to include the phone's paired devices in the list

isBTEnabled

public boolean isBTEnabled(Context context,
                           BluetoothAdapter btAdapter)
Check if Bluetooth is currently enabled and, if not, asks the user to enable it.

Parameters:
context - You apps context
btAdapter - The devices BluetoothAdapter
Returns:
Returns true if Bluetooth is already enabled