パッケージ、リポジトリ、アプリカテゴリを検索

パッケージ詳細v1.1.3

bluetoothadapter

Flutterプラグインで、**Android専用**のBluetoothアダプター機能を公開します。

30日間ダウンロード
63
いいね数
22
Pub ポイント
40

パッケージをインストール

flutter pub add bluetoothadapter

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

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.

用途

  • プログラムでBluetoothを有効化/無効化する
  • Bluetoothアダプタの状態を確認しています
  • Android専用アプリにBluetooth機能を統合する
  • IoTデバイス接続ソリューションの開発
  • Bluetoothを活用した近接検出システムの構築

主な機能

  • Android専用の互換性
  • Bluetoothアダプタ制御のためのシンプルなAPI
  • Bluetoothの有効化と無効化をサポートしています
  • アダプタ情報およびステータスを提供します
  • 軽量で統合が簡単

適している対象

  • Androidに特化したモバイルアプリ開発者
  • IoTアプリケーション作成者
  • Bluetooth対応デバイスの統合業者
  • 直接的なBluetooth管理を必要とするアプリ
  • iOS 対応なしのプロジェクト

注意事項

  • iOS プラットフォームと互換性がありません
  • Android Bluetoothアダプタ機能に限定
  • Android 固有の権限が必要です
  • 高度なBluetooth LE操作のサポートなし
  • デバイスメーカーの実装に依存する

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

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);

カテゴリー

ソースリポジトリ

このパッケージを使用しているプロジェクト

データはまだありません。