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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T23:13:10+00:00 2026-05-27T23:13:10+00:00

I need to get large amount of data (say 7000 records) from online database

  • 0

I need to get large amount of data (say 7000 records) from online database to Android application. While searching the web, I came to know that large amount of data will leads to outofmemory problem in json while convert from string. The solution was to convert the json with the help of gson or jackson. I have two question as follows

  1. Another solution for converting json to avoid out of memory problem.

  2. Shall I get the data in xml format? If so whether I can solve out of memory?

Edit

    String  result = convertStreamToString(is);

  JSONObject jObject = new JSONObject(result); // Only i am getting outofMemory Exception..


   private static String convertStreamToString(InputStream inputStream)
        throws IOException {
    ByteArrayOutputStream out = new ByteArrayOutputStream();
    InputStream in = new BufferedInputStream(inputStream);
    byte[] buffer = new byte[1024];
    int n = 0;
    try {
        while (-1 != (n = in.read(buffer))) {
            out.write(buffer, 0, n);
        }
    } finally {
        out.close();
        in.close();
    }
    return out.toString("UTF-8");
}
  • 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-27T23:13:11+00:00Added an answer on May 27, 2026 at 11:13 pm

    I think xml format will allow you for large amount of data. I am developing a Project where I download approx 15000 data in xml and there is no a memory issue.

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

Sidebar

Related Questions

In my Android application I need to read a large amount of data from
I need to get a large amount of data back from a server via
You need to pull a large amount of data (thousands of entries) from a
I need to pull a large amount of data from various tables across a
I need to store quite large amount of binary data in database (MS SQL),
I have a large amount of log data that I need to get some
We get a large amount of data from our clients in pdf files in
I have to get a large amount of data from a server to a
I am working on a project involving large amount of data from the delicious
I have an application that sometimes will utilize a large amount of data. The

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.