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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T00:51:30+00:00 2026-05-25T00:51:30+00:00

I am writing an android app that recieves data over bluetooth. The bytes comming

  • 0

I am writing an android app that recieves data over bluetooth. The bytes comming in can be of any size example: 00023>024935928598235>9284>

As you can see each set is seperated by “>”. The data comes in extremely fast. I would like some ideas for an implementation. See my problem is that I need to read the data into a byte array that can and then convert it to a string and split them according to the delimeter of “>”.

so in the above example:

00023
024935928598235
9284

If i set byte[] data = new byte[8] then when reading the incomming data it might get 00023>02 which is not what i want. I’m not sure how to implement something like this. Any ideas?

  • 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-25T00:51:31+00:00Added an answer on May 25, 2026 at 12:51 am

    Here’s one approach. You’ll have to implement the readDataFromBluetooth() and somehow set dataAvailable, but this should get you on the right track.

        byte[] data = new byte[1024];
        List<String> chunks = new LinkedList<String>();
        StringBuilder chunk = new StringBuilder();
    
        while (dataAvailable) {
            data = readDataFromBluetooth();
    
            for (byte b : data) {
                if (b == '<') {
                    chunks.add(chunk.toString());
                    chunk.setLength(0);
                } else {
                    chunk.append(b);
                }
            }
        }
    
        if (chunk.length() > 0)
            chunks.add(chunk.toString());
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm planning on writing an android app that can view and update data on
I'm writing an Android app that communicates with a website. Any time I hit
I'm currently writing an app in Android that works with the GPS. At the
I'm writing an Android app where users can upload video to Youtube. I'd like
I am writing an android app. I want to pass some data across the
I'm writing an Android app that contains a contact list. The design required me
I'm writing an android app that has a spinner in it for difficulty settings
I am looking into writing an Android app that has a database of approximately
I am considering writing an Android app, and I see that the SDK is
I'm writing an Android app that is parsing RSS feeds from different sources. What

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.