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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T18:12:39+00:00 2026-05-22T18:12:39+00:00

I’ve written an app which processes a lot of data on startup; first startup

  • 0

I’ve written an app which processes a lot of data on startup; first startup time of the app is rather slow, but so are subsequent launches.

I previously thought that the relatively un-responsive startup times (~7 seconds) were due to data processing on first load – a bit of debugging suggested about 2 seconds to cold-load. So I redesigned my data structures so they’re easier to serialize to persistent storage in between launches (so it caches stuff) and it now saves state when the app finishes in about 20ms, and loading time is about 10-20ms. Much better. (p.s. it’s not using the built-in Java serialization, as the state files are now so simple it’s easier to save in a plain, human-readable (and editable) text file – it’s still pretty quick at reloading from this though!)

However, I’m still finding that the app startup time is about 5 seconds – I’ve looked in aLogCat which has an entry:

I/ActivityManager(...) blah blah blah: +5s193ms

So more than 5 seconds to load a relatively simple layout (a few nested LinearLayouts, and a few TextViews – nothing special, and no images) – admittedly that time goes down with subsequent launches (I close the app and open it again, it’s ~700ms; rinse and repeat for similar results).

Soooo my question is: how can I improve the app loading times? I’m happy that first load takes a little while to process everything – that’s fine. But is there a way I can keep the thing in memory, or at least get it into a restorable state so whatever ActivityManager is doing doesn’t take so long? I’d like it to be something I can open (probably bound to long-hold search or similar), do whatever, and close it again – thus it needs to open quickly!

Thanks in advance 🙂

Seb

  • 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-22T18:12:40+00:00Added an answer on May 22, 2026 at 6:12 pm

    Run your heavy-duty start-up work in a background thread that you launch in onCreate. (An AsyncTask is good for this.) Design your UI to show something meaningful (at least an indeterminate progress bar) when there is no data. When the data is loaded, post a Runnable (or implement onPostExecute in your AsyncTask) to update the UI to the real thing.

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

Sidebar

Related Questions

We're building an app, our first using Rails 3, and we're having to build
I want to construct a data frame in an Rcpp function, but when I
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I am trying to understand how to use SyndicationItem to display feed which is
I used javascript for loading a picture on my website depending on which small
Seemingly simple, but I cannot find anything relevant on the web. What is the
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I need to clean up various Word 'smart' characters in user input, including but

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.