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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T14:23:01+00:00 2026-06-06T14:23:01+00:00

I don’t understand: In android, I dont get the full string returned I entered

  • 0

I don’t understand: In android, I dont get the full string returned I entered into the stringbody. I have checked that the string is fully saved but when it passes to the stringbody it just breaks. In a desktop version of the same application, the results are sucessful. But in Android, a random part in the end of the string is lost. If i try to save the resulted string after it is lost, the string saves in the same spot. I dont use any accents or special chars.
Example that from a test:

First write:

This is a test bio with a random message that i’m writting on the go.
If this gets cut like i am expecting something is going to be left
out. Lets see what is going to happen.

One save saves this:

This is a test bio with a random message that i’m writting on the go.
If this gets cut like i am expecting something is going to be left out

Second save:

This is a test bio with a random message that i’m writting on the go.
If this gets cut like i am

The code is

protected void gravarPerfil() throws UnsupportedEncodingException {

    MultipartEntity entity = new MultipartEntity();
    StringBody sAcerca = null, sLoc = null;

    DefaultHttpClient client = new DefaultHttpClient();
    if (cookie != null) {
        client.getCookieStore().addCookie(cookie);
    }

    HttpPost post = new HttpPost(address + "/dinamicas/editarPerfil");

    FileBody imagebin = null;

    if (imgfile != null) {
        imagebin = new FileBody(imgfile);
    }

    Log.v("msg", acerca.getText().toString());

Here is the part where my filebody doesnt load the whole string

    sAcerca = new StringBody(acerca.getText().toString());
    sLoc = new StringBody(local.getText().toString());


    try {

        entity.addPart("acerca", sAcerca);
        entity.addPart("localizacao", sLoc);
        if (imgfile != null) {
            entity.addPart("foto", imagebin);
        }

        post.setEntity(entity);

        HttpResponse response = client.execute(post);


    } catch (Exception e) {
        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-06-06T14:23:03+00:00Added an answer on June 6, 2026 at 2:23 pm

    Didn’t got any reasonable solution, so I applied a walk around. I discovered that the end that is removed is always between 5 – 13 chars… So I am adding 15 # to the end of the string, being then removed in the server side. It’s not pretty, but it works.

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

Sidebar

Related Questions

Don't have much to say, just can get into the event handler. XAML: <Grid>
Don't think that I'm mad, I understand how php works! That being said. I
DON'T ASK WHY but... I have a regex that needs to be case insensitive
Don't yell at me! i have seen many threads claiming that HTML cannot be
Don't ask me why but I need to do the following: string ClassName =
Don't know how to explain it better but i'm trying to get a response
I've got a string that has curly quotes in it. I'd like to replace
Don't they both have to convert to machine code at some point to execute
Don't overthink this - there's a very commonly used term and I ... have
Don't think my virtualhost is working correctly. This is what I have inside of

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.