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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T08:47:27+00:00 2026-05-26T08:47:27+00:00

I im developing a application in which I continuously download large amount of data.

  • 0

I im developing a application in which I continuously download large amount of data.

The data in json format and I use Gson to deserialize it. By now Im storing this in a SQLite db. And I have to calculate the relationship and store them into a relationship db. However this takes too much time.

It would be much more convenient to save the class objects to db.

The data looks something like this after deserialization:

Class A{
private String name;
private List<B> subItems;
}

Class B{
private String name;
private List<C> subItems
}

Can I persist this in a easier way, for example by making them serializable? How can this be done?

  • 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-26T08:47:27+00:00Added an answer on May 26, 2026 at 8:47 am

    Yes, serialization is a better solution in your case and it works in Android. The following example is taken from http://www.jondev.net/articles/Android_Serialization_Example_%28Java%29

    serialization method:

      public static byte[] serializeObject(Object o) { 
        ByteArrayOutputStream bos = new ByteArrayOutputStream(); 
    
        try { 
          ObjectOutput out = new ObjectOutputStream(bos); 
          out.writeObject(o); 
          out.close(); 
    
          // Get the bytes of the serialized object 
          byte[] buf = bos.toByteArray(); 
    
          return buf; 
        } catch(IOException ioe) { 
          Log.e("serializeObject", "error", ioe); 
    
          return null;
        } 
    

    deserialization method:

      public static Object deserializeObject(byte[] b) { 
        try { 
          ObjectInputStream in = new ObjectInputStream(new ByteArrayInputStream(b)); 
          Object object = in.readObject(); 
          in.close(); 
    
          return object; 
        } catch(ClassNotFoundException cnfe) { 
          Log.e("deserializeObject", "class not found error", cnfe); 
    
          return null; 
        } catch(IOException ioe) { 
          Log.e("deserializeObject", "io error", ioe); 
    
          return null;
      } 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm developing an application which needs to store large amounts of data. I cannot
I'm developing an application which will be storing user sensitive data. My issue is
I'm developing an application which make use of display lists offered by OpenGL. My
i am developing application which send and receive data between two computers but there
I am developing an application which at the moment queries a (rather large) database
I am developing an application which connects to the server. By now the login
I am developing an application which queries data from an XML file and creates
I am developing an application which download files from internet; the files are mainly
i am developing an application which makes use of Google maps. Google maps API
I am developing c# application in which to send and get requests we use

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.