Android CS323 Cornez

Lab 6: Exploring Background Threads




Thread Experiments

    The goal of this assignment is to create an explorative app to test the responses of varied time consuming output.


    After experimenting with the creation of intensive work for the main thread, you will improve response times by adding a background a thread.
    Begin by Creating the interface, main activity layout. This layout app will have two buttons.
    One will start some work and the other will end the work.










Experiment 1:
    Test a non intensive workload by displaying output to Log.i and verify no problems occur.





Experiment 2:
    The goal of this experiment is to place an unreasonable amount of output to the log window.
    When the user clicks Start Work, the logcat should fill up with the string "Working on it".
    So, we will throw this Log.i statement in a loop and only stop when the user clicks the
    button labelled Stop Work. Verify the loop work has completely taken over the main thread.
    Also verify poor response (ANR - Application Not Responding).





Experiment 3:
    Modify the previous experiment by starting a new thread (with a Runnable instance)
    and place the code that is taking up considerable resources in the run() method.