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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T11:38:34+00:00 2026-06-08T11:38:34+00:00

I try to open a socket for listening for incomming connection from a non-android

  • 0

I try to open a socket for listening for incomming connection from a non-android device.

 Parcelable[] uuidExtra = device.getUuids(); 
 String t = uuidExtra[0].toString(); 
 t = t.toUpperCase();
 Log.i("UUID: ", t);

This codesnippet will give me the UUID of the service provided by my bluetooth device. The output from LogCat is:

00001105-0000-1000-8000-00805F9B34FB

Which I believe is the UUID of Obex Object push profile. I assume this because the manufacture of the device told me that the device only supports on protocol: Obex Push Profile.

When I try to access for instance the second element in my Parcelable[] array, the output will only be

07-12 13:29:36.305: E/AndroidRuntime(6293): java.lang.ArrayIndexOutOfBoundsException: length=1; index=1

By that I can say for sure that my array only contains one object.

So over to more android specific bluetooth stuff.

I’am using this UUID this way:

 try {
       tmp = adapter.listenUsingRfcommWithServiceRecord(device.getName(), UUID.fromString(t));
      } catch (IOException e) {
           Log.e(TAG, "FAILED BECAUSE: " + e.getMessage()); } 

The exception outputs the following to LogCat:

FAILED BECAUSE: Not able to register SDP record for: "name of the device" 

After a couple of hours googling this exception I still can’t figure out how I can open a listening socket for my device.

Any suggestions? Thanks in advance!

  • 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-08T11:38:35+00:00Added an answer on June 8, 2026 at 11:38 am

    So if anybody is curious about this, or facing the same issue as I did, here is the solution:

    The error: Not able to register SDP record for: "name of the device" will be thrown because you are trying to create a service with a a UUID that is already taken. In this case, I tried to register my own service, with the same UUID as the Obex Object Push

    What I had to do, is to register my own service, with a custom UUID, for instance

    d1b180c0-d7bc-11e1-9b23-0800200c9a66
    

    This UUID is generated from this webpage. As for now you have created a new listening socket:

         try {
            tmp = adapter.listenUsingInsecureRfcommWithServiceRecord("My Profile",   UUID.fromString("d1b180c0-d7bc-11e1-9b23-0800200c9a66"));
            } catch (IOException e) {
               Log.e("FAILED BECAUSE:", e.getMessage()); 
            } 
            mmServerSocket = tmp;
    

    And we are now ready to accept incomming requests, this way:

    socket = mmServerSocket.accept(); 
    

    Remeber, this is a blocking call, so for yourself and your users, please put this in a thread.

    So why the heck doesn’t my device connect to the android server?

    1. Are you sure that the remote device/client is using the same UUID as the server?

    2. if you cant specify the UUID for the remote device, please contact the manufacture maybe the are nice enough to send you a config file, which is my case.

    If there is any questions, please add a comment to this post. I will accept this as an answer since nobody had a solution to this.

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

Sidebar

Related Questions

I am trying to open a Socket on Android but everytime I try I
I used python's socket module and tried to open a listening socket using import
I try open and play .wav files with NAudio lib. private OpenFileDialog openFileDialog =
I try to open a finder window which works fine but every time I
when I try to open a file for reading in my console application i
When I try to open a file in write mode with the following code:
When I try to open the following video: http://streaming1.hss-win.rpi.edu/ondemand/cogsci/issues_in_cs/issues_in_cogsci_02_04_2009.asf I can get it but
When I try to open a project's CodeAnalysis page I get the error An
Whenever I try to open a file with ifstream, it compiles fine, but will
Whenever I try to open .pyc or .pyo files, I always get an error

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.