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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T19:56:00+00:00 2026-05-31T19:56:00+00:00

Im using Bluetooth to transfer image from Android camera.callback to PC. on windows side

  • 0

Im using Bluetooth to transfer image from Android camera.callback to PC. on windows side i use DataInputStream to read the incoming data. the problem is that the PC side cannot detect the end of first image and second image. hence i cannot reconstruct the image.

the error of DataoutputStream is in following code

    public void create_file() {
    synchronized (frames) {
        if (frames.size() > 0) {
            Log.i("dhiraj", "" + frames.size());
            YuvImage image = new YuvImage(frames.remove(0),
                    ImageFormat.NV21, size.width, size.height, null);

            try {
                out = new DataOutputStream(client.getOutputStream());
            } catch (IOException e1) {
                Log.i("dhiraj", "new outstream error");
                e1.printStackTrace();
            }
            Log.i("dhiraj", "new outstream");
            image.compressToJpeg(rectangle, 90, baos);
            Log.i("dhiraj", "compressed");
            try {                   
                out.write(baos.toByteArray());
                Log.i("dhiraj", "" + baos.size());
                Log.i("dhiraj", "output");
            } catch (IOException e) {
                Log.i("dhiraj", "IO");
                e.printStackTrace();
            }

            try {
                out.close();
            } catch (IOException e) {
                Log.i("dhiraj", "new outstream close error");
                e.printStackTrace();
            }
        }
    }
}
  • 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-31T19:56:02+00:00Added an answer on May 31, 2026 at 7:56 pm

    Would it be possible to send the size before each image? So you can just read for n bytes.
    Perhaps write the size to a file.

    Pseudo:

    for (each image)
        write (size of image) to size.txt on Android
        transfer size.txt to PC
        read the (size of image) from size.txt 
        read for (size of image) from bluetooth
    end for
    

    Another option is to append a very unique sequence of characters to the end of each image, and strip it off after reception.
    If this isn’t unique enough you run the chance of finding that sequence somewhere in the image and chopping an image in pieces.

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

Sidebar

Related Questions

I am trying to read data from a bluetooth barcode scanner (KDC300) using C.
I want to write application on android and windows which will use bluetooth. In
May i achieve that server side application (using android bluetooth API)connect to particular client
How would I go about using bluetooth to transfer a core data entity with
I am using a Bluetooth device to connect with the android Phone manually there
Using Bluetooth I wish to communicate between a Windows PC and a mobile phone.
I want to develop application that sends image/txt or any file from one android
I am developing an android game application played using bluetooth. While searching for bluetooth
How do I exchange data programmatically via Bluetooth using the iPhone SDK?
I’m trying to develop an Android application for a medical device using Bluetooth (SPP).

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.