How to copy files without slowing down my app?

Posted by Kevin Gebhardt on Stack Overflow See other posts from Stack Overflow or by Kevin Gebhardt
Published on 2014-08-22T09:16:59Z Indexed on 2014/08/23 22:20 UTC
Read the original article Hit count: 204

Filed under:
|
|
|
|

I have a bunch of little files in my assets which need to be copied to the SD-card on the first start of my App. The copy code i got from here placed in an IntentService works like a charm. However, when I start to copy many litte files, the whole app gets increddible slow (I'm not really sure why by the way), which is a really bad experience for the user on first start.

As I realised other apps running normal in that time, I tried to start a child process for the service, which didn't work, as I can't acess my assets from another process as far as I understood. Has anybody out there an idea how

a) to copy the files without blocking my app

b) to get through to my assets from a private process (process=":myOtherProcess" in Manifest)

or

c) solve the problem in a complete different way

Edit: To make this clearer: The copying allready takes place in a seperate thread (started automaticaly by IntentService). The problem is not to separate the task of copying but that the copying in a dedicated thread somehow affects the rest of the app (e.g. blocking to many app-specific resources?) but not other apps (so it's not blocking the whole CPU or someting)

Edit2: Problem solved, it turns out, there wasn't really a problem. See my answer below.

© Stack Overflow or respective owner

Related posts about android

Related posts about Performance