Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5954081
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T17:55:10+00:00 2026-05-22T17:55:10+00:00

I’m writing a Bluetooth app targeting API 7 (my device is API 8 –

  • 0

I’m writing a Bluetooth app targeting API 7 (my device is API 8 – 2.2). When I attempt to connect the Bluetooth socket I get the pop-up prompting the user to pair with the device, but sometimes the connection times out or fails. In these cases, the pop-up disappears without clicking anything but the device shows as “Paired but not connected” in the Bluetooth settings.

If I connect to the Bluetooth device directly from the Bluetooth settings then this doesn’t happen; the device only shows “Paired but not connected” if the user actually clicks “Pair”.

Here’s the code that’s creating the connection, it seems simple enough:

    try {
        BluetoothDevice btDevice = _btAdapter.getRemoteDevice(address);
        _btAdapter.cancelDiscovery();
        sock = btDevice.createRfcommSocketToServiceRecord(SafConstants.BT_UUID);
        sock.connect();
    } catch (IOException e) {
        logger.error("socket connection failed", e);
        if (sock != null) {
            try {sock.close();}
            catch (IOException e1) {}
        }
    }

Is this an Android issue or am I supposed to be doing something else? I searched the API to see if I could remove the device from the set of bonded devices (if the connection fails) but it seems this isn’t possible.

EDIT: One thing I notice is that when I try connecting through my app, I get prompted on my laptop that it’s trying to access the Headset service before pairing. After a few seconds I’ll eventually get the prompt on my laptop that a device is trying to pair.

If I connect through bluetooth settings then I get the prompt to pair the device first and then after it’s successful I get the prompt that a device is attempting to access the Headset service. I’m not sure if that’s significant or not…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T17:55:10+00:00Added an answer on May 22, 2026 at 5:55 pm

    The UUID you are using is for SPP (Serial Port Profile), and being a headset, would require the Bluetooth profile – A2DP (Advanced Audio Distribution ).
    Currently, the Android implementation of the Bluetooth stack, does not have support for Bluetooth profiles and is only a bare bones implementation.

    For Bluetooth profile support to be implemented on Android, there is a project called “Sybase-iAnywhere-Blue-SDK-for-Android”, which replaces Android’s version, and provides all interfaces into the underlying Bluetooth profiles and protocols. Using this, printing over bluetooth using your Android phone will be possible using the BPP profile provided by this SDK.

    See links below for more details:

    link 1:
    http://www.sybase.com/detail?id=1064424

    Link 2:
    http://www.sybase.com/products/allproductsa-z/mobiledevicesdks/bluetoothsdks

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am writing an app with both english and french support. The app requests
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
I need to clean up various Word 'smart' characters in user input, including but
I am using Paperclip to handle profile photo uploads in my app. They upload
I'm making a simple page using Google Maps API 3. My first. One marker
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.