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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T05:08:18+00:00 2026-05-26T05:08:18+00:00

This is odd. I am trying to set up Bluetooth SPP on a Droid

  • 0

This is odd. I am trying to set up Bluetooth SPP on a Droid X Android 2.3.4. I have included a few different methods from attempting to open an rfcomm Socket, one being reflection (needed for support of certain phones)

However, with the Droid X a strange thing happens. When I connect the first time to a Bluetooth device my app opens up and attempts SPP by first:

Method m = mmDevice.getClass().getMethod("createRfcommSocket", new Class[] {int.class});
mmSocket = (BluetoothSocket) m.invoke(mmDevice, Integer.valueOf(1));

And if it can’t find the method, it tries the normal

mmSocket = mmDevice.createRfcommSocketToServiceRecord(SerialPortServiceClass_UUID);

This works correctly the first time through. But if I close my program then reopen it for some reason the reflection method then actually finds the method, attempts to connect doesn’t have any errors, but it doesn’t actually connect.

If I close the app, power cycle the bluetooth adapter on the phone and try again it will work correctly.

I am at a loss on what’s going on, so any help would be greatly appreciated.

  • 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-26T05:08:19+00:00Added an answer on May 26, 2026 at 5:08 am

    Well I came up with a bandaid type fix that I am not happy with, but will work until I can find the root cause or better solution. I simply make a shared preference object that contains a “level” of which methods to try.

    The levels are labeled 1-4, and if the level is set to a number <= to the current level it will try that method if no connection has been established.

    if(level<=1){
    success set level = 1
    fail set level = 0
    }
    
    if(level<=2){
    success set level = 2
    fail set level = 0
    }
    
    ...
    
    
    if(level<=4){
    success set level = 4
    fail set level = 0
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The title may sound odd, but im kind of trying to set up this
This might be a little bit odd question, but Im trying to figure out
I have been banging my head against the wall with this odd behaviour on
This is an odd thing I've just run into. I have a web application
I am trying to set up caching correctly and have set Expires headers to
This is an odd problem, so I have to provide a bit of background.
This is a bit of an odd one. I'm trying to stub a method
I'm trying to set a CSS style using .live(). The CSS function: $(.data tr:odd).addClass(evenrows);
This is a very odd, and quite specific question. Ultimately I am trying to
slightly odd scenario. I have RequiresQuestionAndAnswer set to false because the admin needs to

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.