delphi xe5 android 控制蓝牙
本文部分内容摘自:http://www.pclviewer.com/android/
用以下代码中的接口实现控制蓝牙的开、关及详细信息
unit Androidapi.JNI.BluetoothAdapter;
// (c) RedTitan Technology 2013
// JNI BLUETOOTH import demo
// Note - REQUIRES - PROJECT OPTIONS - USES PERMISSIONS - BLUETOOTH
interface
uses
Androidapi.JNIBridge,
Androidapi.JNI.JavaTypes, Classes;
type
///////////////////////////
BluetoothDevice //////////////////////////////////
JBluetoothDevice = interface;
JBluetoothDeviceClass = interface(JObjectClass)
['{FB8F9E83-CF98-4737-B7B0-64EFB07EBE2A}']
end;
[JavaSignature('android/bluetooth/BluetoothDevice')]
JBluetoothDevice = interface(JObject)
['{F2560E3D-D26E-4DD8-B384-43070B02FF04}']
function getName:JString; cdecl;
function getAddress:JString; cdecl;
end;
TJBluetoothDevice = class(TJavaGenericImport<JBluetoothDeviceClass,
JBluetoothDevice>) end;
///////////////////////////
BluetoothAdapter /////////////////////////////////
JBluetoothAdapter = interface;
JBluetoothAdapterClass = interface(JObjectClass)
['{05CE5465-2953-4CC3-9D9B-01D71E90F412}']