Bluetooth Application For Android Tablet Free Download
- Bluetooth For Android Tablet 4.0 Free Download
- Bluetooth For Android Tablet Free Download
- Bluetooth Software For Android Tablet Free Download
- Bluetooth Application For Android Tablet Free Download For Windows 10
- Bluetooth App Download
Download and install Bluetooth File Transfer/share/sender APK APP file latest version v5.58 free download for all android smart phones and tablets. Bluetooth File transfer android app helps you to Browse, Explore, and manage of any Bluetooth ready device.
The Android platform includes support for the Bluetooth network stack,which allows a device to wirelessly exchange data with other Bluetooth devices.The application framework provides access to the Bluetooth functionality throughthe Android Bluetooth APIs. These APIs let applications wirelesslyconnect to other Bluetooth devices, enabling point-to-point and multipointwireless features.
Using the Bluetooth APIs, an Android application can perform thefollowing:
- Scan for other Bluetooth devices
- Query the local Bluetooth adapter for paired Bluetooth devices
- Establish RFCOMM channels
- Connect to other devices through service discovery
- Transfer data to and from other devices
- Manage multiple connections
This page focuses on Classic Bluetooth. ClassicBluetooth is the right choice for more battery-intensive operations, which include streamingand communicating between Android devices. For Bluetooth devices with low power requirements,Android 4.3 (API level 18) introduces API support for Bluetooth Low Energy. To learn more,see Bluetooth Low Energy.
This document describes different Bluetooth profiles, including the HealthDevice Profile. It then explains how to use the Android Bluetooth APIs toaccomplish the four major tasks necessary to communicate using Bluetooth:setting up Bluetooth, finding devices that are either paired or available in thelocal area, connecting devices, and transferring data between devices.
The basics
In order for Bluetooth-enabled devices to transmit data between each other,they must first form a channel of communication using a pairing process.One device, a discoverable device, makes itself available for incomingconnection requests. Another device finds the discoverable device using aservice discovery process. After the discoverable device accepts thepairing request, the two devices complete a bonding process where theyexchange security keys. The devices cache these keys for later use. After thepairing and bonding processes are complete, the two devices exchangeinformation. When the session is complete, the device that initiated thepairing request releases the channel that had linked it to the discoverabledevice. The two devices remain bonded, however, so they can reconnectautomatically during a future session as long as they're in range of each otherand neither device has removed the bond.
Bluetooth permissions
In order to use Bluetooth features in your application, you must declaretwo permissions. The first of these is BLUETOOTH
.You need this permission to perform any Bluetooth communication,such as requesting a connection, accepting a connection, and transferring data.
The other permission that you must declare is eitherACCESS_COARSE_LOCATION
orACCESS_FINE_LOCATION
. A locationpermission is required because Bluetooth scans can be used togather information about the location of the user. This informationmay come from the user's own devices, as well as Bluetooth beaconsin use at locations such as shops and transit facilities.
If you want your app to initiate device discovery or manipulate Bluetoothsettings, you must declare the BLUETOOTH_ADMIN
permission in addition to the BLUETOOTH
permission. Most applications need this permission solely for theability to discover local Bluetooth devices. The other abilities granted by thispermission should not be used, unless the application is a 'power manager' thatmodifies Bluetooth settings upon user request.
Declare the Bluetooth permission(s) in your application manifest file. Forexample:
See the <uses-permission>reference for more information about declaring application permissions.
Work with profiles
Starting in Android 3.0, the Bluetooth API includes support for working withBluetooth profiles. A Bluetooth profile is a wireless interfacespecification for Bluetooth-based communication between devices. An exampleis the Hands-Free profile. For a mobile phone to connect to a wireless headset,both devices must support the Hands-Free profile.
The Android Bluetooth API provides implementations for the followingBluetooth profiles:
- Headset. The Headset profile provides support forBluetooth headsets to be used with mobile phones. Android provides the
BluetoothHeadset
class, which is a proxy forcontrolling the Bluetooth Headset Service. This includes both Bluetooth Headsetand Hands-Free (v1.5) profiles. TheBluetoothHeadset
class includes support for AT commands. For more discussion of this topic, seeVendor-specific AT commands - A2DP. The Advanced Audio Distribution Profile (A2DP)profile defines how high quality audio can be streamed from one device toanother over a Bluetooth connection. Android provides the
BluetoothA2dp
class, which is a proxy for controllingthe Bluetooth A2DP Service. - Health Device. Android 4.0 (API level 14) introducessupport for the Bluetooth Health Device Profile (HDP). This lets you createapplications that use Bluetooth to communicate with health devices that supportBluetooth, such as heart-rate monitors, blood meters, thermometers, scales, andso on. For a list of supported devices and their corresponding device dataspecialization codes, refer to Bluetooth's HDPDevice Data Specializations. These valuesare also referenced in the ISO/IEEE 11073-20601 [7] specification asMDC_DEV_SPEC_PROFILE_* in the Nomenclature Codes Annex. For more discussion ofHDP, see Health Device Profile.
Here are the basic steps for working with a profile:
- Get the default adapter, as described in Setting Up Bluetooth.
- Set up a
BluetoothProfile.ServiceListener
. Thislistener notifiesBluetoothProfile
clients whenthey have been connected to or disconnected from the service. - Use
getProfileProxy()
toestablish a connection to the profile proxy object associated with the profile.In the example below, the profile proxy object is an instance ofBluetoothHeadset
. - In
onServiceConnected()
, get a handleto the profile proxy object. - Once you have the profile proxy object, you can use it to monitor thestate of the connection and perform other operations that are relevant to thatprofile.
For example, this code snippet shows how to connect to a BluetoothHeadset
proxy object so that you can control theHeadset profile:
Vendor-specific AT commands
Starting in Android 3.0 (API level 11), applications can register to receive systembroadcasts of predefined vendor-specific AT commands sent by headsets (such asa Plantronics +XEVENT command). For example, an application could receivebroadcasts that indicate a connected device's battery level and could notify theuser or take other action as needed. Create a broadcast receiver for the ACTION_VENDOR_SPECIFIC_HEADSET_EVENT
intentto handle vendor-specific AT commands for the headset.
Health device profile
Android 4.0 (API level 14) introduces support for the Bluetooth Health DeviceProfile (HDP). This lets you create applications that use Bluetooth tocommunicate with health devices that support Bluetooth, such as heart-ratemonitors, blood meters, thermometers, and scales. The Bluetooth Health APIincludes the classes BluetoothHealth
, BluetoothHealthCallback
, and BluetoothHealthAppConfiguration
, which are described in Key Classes and Interfaces.
In using the Bluetooth Health API, it's helpful to understand these key HDP concepts:
- Source
- A health device—such as a weight scale, glucose meter, or thermometer—thattransmits medical data to asmart device, such as an Android phone or tablet.
- Sink
- The smart device thatreceives the medical data. In an Android HDP application, the sink isrepresented by a
BluetoothHealthAppConfiguration
object. - Registration
- The process used to register a sink for communicating with a particular health device.
- Connection
- The process used to open a channel between a health device (source) and a smart device (sink).
Create an HDP application
Here are the basic steps involved in creating an Android HDP application:
- Get a reference to the
BluetoothHealth
proxyobject.Similar to regular headset and A2DP profile devices, you must call
getProfileProxy()
with aBluetoothProfile.ServiceListener
and theHEALTH
profile type toestablish a connection with the profile proxy object. - Create a
BluetoothHealthCallback
and register anapplication configuration(BluetoothHealthAppConfiguration
)that acts as a healthsink. Establish a connection to a health device.
Note: Some devices initiate theconnection automatically. It is unnecessary to carry out this step for those devices.
- When connected successfully to a health device, read/write to the healthdevice using the file descriptor. The received data need to be interpretedusing a health manager which implements the IEEE 11073specifications.
- When done, close the health channel and unregister the application. Thechannel also closes when there is extended inactivity.
Set up bluetooth
Before your application can communicate over Bluetooth, you need to verifythat Bluetooth is supported on the device, and if so, ensure that it is enabled.
If Bluetooth isn't supported, then you should gracefully disable anyBluetooth features. If Bluetooth is supported, but disabled, then you can request that theuser enable Bluetooth without leaving your application. This setup isaccomplished in two steps, using the BluetoothAdapter
:
- Get the
BluetoothAdapter
.The
BluetoothAdapter
is required for any and all Bluetoothactivity. To get theBluetoothAdapter
, call the staticgetDefaultAdapter()
method. This returns aBluetoothAdapter
that represents the device's ownBluetooth adapter (the Bluetooth radio). There's one Bluetooth adapter for theentire system, and your application can interact with it using this object. IfgetDefaultAdapter()
returnsnull
,then the device doesn't support Bluetooth. For example: - Enable Bluetooth.
Next, you need to ensure that Bluetooth is enabled. Call
isEnabled()
to check whether Bluetooth iscurrently enabled. If this method returns false, then Bluetooth is disabled. Torequest that Bluetooth be enabled, callstartActivityForResult()
,passing in anACTION_REQUEST_ENABLE
intent action.This call issues a request to enable Bluetooth through the system settings (withoutstopping your application). For example:A dialog appears requesting user permission to enable Bluetooth, as shownin Figure 1. If the user responds 'Yes', the system begins to enable Bluetooth,and focus returns to your application once the process completes (or fails).
Figure 1: The enabling Bluetooth dialog.The
REQUEST_ENABLE_BT
constant passed tostartActivityForResult()
is a locallydefined integer that must be greater than 0. The system passes this constant back to you in youronActivityResult()
implementation as therequestCode
parameter.If enabling Bluetooth succeeds, your activity receives the
RESULT_OK
result code in theonActivityResult()
callback. If Bluetooth was not enableddue to an error (or the user responded 'No') then the result code isRESULT_CANCELED
.
Optionally, your application can also listen for theACTION_STATE_CHANGED
broadcast intent, whichthe system broadcasts whenever the Bluetooth state changes. This broadcast containsthe extra fields EXTRA_STATE
and EXTRA_PREVIOUS_STATE
, containing the new and oldBluetooth states, respectively. Possible values for these extra fields areSTATE_TURNING_ON
, STATE_ON
, STATE_TURNING_OFF
, and STATE_OFF
. Listening for thisbroadcast can be useful if your app needs to detect runtime changes made to the Bluetooth state.
Tip: Enabling discoverability automaticallyenables Bluetooth. If you plan to consistently enable device discoverability beforeperforming Bluetooth activity, you can skipstep 2 above. For more information, read the enabling discoverability,section on this page.
Find devices
Using the BluetoothAdapter
, you can find remote Bluetoothdevices either through device discovery or by querying the list of paireddevices.
Device discovery is a scanning procedure that searches the local area forBluetooth-enabled devices and requests some information about each one. Thisprocess is sometimes referred to as discovering, inquiring, or scanning.However, a nearby Bluetooth device responds to a discoveryrequest only if it is currently accepting information requests by beingdiscoverable. If a device isdiscoverable, it responds to the discovery request by sharing someinformation, such as the device's name, its class, and its unique MAC address. Usingthis information, the device that is performing the discovery process can then chooseto initiate a connection to the discovered device.
Once a connection is made with a remote device for the first time, a pairingrequest is automatically presented to the user. When a device ispaired, the basic information about that device—such as the device's name, class,and MAC address—is saved and can be read using the Bluetooth APIs. Using theknown MAC address for a remote device, a connection can be initiated with it atany time without performing discovery, assuming the device is still within range.
Note that there is a difference between being paired and being connected:
- To be paired means that two devices are aware of each other's existence, have ashared link-key that can be used for authentication, and are capable ofestablishing an encrypted connection with each other.
- To be connected means that the devices currently share an RFCOMM channeland are able to transmit data witheach other. The current Android Bluetooth API's require devices to be pairedbefore an RFCOMM connection can be established. Pairing is automatically performedwhen you initiate an encrypted connection with the Bluetooth APIs.
The following sections describe how to find devices that have been paired, ordiscover new devices using device discovery.
Note: Android-powered devices are notdiscoverable by default. A user can makethe device discoverable for a limited time through the system settings, or anapplication can request that the user enable discoverability without leaving theapplication. For more information, see the enable discoverabilitysection on this page.
Query paired devices
Before performing device discovery, it's worth querying the setof paired devices to see if the desired device is already known. To do so,call getBondedDevices()
. Thisreturns a set of BluetoothDevice
objects representingpaired devices. For example, you can query all paired devices andget the name and MAC address of each device, as the followingcode snippet demonstrates:
To initiate a connection with a Bluetooth device, all that's needed from theassociated BluetoothDevice
object is the MAC address,which you retrieve by calling getAddress()
. You can learn more about creating a connection in the sectionabout Connecting Devices.
Caution: Performing device discovery consumesa lot of the Bluetooth adapter's resources. After you have found a device toconnect to, be certain that you stop discovery withcancelDiscovery()
beforeattempting a connection. Also, you shouldn't perform discovery while connectedto a device because the discovery process significantly reduces the bandwidthavailable for any existing connections.
Discover devices
To start discovering devices, simply call startDiscovery()
. Theprocess is asynchronous and returns a boolean valueindicating whether discovery has successfully started. The discovery processusually involves an inquiry scan of about 12 seconds, followed by a page scan ofeach device found to retrieve its Bluetooth name.
In order to receive information about eachdevice discovered, your application must register a BroadcastReceiver for theACTION_FOUND
intent. The systembroadcasts this intent for each device. The intent contains the extra fieldsEXTRA_DEVICE
andEXTRA_CLASS
, which in turn contain aBluetoothDevice
and a BluetoothClass
, respectively.The following code snippet shows how you canregister to handle the broadcast when devices are discovered:
To initiate a connection with a Bluetooth device, all that's needed from theassociated BluetoothDevice
object is the MAC address,which you retrieve by callinggetAddress()
. You can learnmore about creating a connection in the section aboutConnecting Devices.
Caution: Performing device discovery consumesa lot of the Bluetooth adapter's resources. After you have found a device toconnect to, be certain that you stop discovery withcancelDiscovery()
beforeattempting a connection. Also, you shouldn't perform discovery while connectedto a device because the discovery process significantly reduces the bandwidthavailable for any existing connections.
Enable discoverability
If you would like to make the local device discoverable to other devices,call startActivityForResult(Intent, int)
with theACTION_REQUEST_DISCOVERABLE
intent.This issues a request to enable the system's discoverable mode without havingto navigate to the Settings app, which would stop your own app. By default, the device becomesdiscoverable for 120 seconds, or 2 minutes. You can define a different duration,up to 3600 seconds (1 hour), by adding theEXTRA_DISCOVERABLE_DURATION
extra.
Caution: If you set theEXTRA_DISCOVERABLE_DURATION
extra'svalue to 0, the device is always discoverable. This configuration is insecureand therefore highly discouraged.
The following code snippet sets the device to be discoverable for 5 minutes (300 seconds):
A dialog is displayed, requesting the user's permission to make the devicediscoverable, as shown in Figure 2. If the user responds 'Yes,' then the devicebecomes discoverable for the specified amount of time. Your activity thenreceives a call to the onActivityResult()
callback, with the result code equal to the duration that the deviceis discoverable. If the user responded 'No', or if an error occurred, the result codeis RESULT_CANCELED
.
Note: If Bluetooth has not been enabled on the device,then making the device discoverable automatically enables Bluetooth.
The device silently remains in discoverable mode for the allotted time.If you would like to be notified when the discoverable mode has changed, you canregister a BroadcastReceiver for the ACTION_SCAN_MODE_CHANGED
intent. This intent contains the extra fields EXTRA_SCAN_MODE
andEXTRA_PREVIOUS_SCAN_MODE
, which provide thenew and old scan mode, respectively. Possible values for each extra are as follows:
SCAN_MODE_CONNECTABLE_DISCOVERABLE
- The device is in discoverable mode.
SCAN_MODE_CONNECTABLE
- The device isn't in discoverable mode but can still receive connections.
SCAN_MODE_NONE
- The device isn't in discoverable mode and cannot receive connections.
If you are initiating the connection to a remote device, you don't need toenable device discoverability. Enabling discoverability is only necessary whenyou want your application to host a server socket that accepts incomingconnections, as remote devices must be able to discover other devices beforeinitiating connections to those other devices.
Connect devices
In order to create a connection between two devices, youmust implement both the server-side and client-side mechanisms because onedevice must open a server socket, and the other one must initiate the connectionusing the server device's MAC address. The server device and the client deviceeach obtain the required BluetoothSocket
in different ways. The server receives socket information when an incomingconnection is accepted. The client provides socket information when it opens anRFCOMM channel to the server.
The server and client are consideredconnected to each other when they each have a connectedBluetoothSocket
on the same RFCOMM channel. At thispoint, each device can obtain input and output streams, and data transfer canbegin, which is discussed in the section about Manage a connection. This section describes howto initiate the connection between two devices.
Connection techniques
Bluetooth For Android Tablet 4.0 Free Download
One implementation technique is to automatically prepare each device as aserver so that each device has a server socket open and listening for connections.In this case, either device can initiate a connection with the other and become theclient. Alternatively, one device can explicitly host the connection and opena server socket on demand, and the other device initiates the connection.
Note: If the two devices have not been previously paired,then the Android framework automatically shows a pairing request notification ordialog to the user during the connection procedure, as shown in Figure 3.Therefore, when your application attempts to connect devices, it doesn't need tobe concerned about whether or not the devices arepaired. Your RFCOMM connection attempt gets blocked until the user has successfully pairedthe two devices, and the attempt fails if the user rejects pairing, or if thepairing process fails or times out.
Connect as a server
When you want to connect two devices, one must act as a server by holding anopen BluetoothServerSocket
. The purpose of the serversocket is to listen for incoming connection requests andprovide a connected BluetoothSocket
after a request isaccepted. When the BluetoothSocket
is acquired from the BluetoothServerSocket
,the BluetoothServerSocket
can—and should—bediscarded, unless you want the device to accept more connections.
To set up a server socket and accept a connection, complete the followingsequence of steps:
Bluetooth For Android Tablet Free Download
- Get a
BluetoothServerSocket
by callinglistenUsingRfcommWithServiceRecord()
.The string is an identifiable name of your service, which the systemautomatically writes to a new Service Discovery Protocol (SDP) database entry onthe device. The name is arbitrary and can simply be your application name. TheUniversally Unique Identifier (UUID) is also included in the SDP entry andforms the basis for the connection agreement with the client device. That is,when the client attempts to connect with this device, it carries a UUID thatuniquely identifies the service with which it wants to connect. These UUIDsmust match in order for the connection to be accepted.
A UUID is a standardized 128-bit format for a string ID used to uniquelyidentify information. The point of a UUID is that it's big enough that you canselect any random ID and it doesn't clash with any other ID. In this case, it'sused to uniquely identify your application's Bluetooth service. To get a UUID touse with your application, you can use one of the many random UUID generators onthe web, then initialize a
UUID
withfromString(String)
. - Start listening for connection requests by calling
accept()
.This is a blocking call. It returns when either a connection has beenaccepted or an exception has occurred. A connection is accepted only when aremote device has sent a connection request containing a UUID that matches the oneregistered with this listening server socket. When successful,
accept()
returns a connectedBluetoothSocket
. - Unless you want to accept additional connections, call
close()
.This method call releases the server socket and all its resources, but doesn't close theconnected
BluetoothSocket
that's been returned byaccept()
. Unlike TCP/IP, RFCOMM allows only oneconnected client per channel at a time, so in most cases, it makes sense to callclose()
on theBluetoothServerSocket
immediately after accepting a connectedsocket.
Because the accept()
call isa blocking call, it should not be executed in the main activity UI thread sothat your application can still respond to other user interactions. It usually makessense to do all work that involves a BluetoothServerSocket
or BluetoothSocket
in a newthread managed by your application. To abort a blocked call such as accept()
, call close()
on the BluetoothServerSocket
or BluetoothSocket
from another thread. Note that all methods on a BluetoothServerSocket
or BluetoothSocket
are thread-safe.
Example
Here's a simplified thread for the server component that accepts incomingconnections:
In this example, only one incoming connection is desired, so as soon as aconnection is accepted and the BluetoothSocket
isacquired, the apppasses the acquired BluetoothSocket
to a separatethread, closes theBluetoothServerSocket
, and breaks out of the loop.
Note that when accept()
returns the BluetoothSocket
, the socket is alreadyconnected. Therefore, you shouldn't call connect()
,as you do from the client side.
The app-specific manageMyConnectedSocket()
method is designed toinitiate the thread for transferring data, which is discussed in the sectionabout Manage a Connection.
Usually, you should close your BluetoothServerSocket
as soon as you are done listening for incoming connections. In this example, close()
is called as soonas the BluetoothSocket
is acquired. You may also wantto provide a public method in your thread that can close the private BluetoothSocket
in the event that you need to stop listening on thatserver socket.
Connect as a client
In order to initiate a connection with a remote device that is acceptingconnections on an open server socket, you must first obtain aBluetoothDevice
object that represents the remote device.To learn how to create a BluetoothDevice
, see Finding Devices. You must then use theBluetoothDevice
to acquire a BluetoothSocket
and initiate the connection.
The basic procedure is as follows:
- Using the
BluetoothDevice
, get aBluetoothSocket
by callingcreateRfcommSocketToServiceRecord(UUID)
.This method initializes a
BluetoothSocket
object thatallows the client to connect to aBluetoothDevice
. The UUID passed heremust match the UUID used by the server device when it calledlistenUsingRfcommWithServiceRecord(String, UUID)
to open itsBluetoothServerSocket
. To use a matching UUID, hard-code the UUIDstring into your application, and then reference it from both the server and clientcode. - Initiate the connection by calling
connect()
. Note that this method is a blocking call.After a client calls this method, the system performs an SDP lookup to findthe remote device with the matching UUID. If the lookup is successful and the remote deviceaccepts the connection, it shares the RFCOMM channel to use during theconnection, and the
connect()
method returns.If the connection fails, or if theconnect()
method times out (after about12 seconds), then the method throws anIOException
.Because
connect()
is a blocking call,you should always perform this connection procedure in a thread that is separate from themain activity (UI) thread.Note: You should always call
cancelDiscovery()
toensure that the device isn't performing device discovery before you callconnect()
. If discovery is in progress, thenthe connection attempt is significantly slowed, and it's more likely to fail.
Example
Here is a basic example of a client thread that initiates a Bluetoothconnection:
Notice that, in this snippet,cancelDiscovery()
is called beforethe connection attempt occurs. You should always callcancelDiscovery()
beforeconnect()
, especially becausecancelDiscovery()
succeeds regardless of whether device discoveryis currently in progress. If your app needs to determine whether devicediscovery is in progress, however, you can check usingisDiscovering()
.
The app-specific manageMyConnectedSocket()
method is designed toinitiate the thread for transferring data, which is discussed in the sectionabout Managing a Connection.
When you're done with your BluetoothSocket
, alwayscall close()
. Doing soimmediately closes the connected socket and release all related internalresources.
Manage a connection
After you have successfully connected multiple devices, each one has aconnected BluetoothSocket
. This is where the funbegins because you can share information between devices. Using theBluetoothSocket
, the general procedure to transferdata is as follows:
- Get the
InputStream
andOutputStream
thathandle transmissions through the socket usinggetInputStream()
andgetOutputStream()
, respectively. - Read and write data to the streams using
read(byte[])
andwrite(byte[])
.
There are, of course, implementation details to consider. In particular,you should use a dedicated thread for reading from the stream and writing to it. This isimportant because both the read(byte[])
andwrite(byte[])
methods are blocking calls. Theread(byte[])
method blocks until there is something to readfrom the stream. The write(byte[])
method doesn't usuallyblock, but it can block for flow control if the remote device isn't callingread(byte[])
quickly enough and the intermediate buffers become full as a result.So, your main loop in the thread should be dedicated to reading from theInputStream
. A separate public method in the thread can be used to initiatewrites to the OutputStream
.
Example
Here's an example of how you can transfer data between two devices connectedover Bluetooth:
After the constructor acquires the necessary streams, the thread waits fordata to come through the InputStream
. When read(byte[])
returns withdata from the stream, the data is sent to the main activity using a memberHandler
from the parent class. The thread then waits for morebytes to be read from the InputStream
.
Sending outgoing data is as simple as calling the thread'swrite()
method from the main activity and passing in the bytes tobe sent. This method calls write(byte[])
to sendthe data to the remote device. If an IOException
is thrown whencalling write(byte[])
, the thread sends a toast tothe main activity, explaining to the user that the device couldn't send thegiven bytes to the other (connected) device.
The thread's cancel()
method allows the connection to beterminated at any time by closing the BluetoothSocket
.This method should always be called when you're done using the Bluetoothconnection.
For a demonstration of using the Bluetooth APIs, see the Bluetooth Chat sample app.
Bluetooth Software For Android Tablet Free Download
Key classes and interfaces
Bluetooth Application For Android Tablet Free Download For Windows 10
All of the Bluetooth APIs are available in the android.bluetooth
package. Here's a summary of the classes and interfaces you need to create Bluetoothconnections:
Bluetooth App Download
BluetoothAdapter
- Represents the local Bluetooth adapter (Bluetooth radio). The
BluetoothAdapter
is the entry-point for all Bluetoothinteraction. Using this,you can discover other Bluetooth devices, query a list of bonded (paired)devices, instantiate aBluetoothDevice
using a knownMAC address, and create aBluetoothServerSocket
tolisten for communicationsfrom other devices. BluetoothDevice
- Represents a remote Bluetooth device. Use this to request a connectionwith a remote device through a
BluetoothSocket
orquery information about thedevice such as its name, address, class, and bonding state. BluetoothSocket
- Represents the interface for a Bluetooth socket (similar to a TCP
Socket
). This is the connection point that allowsan application to exchange data with another Bluetooth device usingInputStream
andOutputStream
. BluetoothServerSocket
- Represents an open server socket that listens for incoming requests(similar to a TCP
ServerSocket
). In order to connect twoAndroid devices, one device must open a server socket with this class. When aremote Bluetooth device makes a connection request to this device, the deviceaccepts the connection, then returns a connectedBluetoothSocket
. BluetoothClass
- Describes the general characteristics and capabilities of a Bluetoothdevice. This is a read-only set of properties that defines the device's classes andservices. Although this information provides a useful hint regarding a device'stype, the attributes of this class don't necessarily describe all Bluetoothprofiles and services that the device supports.
BluetoothProfile
- An interface thatrepresents a Bluetooth profile. A Bluetooth profile is a wirelessinterface specification for Bluetooth-based communication between devices. Anexample is the Hands-Free profile. For more discussion of profiles, see Working with Profiles.
BluetoothHeadset
- Provides support forBluetooth headsets to be used with mobile phones. This includes both the BluetoothHeadset profile and the Hands-Free (v1.5) profile.
BluetoothA2dp
- Defines how high-qualityaudio can be streamed from one device to another over a Bluetooth connectionusing the Advanced Audio Distribution Profile (A2DP).
BluetoothHealth
- Represents a Health Device Profile proxy that controls the Bluetooth service.
BluetoothHealthCallback
- An abstract class that you use to implement
BluetoothHealth
callbacks. You must extend this class andimplement the callback methods to receive updates about changes in theapplication’s registration state and Bluetooth channel state. BluetoothHealthAppConfiguration
- Represents an application configuration that the Bluetooth Health third-partyapplication registers to communicate with a remote Bluetooth healthdevice.
BluetoothProfile.ServiceListener
- An interface that notifies
BluetoothProfile
interprocess communication (IPC) clients when they have been connected to ordisconnected from the internal service that runs a particular profile.