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 8045933
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T05:40:24+00:00 2026-06-05T05:40:24+00:00

I have an Issue with Android 4 (ICS) My Bluetooth-App connecting to a Serial

  • 0

I have an Issue with Android 4 (ICS)
My Bluetooth-App connecting to a Serial Device works like a charm on Android 3.

However, when using Android 4, it shows the “Pairing” Dialog everytime I connect to the (already paired) device.

The user has to reenter the same pin over and over again.
Is there some way to suppress this behavoir in Android 4? Is it a new bug? Is there a work around? Does the BluetoothDevice need some kind of adaption to Android 4? What am I doing wrong?

 /**
 * Start the ConnectThread to initiate a connection to a remote bluetoothDevice.
 */
public synchronized InitResponse init() {
    if (D) Log.d(TAG, "init to: " + bluetoothDevice);

    setState(State.CONNECTING);

    try {
        if (D) Log.i(TAG, "Trying to create RfcommSocket using reflection");
        Method m = bluetoothDevice.getClass().getMethod("createRfcommSocket",
                new Class[] { int.class });
        bluetoothSocket = (BluetoothSocket)m.invoke(bluetoothDevice, 1);
    } catch (Exception e) {
        if (D) Log.w(TAG, "Reflection failed.", e);
        if (D) Log.i(TAG, "Trying to create RfcommSocket using UUID");
        try {
            bluetoothSocket = bluetoothDevice.createRfcommSocketToServiceRecord(READER_UUID);
        } catch (IOException e2) {
            Log.e(TAG, "create() failed", e2);
            disconnect();
            return InitResponse.READER_NOT_FOUND;
        }
    }

    if (D) Log.i(TAG, "Bluetooth Socket: " + bluetoothSocket);
    if (D) Log.i(TAG, "Trying to connect.");

    try {
        bluetoothAdapter.cancelDiscovery();
        if (D) Log.i(TAG, "Cancelled discovery.");
        if (D) Log.i(TAG, "Attempting to connect.");
        bluetoothSocket.connect();                   // Causes pairing dialog everytime I call it.
    } catch (IOException e) {
        if (D) Log.w(TAG, "Error while connecting.");
        // Close the socket
        try {
            bluetoothSocket.close();
        } catch (IOException e2) {
            Log.e(TAG, "unable to close() socket during connection failure", e2);
        } finally {
            disconnected();
        }
        return InitResponse.CONNECTION_ERROR;
    }

    if(D) Log.d(TAG, "Connected to bluetoothReader " + bluetoothDevice + " established.");

    try {
        inputStream = bluetoothSocket.getInputStream();
        if(D) Log.d(TAG, "Input Stream: " + inputStream);
        outputStream = bluetoothSocket.getOutputStream();
        if(D) Log.d(TAG, "Output Stream: " + outputStream);
    } catch (IOException e) {
        Log.e(TAG, "Temp sockets not created", e);
        disconnected();
        return InitResponse.CONNECTION_ERROR;
    }

    if (D) Log.i(TAG, "Setting state to CONNECTED");

    setState(State.CONNECTED);
    if (D) Log.i(TAG, "Init successfull.");
    return InitResponse.SUCCESS;
}

Thanks in advance

BTW: How can I ensure every other connection from my Tablet to this bluetoothDevice is stopped before connecting?

  • 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-06-05T05:40:25+00:00Added an answer on June 5, 2026 at 5:40 am

    I don’t think this is an issue with your software. I am seeing the same problem with RunKeeper and my Polar BT heart rate monitor after I got a phone with ICS. I have not had that problem on HTC Desire with stock ROM or CM7.

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

Sidebar

Related Questions

I have an issue when I'm using Runtime.exec with my Android device and just
i have a issue with programming for android. i have a string like this:
I have an issue that when I leave the android device idle for a
I have an issue with SSO using the Facebook SDK for Android. The problem
I have an issue related publishing the paid app to android market. (My application
I have an issue in iOS with a HTML5 Offline app. My app works
I'm getting a strange issue on Android ICS, I have the following code to
I have an issue with importing a picture from the Album in Android, because
I have a very specific SSL issue on my Android. If I try to
Hi I am new to android and I am having an issue I have

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.