Pakete, Repositories und App-Kategorien suchen

Paketdetailsv1.1.3

bluetoothadapter

Ein Flutter-Plugin, das die Funktionen des Bluetooth-Adapters für **nur Android** verfügbar macht.

30-Tage-Downloads
63
Likes
22
Pub-Punkte
40

Paket installieren

flutter pub add bluetoothadapter

Paketübersicht

Aus öffentlichen Paketdaten erstellte Orientierung.

The bluetoothadapter package is a Flutter plugin that provides access to Bluetooth adapter functionalities on Android devices. It enables developers to check Bluetooth status, enable or disable Bluetooth, and retrieve adapter information. Designed specifically for Android, it offers a straightforward API to interact with the device's Bluetooth hardware, making it ideal for apps requiring low-level Bluetooth control. The plugin does not support iOS, limiting its use to Android-only applications. It integrates seamlessly with Flutter projects via pub.dev.

Anwendungsfälle

  • Bluetooth programmatisch aktivieren/deaktivieren
  • Bluetooth-Adapter-Status überprüfen
  • Bluetooth-Funktionen in Android-only-Apps integrieren
  • Entwicklung von IoT-Geräteverbindungs-Lösungen
  • Erstellung von Bluetooth-basierten Nahbereichserkennungssystemen

Hauptmerkmale

  • Nur für Android kompatibel
  • Einfache API für die Steuerung des Bluetooth-Adapters
  • Unterstützt das Aktivieren und Deaktivieren von Bluetooth
  • Gibt Adapterinformationen und Status an
  • Leicht und einfach zu integrieren

Geeignet für

  • Android-fokussierte Entwickler mobiler Apps
  • Ersteller von IoT-Anwendungen
  • Bluetooth-fähige Geräteintegratoren
  • Apps, die eine direkte Bluetooth-Verwaltung erfordern
  • Projekte ohne iOS-Unterstützung

Hinweise

  • Nicht kompatibel mit iOS-Plattformen
  • Beschränkt auf Android-Bluetooth-Adapter-Funktionen
  • Erfordert Android-spezifische Berechtigungen
  • Keine Unterstützung für erweiterte Bluetooth LE-Operationen
  • Abhängig von den Implementierungen des Geräteherstellers

Original-README

Originaler README-Schnappschuss aus dem verknüpften Quell-Repository. Aktuelle Inhalte finden Sie im Repository.

bluetoothadapter

A Flutter plugin to expose the features of Bluetooth Adapter for Android only.

Objective

The primary purpose of this project was to communicate between flutter and Rasburry Pie using Bluetooth.

Main Features

  • Setting up a UUID from user end.
  • Checking Bluetooth connection status and giving alerts if its off or not right.
  • Getting list of paired devices.
  • Get a particular paired device info.
  • Start Bluetooth server.
  • Start Bluetooth client.
  • Start Bluetooth client.
  • Send message to a connected device.
  • Stream for listening to received messages.
  • Stream for listening to connection status (CONNECTED, CONNECTING, CONNECTION FAILED, LISTENING, DISCONNECTED).
Getting Started

For a full example please check /example folder. Here are only the most important parts of the code to illustrate how to use the library.

//Initiatinng the bluetooth adapter
Bluetoothadapter flutterbluetoothadapter = Bluetoothadapter();

//Listening to the connection status listener
String _connectionStatus = "NONE";
StreamSubscription _btConnectionStatusListener =flutterbluetoothadapter.connectionStatus().listen((dynamic status) {
  setState(() {
    _connectionStatus = status.toString();
  });
});

//Listening to the recieved messages
String _recievedMessage;
StreamSubscription _btReceivedMessageListener = flutterbluetoothadapter.receiveMessages().listen((dynamic newMessage) {
  setState(() {
    _recievedMessage = newMessage.toString();
  });
});
Getting paired devices
List<BtDevice> devices = await flutterbluetoothadapter.getDevices();
Getting paired device
await flutterbluetoothadapter.getDevice(deviceAddress);
Starting BT server
await flutterbluetoothadapter.startServer();
Starting BT client
flutterbluetoothadapter.startClient(devices.indexOf(element), true);
Sending message
flutterbluetoothadapter.sendMessage(messageString);
Check BT connection
await flutterbluetoothadapter.checkBluetooth(); //returns bool
Set UUID
flutterbluetoothadapter.initBlutoothConnection(uuid);

Kategorien

Quell-Repository

Projekte, die dieses Paket verwenden

Noch keine Daten verfügbar.