Discover android bluetooth serial communication, include the articles, news, trends, analysis and practical advice about android bluetooth serial communication on alibabacloud.com
Bluetooth technology in the smart hardware has a lot to play, today I will share with you the Bluetooth in the Android system of the use of techniques, and to achieve the two data transmission between terminals.
Bluetooth is a short-range wireless communication technology s
Keywords: bluedroid initnative enablenative btif_task btu_taskbt_hc_work_thread set_power preload GKIxubin341719 (Welcome reprint.) Please specify the author, please respect the copyright. Thank you. )Welcome to correct mistakes, common learning, common progress!!first, the Bluetooth open process overview, for example, as seen in: init, enableSame as the normal function call. Android upper layer via App-->n
Keywords: bluedroid initnative enablenative btif_task btu_taskbt_hc_work_thread set_power preload GKIxubin341719 (Welcome reprint, please specify the author, please respect copyright, thank you!) )Welcome to correct mistakes, common learning, common progress!!first, the Bluetooth open process overview, as shown in: Init, enableAnd the general function calls the same, Android upper layer through App-->native
This example for everyone to share the C # implementation of PC Bluetooth communication code, for your reference, the specific content as follows
Add Reference InTheHand.Net.Personal.dll
First create a Bluetooth class
Class Lanya {public
string Bluename {get; set;} l Bluetooth name public
blu
, Bluelastseen = Item. Lastseen, bluelastused = Item. lastused});//Add the search Bluetooth to the collection8}Pairing of Bluetooth1 New bluetoothclient (); 2 Guid mGUID1 = bluetoothservice.handsfree; // UUID for Bluetooth service 3 4 Blueclient. Connect (s.blueaddress, Mguid) // start pairing Bluetooth 4.0 does not require SetpinClient1bluetoothclie
and then perform the matching on your own. Of course, you can determine whether the device type is handset, ftp, or another device type based on Mac, of course, standard GPS uses serial ports for communication.}}} Catch (Exception e ){System. out. println (e. getMessage ());}}
After opening the communication, you can import the following classes.
[Java]Import or
Bluetooth communication on the PC (C #),
Add reference InTheHand. Net. Personal. dll
First create a Bluetooth class
1 class LanYa {2 public string blueName {get; set;} // l Bluetooth name 3 public incluthaddress blueAddress {get; set ;} // The unique identifier of Bluetooth
One: Introduction to Bluetooth Kits
The Android platform provides a Android.bluetooth package that implements the Bluetooth API for communication between Bluetooth devices. There are a total of 8 classes, and the four commonly used classes are as follows:
Bluetoothadapter
method means that if Bluetooth is also affected by the flight mode, the changes in the flight mode will also enable the Bluetooth service to receive the corresponding broadcast.The switch on the interface is the BluetoothEnabler. java class, while setmediathenabled () is the specific switch action. There is a switch callback function. The Code is as follows:Public void onCheckedChanged (CompoundButton butt
In Android, several commonly used Bluetooth profiles are: spp (Serial Port profile), a2dp (Advanced Audio distribution profile), and avrcp (audio/video remote control profile), hid (Human Interface Device profile), HFP (hands-free profile ). Among them, media is highly correlated with a2dp and avrcp, which is often used for data communication.Concept of
Bluetooth operations for Android DevelopmentBluetooth operation1. What is Bluetooth?1. A wireless communication protocol widely used by Bluetooth2. Mainly for short-range communication (10 m)3. It is often used in mobile communication
This article translated from: http://developer.android.com/guide/topics/connectivity/bluetooth.html#Permissions
The Android platform includes support for the Bluetooth network protocol stack, which allows a bluetooth device to exchange wireless data with other Bluetooth devices. Applications use the
Introduction to android Bluetooth Low-energy (LBE) Technology
Bluetooth Low-energy (BLE) technology is a low-cost, short-distance, and interoperable Robust Wireless Technology that works in a licensed 2.4 GHz ism rf band. It was designed as an ultra-low power (ULP) wireless technology from the very beginning. It uses many smart means to minimize power consumption
proposition:Android refers to devices that are installed on Android systems of version 4.3 and above4.0 Bluetooth refers to the Bluetooth chip using the 4.0 protocol deviceOne of the standard uses of this development is to communicate with 4.0 Bluetooth wearable devices with more than 4.3
(SERVERSOCKETNAME,UUID);Serversocket.accept ();2) Client:Remember when we just got bluetoothdevice in Broadcastreceiver?Bluetoothsocket Cliensocket=dcvice. Createrfcommsockettoservicerecord (UUID);Cliensocket.connect ();5, data transmission, through the above operation, has been established bluetoothsocket connected, data transmission is nothing more than the form of flow1) Get the streamInputStream = Socket.getinputstream ();OutputStream = Socket.getoutputstream ();2) write, read inThis is the
Serial communication is a low level point-to-point technique for transmitting data between two devices (typically a relatively close distance). SERIES60 supports serial communication on infrared and Bluetooth. The center of the SERIES60 implementation is the
In the previous article to introduce the Android Bluetooth Bluetooth technology experience related content, interested friends can click to learn more details.
One: The communication between Bluetooth devices mainly includes four steps
Setting up a
1. What is Bluetooth?
Bluetooth is one of the most widely used wireless communication protocols;Communication is mainly set for short distances; 5 to 10 metersConnect headphones, mouse, and mobile communication devices;
Bluetooth
device collection that gets the return value through Bluetoothadapter.getbondeddevices () to get the device.Method1) Createrfcommsockettoservicerecord (uuiduuid) creates and returns a bluetoothsocket based on the UUIDThis approach is also the purpose of our acquisition of Bluetoothdevice-creating Bluetoothsocket2) getaddress () with Bluetoothadapter3) GetName () with Bluetoothadapter3.BluetoothserversocketDescribeA Bluetooth listening port. The
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.