패키지, 저장소 및 앱 카테고리 검색

패키지 상세v1.1.3

bluetoothadapter

**안드로이드 전용**으로 블루투스 어댑터 기능을 노출하는 플러터 플러그인입니다.

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.

사용 사례

  • 프로그래밍적으로 블루투스 활성화/비활성화
  • 블루투스 어댑터 상태 확인
  • 안드로이드 전용 앱에 블루투스 기능 통합하기
  • 사물인터넷 장치 연결 솔루션 개발
  • 블루투스 기반 근접 감지 시스템 구축

주요 기능

  • 안드로이드 전용 호환성
  • 블루투스 어댑터 제어를 위한 간단한 API
  • 블루투스 활성화 및 비활성화를 지원합니다
  • 어댑터 정보 및 상태를 제공합니다
  • 경량이며 통합이 쉬움

적합한 대상

  • 안드로이드 중심 모바일 앱 개발자
  • IoT 애플리케이션 제작자
  • 블루투스 기능을 갖춘 장치 통합업체
  • 직접 블루투스 관리를 필요로 하는 앱
  • iOS 지원이 없는 프로젝트

고려 사항

  • iOS 플랫폼과 호환되지 않습니다
  • Android 블루투스 어댑터 기능에 한정
  • 안드로이드 전용 권한 필요
  • 고급 블루투스 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);

카테고리

소스 저장소

이 패키지를 사용하는 프로젝트

아직 데이터가 없습니다.