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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T04:58:53+00:00 2026-06-18T04:58:53+00:00

I have followed Google’s tutorial on using Bluetooth on Android. On the server side

  • 0

I have followed Google’s tutorial on using Bluetooth on Android. On the server side which is a computer I’ve used Bluecove.

I have managed to establish the connection between the devices (they weren’t paired first and when I ran the program both of the devices asked to accept the pairing). Now I have problem with sending data over the connection. In the Managing a connection section there’s a method called write. With that function I’m not able to send anything. It doesn’t fail (no errors) but the message doesn’t reach the server.

On the server after accepting the connection (acceptAndConnect()) I have the following

DataInputStream inputStream = new DataInputStream(connection.openInputStream());

while(true) {
    String input = "";
    char c;

    while(((c = inputStream.readChar()) > 0) && (c != '\n')) {
        input += c;
    }

    System.out.println("Received: " + input);
}

It doesn’t print anything.

The code on the client side is exactly the same as in the tutorial. Where is the problem?

Edit. Actually, if I print c in the server code shown up I get something strange. I’ve tried to send hello\n. When printing c, I get 桥
汬
漊

  • 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-18T04:58:54+00:00Added an answer on June 18, 2026 at 4:58 am

    After a little bit of more googleing I found Jon Skeet’s answer and changed the DataInputStream to an InputStream wrapped in an InputStreamReader and that one in a BufferedReader. Then I can use readLine() and I get the characters right.

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

Sidebar

Related Questions

I have followed http://developer.android.com/guide/google/gcm/gs.html#server-app to implement GCM in my application GCMRegistrar.checkDevice(this); GCMRegistrar.checkManifest(this); if (GCMRegistrar.isRegistered(this))
Hi have followed this tutorial using Core plot framework http://www.switchonthecode.com/tutorials/using-core-plot-in-an-iphone-application My project compiles, but
I have followed his popular tutorial to connect Android to MySQL: http://www.helloandroid.com/tutorials/connecting-mysql-database It is
I have followed this tutorial which allowed me to create a Silverlight DataGrid that
I'm trying to access my Google spreadsheets using the GData API. I have followed
I followed Google's Map View tutorial from this link http://developer.android.com/resources/tutorials/views/hello-mapview.html I've done the first
I want to use Google Maps in my application, I have followed this tutorial
I am trying to implement this example http://www.javacodegeeks.com/2011/02/android-google-maps-tutorial.html and i have followed exactly all
I am using Eclipse helios and Android 4.1.2 i have followed the following documentation
I have followed this tutorial on Google https://developers.google.com/google-apps/marketplace/tutorial_php to create a marketplace app for

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.