A tiny asynchronized task library for android.
- we should avoid to use thread, runnable, handler, and AsyncTask;
- we should use thread pool executors to handle threads;
- we will handle background thread and UI thread, and their interactions, even frequently;
- simple and easy to use, focus lifecycle and avoid OOM.
- handle asynchronized task in background;
- handle asynchronized task first in background and then to front;
- handle asynchronized task with delay;
- cancel handle asynchronized task.
- set task priority.
- Desing Pattern
- Singleton Pattern
- static
- Skill Point
- ExecutorService
- synchronized
- Callable
- FutureTask
- Handler
- Runnable
- only run in background TinyTaskExecutor.execute(new SimpleTask() { ... });
- run in background and then go back to main ui; TinyTaskExecutor.execute(new AdvancedTask() { ... });
- run with delay TinyTaskExecutor.execute(task, 5000);
- remove delay task TinyTaskExecutor.removeTask(task);
- check a task(not recommend) TinyTaskExecutor.check();
- post to main thread TinyTaskExecutor.postToMainThread(runnable, 2000);
- remove post to main thread TinyTaskExecutor.removeMainThreadRunnable(delayRunnable);
- set task priority new TestTask(TinyTaskExecutor.PRIORITY_LOWEST); TinyTaskExecutor.execute(s1);
- to cancel when overtime has come;
- schedule task;
(done in 20190105) task priority;(done in 20190119) BlockQueue;(done in 20190119) customized thread pool and queue;