android-bluetooth-sockets

Implement Android Bluetooth socket communication over RFCOMM and L2CAP CoC transports.

Updated Jul 20, 2026
One-click install
npx skills add https://github.com/trancee/MeshLink-template --skill android-bluetooth-sockets
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: android-bluetooth-sockets
Source: https://github.com/trancee/MeshLink-template/tree/main/.agents/skills/android-bluetooth-sockets
Command: npx skills add https://github.com/trancee/MeshLink-template --skill android-bluetooth-sockets

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This skill simplifies the complex implementation of Android Bluetooth socket communication, handling the nuances of RFCOMM and BLE L2CAP CoC transports, threading requirements, and API-specific error handling.

Core Features & Use Cases

  • Unified Socket Management: Provides clear patterns for both Classic RFCOMM and modern BLE L2CAP CoC connections.
  • Robust Lifecycle Handling: Offers guidance on blocking operations, thread management, and proper resource cleanup to prevent battery drain and connection failures.
  • Use Case: Use this skill when building a peer-to-peer messaging app or a device-to-device data transfer utility that requires reliable, low-latency communication without internet infrastructure.

Quick Start

Use the android-bluetooth-sockets skill to implement a background thread for accepting incoming RFCOMM connections using a specific UUID.

Frequently Asked Questions about android-bluetooth-sockets

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement Android Bluetooth socket communication using RFCOMM and L2CAP CoC?

Android Bluetooth socket communication is implemented by establishing peer-to-peer data streaming via RFCOMM or BLE L2CAP CoC transports. This skill provides patterns for server-client connections, thread-safe socket lifecycle management, and proper SDP or PSM exchange protocols.

What causes BluetoothSocketException errors on Android API 34 and how do I handle them?

BluetoothSocketException errors on Android API 34+ occur during socket connection failures and require specific error handling codes. This skill provides guidance on handling these API-specific exceptions, managing blocking operations, and ensuring proper resource cleanup to prevent connection failures.

Does Android L2CAP CoC support peer-to-peer data streaming without internet infrastructure?

Android L2CAP CoC supports peer-to-peer data streaming without internet infrastructure by providing reliable, low-latency communication. This skill facilitates device-to-device data transfer utilities using modern BLE L2CAP CoC connections alongside traditional Classic RFCOMM.

What's the best way to manage Android Bluetooth socket threading and resource cleanup?

Managing Android Bluetooth socket threading requires background threads for blocking operations and proper resource cleanup to prevent battery drain. This skill offers robust lifecycle handling patterns, ensuring thread-safe socket management and proper disconnection protocols.

Why do I need specific Android Bluetooth permissions for insecure socket connections?

Android Bluetooth permissions are required for insecure socket connections to authorize SDP or PSM exchange protocols and device discovery. This skill enforces adherence to Android Bluetooth permissions while facilitating secure and insecure RFCOMM or L2CAP communication.