Note that there are some explanatory texts on larger screens.

plurals
  1. POHow can I improve the ActivityManager loading time of my app?
    primarykey
    data
    text
    <p>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.</p> <p>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!)</p> <p>However, I'm still finding that the app startup time is about 5 seconds - I've looked in aLogCat which has an entry:</p> <pre><code>I/ActivityManager(...) blah blah blah: +5s193ms </code></pre> <p>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).</p> <p>Soooo my question is: how can I improve the app loading times? I'm happy that <em>first</em> 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!</p> <p>Thanks in advance :)</p> <p>Seb</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload