This shows you the differences between two versions of the page.
smd:laboratoare:04 [2021/04/08 12:41] adriana.draghici [Threading in Android] |
smd:laboratoare:04 [2021/05/12 17:46] (current) adriana.draghici [Tasks] |
||
---|---|---|---|
Line 253: | Line 253: | ||
===Task 2 (4p)=== | ===Task 2 (4p)=== | ||
- | Mock the download of several files (at least 10) in parallel on multiple threads using Runnables and ThreadPoolExecutor ([[https://developer.android.com/reference/java/util/concurrent/ThreadPoolExecutor|documentation]], [[https://developer.android.com/training/multiple-threads/create-threadpool#ThreadPool|creation example]]). | + | Mock the download of several files (at least 10) in parallel on multiple threads using Runnables and ThreadPoolExecutor ([[https://developer.android.com/reference/java/util/concurrent/ThreadPoolExecutor|documentation]], [[https://www.journaldev.com/1069/threadpoolexecutor-java-thread-pool-example-executorservice|example]]). |
* For the "mock" download, each thread should sleep a random number between 100 and 200 ms. | * For the "mock" download, each thread should sleep a random number between 100 and 200 ms. | ||
* The UI should update in real time a text view with the following content: | * The UI should update in real time a text view with the following content: | ||
Line 262: | Line 262: | ||
… | … | ||
</code> | </code> | ||
- | * The text view must have the option android:inputType="textMultiLine". | + | * To show multiple line you can add the ''android:inputType="text"'' to the TextView |