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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T14:13:52+00:00 2026-05-26T14:13:52+00:00

I am writing an android app that is communicating with a webserver to get

  • 0

I am writing an android app that is communicating with a webserver to get data. I decided to use protobuf and all works like a charm.

However my problem is this, my dataset is huge and I cant get all data at once so I just get the top level and then ask for more as I go along (browse on the phone).

I used protoc to generate my java class which works just fine and i get my nice shiny object structure that is just as i want it (initial with only top levels of data).
However I made the decision to use the structure I got as my main datastructure in my app and since all lists in that app are unmodifiable i cannot at a later date expand with more data and this is causing major headache for me.

For the moment I have simply edited the autogenerated java file that protoc generated to return normal lists rather than unmodifiable, but that is pretty dumb if i later need to regenerate that file.

what to do? not use protobuf object as storage? (just seems wasteful to copy all that data to a custom object when it is already there, not to mention writing my own storage classes.)

  • 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-26T14:13:53+00:00Added an answer on May 26, 2026 at 2:13 pm

    You should never modify the generated protocol buffer classes.

    The message classes that are generated are immutable by design. To modify an object you need to use its corresponding Builder class to generate a new message from the existing one, manipulate it via its setter methods then call build() to return a modified object. For example:

    person.toBuilder()
        .setName("Jeff")
        .addPhone(phoneNumber)
        .build();
    

    See “Builders vs. Messages” in the protobuf tutorial:

    http://code.google.com/apis/protocolbuffers/docs/javatutorial.html#builders

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

Sidebar

Related Questions

I'm currently writing an app in Android that works with the GPS. At the
I'm planning on writing an android app that can view and update data on
I'm writing an Android app that I want to use in conjunction with a
I am writing a android app that will pull in a list of all
I am writing an android app that recieves data over bluetooth. The bytes comming
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

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.