Android Question Detect if a device has bluetooth capabilities

Discussion in 'Android Questions' started by Arf, Mar 20, 2015.

  1. Arf

    Arf Active Member Licensed User

    I'm getting an error when my app tries to initialise a bluetooth connection on a device which does not have bluetooth, unsurprisingly.

    The program stops working on this line:
    If admin.IsEnabled = False Then
    in my Service_Start function.

    How can I detect if a device supports a bluetooth connection (preferably before calling admin.Initialise("admin")), so that I can give a warning message instead?
  2. Erel

    Erel Administrator Staff Member Licensed User

    Call Serial.Initialize and then check Serial.IsInitialized. If it is false then Bluetooth is not supported.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice