My app is required to scan a subnet for responding devices (and check port 80/8080 for a specific service). I was using an executorservice/threadpool to complete the scan task - which took approx 30 seconds to complete.
I rewrote the above process to use an asynctask - the process now takes much longer (many minutes).
I've gone back to the original executorservice and wrapped this whole process in an asynctask as a compromise (so it doesn't block the UI and completes quickly) but doubt this is best practice. It also creates issues with progress updates, cancelling etc.
Is it best that I go with the slower process, that provides UI updates/cancellable facility or (as the whole process only takes 30s) - go with the faster, executorservice?
Thanks.