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

  • Home
  • SEARCH
  • 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 8931195
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T09:03:38+00:00 2026-06-15T09:03:38+00:00

So im working around with bluetooth and trying to figure out how to send

  • 0

So im working around with bluetooth and trying to figure out how to send two strings via a bluetooth connection. From one android device to another.

I found this guide http://developer.android.com/guide/topics/connectivity/bluetooth.html
but it talks alot about setting up the connection. So i went straight down to the chapter about Managing a Connection. The reason i do this is that in the apps i create i plan to setup the bluetooth connection before opening the apps (via the phones usual bluetooth setup) and then open the apps and send when it is necessary.

So my question is how do i find the bluetooth socket that should be setup? Since that should be what im searching for to create the sending and recieving threads?

Hope this is enough information, else tell what more you need and ill try and answer to the best of my ability.

Best Regards Drakthal

  • 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-15T09:03:39+00:00Added an answer on June 15, 2026 at 9:03 am

    The usual bluetooth setup only pairs between devices, it doesn’t create a data connection between them (And even if it would, you wouldn’t be able to access this Socket object because it’s not created in your process).

    After Bluetooth is turned on, you can call BluetoothAdapter.getBondedDevices() to get a set of the paired devices. You can then iterate over them, and initiate a connection to the one you want. You can’t avoid the connection creation 🙁 If you want a simplified example, you can look here (An answer I posted a while ago, regarding the whole pairing/connecting/sending/receiving subject with bluetooth).

    Once you acquired an open connection, sending the 2 string is easy.

    String s1 = "A", s2 = "B";
    byte[] buf1 = s1.getBytes(), buf2 = s2.getBytes();
    OutputStream os = connection.getOutputStream();
    os.write(buf1);
    os.write(buf2);
    os.flush();
    connection.close();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been working around one small project which needs a similar GUI as
My app is receiving data from a BlueTooth device 4 times a second, parsing
I am Working around MySQL error Deadlock found when trying to get lock; try
hi i'm trying to upload a image from an iframe and is working, but
I have been playing around with the bluetooth API for Android 2.2 (API level
I'm using Pdo_Mssql adapter against a Sybase database and working around issues encountered. One
I just have learnt how cool RSpec and Cabybara is, and now working around
I'm working my way around the SOS commands and their output, but I noticed
I've been checking around for working with VS IDE instaed of Mono's, I understood
I am working on having some shapes floating around the screen at random. Eventually

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.