In Android, how can I run something in the background with the highest priority possible?
I understand I could use a foreground service, but I don't want to show a notification to the user. I need to run something that is CPU-intense but short-lived. It needs to run efficiently (otherwise it will take forever) but it will only take a couple of seconds.
Currently I'm running it on the main thread because it's the only way I can sure it completes within a few seconds on all my test devices. Running it as a (non-foreground) service worked well for most devices but on some devices it was taking close to a minute, which is much more unacceptable than locking up the UI for 2 seconds as it currently does. I also tried AsyncTask but it was taking too long.