Intuitive understanding of Android tasks

Tasks and Back Stack is the ultimate resource for understanding the mechanism. with the participation of tasks and their interaction with the "Back" button, In an early paragraph:

A task is a set of actions with which users interact when performing a specific job. actions are located on the stack ("back stack"), in the order that each action is opened.

The tasks are then explained in terms of the initial screen and how to start the processes. It makes sense. I'm curious, however: What should determine the use of multiple tasks in user applications?

I am interested in intuitive understanding or heuristic task management, and not just an attempt to achieve certain order of actions in the background stack.

+4
source share
2 answers

A task is a group of components that work in concert together to fulfill a goal for a user (not necessarily a very specific goal, but a goal nonetheless). This is what the user sees as an application.

There is a music player that allows the user to control and play songs. It may include various actions that display album / artist / song metadata, playback controls, organization of playlists, etc. It may also include services that implement playback and that track new songs. The user does not know what an activity and service is; he or she knows that this series of screens allows him or her to control and play songs.

Actions in the task should not belong to the same "application" from the point of view of development. If the task of the music player allows users to associate an image with a song, it can trigger image gallery activity or camera activity. Since the new activity is still working with the goal of managing songs, it is still part of the same task.

On the other hand, if the user completely violates the target, it may be time to start another task. For example, if you launch a web browser to view the artist’s website, the user is now doing something else. The user probably does not associate the web browser with managing and playing songs, so this will probably be a different task.

+3
source

I think that the task in this context is a kind of workflow. Take the email. Writing a new message may consist of first filling out the recipients, and then in the next step, selecting the recipients, and clicking on send, finally sends the email. Another task may be to select several emails and then delete them all in one go.

In practice, you often find AsyncTask , which basically does work in the background, which otherwise blocks the UI thread and makes the application inactive.

-1
source

Source: https://habr.com/ru/post/1342044/


All Articles