1. Are you ready for the Galaxy S20? Here is everything we know so far!

Bluetooth Client vs Server

Discussion in 'Android Development' started by Cody Molisee, Aug 2, 2021.

  1. Cody Molisee

    Cody Molisee Lurker
    Thread Starter

    Hey all, bit of a technical question. I have confusion on bluetooth connections.

    Preface: when connecting devices for android over bluetooth you can connect as server or as client

    My understand: connecting as the server essentially means that your device will be hosting the connection. Connecting as client means that you are being hosted by another device - and/or the device you are connecting to is the host.

    I am trying to build an app that can connect via bluetooth and control a device. My first use case is my TV. so I want to make my app that can connect to my TV and control it as a remote. My initial thought is that the TV would act as the server. If I am connecting to another phone then I would imagine that my device would need to be the server. In most cases, if I want my app to act as a controller to send control signals to the device it connects to - is it correct to assume that my device is client or server?

    Thanks in advance, CM.

    1. Download the Forums for Android™ app!


  2. svim

    svim Extreme Android User

    What model TV do you have? Some Smart TVs do include Bluetooth support but not all.

    Also, is your TV remote using Bluetooth or infrared to connect to your TV? If it's IR that might making a Bluetooth app that can control your TV a problem.
  3. Cody Molisee

    Cody Molisee Lurker
    Thread Starter

    I have a Roku smart TV. I actually am not sure if it connects via IR but I will check into it. I am like 85% sure it is bluetooth.

    After various attempts I think it may have something to do with the socket. Going from the developer guide the examples use RFCOMM (SPP) socket. I see in the reference library there is also L2CAP and SCO. Hopefully after I read into it more I will figure out a solution. I will post my findings back on this thread.

    Any other thoughts or suggestions is greatly appreciated.

Share This Page