Do Android apps need to quit manually?

Source: Internet
Author: User
Tags exit requires

More than once, more than one person has asked the question. I answered: no need. However, it is still to be recorded.

Let's start by understanding the system's internal mechanisms for application management.

For the Android system, it includes processes and services. "Process" has a running, also has just left in the background cache. A "service" is an interface-free, long-running application feature that is not easily terminated.

We know that in Android you can move away from the application quickly by using the home key or the return key (←).

Home key:

On any interface of the currently running application, pressing the home key will quickly return to the main screen of the mobile phone. At the same time, the process of the application will be paused in the background and the cache can be set up, and it is easy to return to the interface when you start the application again. (Site is kept)

Of course, when you press the home key to return to the main screen of the mobile phone, it is possible to run one or more processes and services in the background to ensure that the application is "alive" in the background.

Although we know that the background produces a variety of "processes" and "services", you don't have to worry about them dragging your phone. When running a new application discovers that memory may not be enough, the system automatically frees partially cached processes in the background to ensure that new applications can be run. This is an intelligent, benign supply system.

Return key:

The Android system uses the return key to screen back and closes the dialog box/menu/On-Screen Keyboard.

For traditional local client applications, each screen can be understood as an activity. You can quickly fall back to the previous activity of the current application by returning the key, or you can leave an activity of a new application open by the current application.

All activities are in a stack structure (a serial form of data structure), and the running activity is at the top. When you press the return key, the current activity is cleared and the previous activity is restored. The following diagram example:

(with map origin: http://developer.android.com/guide/topics/fundamentals/tasks-and-back-stack.html)

If you press the return key continuously, the activity is drawn away, just like peeling an onion.

In an Android application, you can start an activity in another application (Task) with an activity in the current application (Task) through the intent feature.

For example, the following figure, in the "Youdao Dictionary" main interface click HYPERLINK "Feedback" to open the browser access to the target page:

In the target Web interface, you can use the return key to quickly return to just the "Youdao dictionary" main interface.

And the next example, the experience is very bad:

As pictured above, it takes a few twists to get back to the previous task on the target page.

Over and over again the browser's browsing history, and even go back to the browser's start page, and then pop up a dialog box asking if you want to quit ...

God, I'm going crazy.

Android official for the activity stack processing mechanism between multiple tasks, look at this diagram to explain the following:

(with map origin: http://developer.android.com/guide/topics/fundamentals/tasks-and-back-stack.html)

As we can see from the diagram, the "Activity y" of "task B" in the background is drawn to the front desk by a button in "Activity 2" of task A. And as the activity of "task B" is stripped down, the entire "task B" is ended, and the return key is used to return to "Activity 2" of task A.

The return key implements the convenience of quickly returning after invoking a new task, instead of just going back to the list of applications and finding the last application to start again.

When all activities are cleared from the stack, the task ends. That is, the application exits when the application's main interface presses the return key.

Unless, the application has designed processes and services that run in the background. For example, "Sina Weibo", even if you click the Return key in the application main interface to exit, in the "program Management" "Running" interface can still see the running processes and services. (You need to switch to the show currently running Services view) by using the menu key

As mentioned above, background service is an interface-free, long-running application that is not easily terminated, even if you use Task Manager. (In fact, you can find it in the "service" interface and manually stop the service, but no such necessity, to the system automatically processing can be. When you do not use a task for a long time, the system will assume that you are no longer needed and will automatically help you end it. )

At this point, we already know why Android apps don't need to quit manually. Because Smart systems have helped users do a lot of things, including exiting applications and restoring available memory.

Limited by the Android official approach to design specifications, Android does not explicitly tell designers, like iOS, that they don't need that. The design pattern of the Android application is therefore "blossoming" and it is difficult to develop a more unified experience. For example, the topic mentioned in this article is that you don't need to manually exit the Android app, and it's funny if you see a button on your iOS screen that exits the app.

In any case, Android or iOS, users do not need to focus on "process" or "Memory Management", "task management" these things. Use up, leave the interface can, it is so simple! Putting users without concern is tantamount to "not wanting to let children play with fire, but giving him a lighter." ”

And designers, it's time to do something. Change it!

When you see this, you may ask: Since the Android app is suspended in the background, why is it slower to open more apps?

On the one hand: a new running application would be slower if it needed larger memory. In addition, if the cell phone itself is too small and the CPU does not give power, the system will naturally automatically end the process of releasing the cache more frequently, resulting in the mobile phone at some times slow to run the feeling.

And because of that, we know why Task Manager is so popular, and even become a "installed necessity." People use it to quickly release the cache in advance to ensure that there is enough memory to run the new application. Of course, the manual cleanup cache has slowly become unnecessary as the CPU frequency becomes higher and memory grows larger.

On the other hand, a temporary background service may cause the phone to slow down. Some applications in the background to listen to the specified events will automatically start, such as the operating system itself, "Google Service", such as the connection between USB and the PC to launch the "Pea Pod Phone Wizard", the cell phone "pea pod daemon" will automatically start. To avoid this situation, you can only recommend that you have a selective installation of the application. Smart software requires advanced hardware to support it.

You may also ask: Since the application main interface with the return key can be directly out of the application, but why an Android application (especially domestic) to eject the Exit confirmation dialog box?

This is actually more product people out of the hope that their applications are too easy for users to "quit", or worry about "misoperation" reasons, to add to the user a barrier wall.

Look at the PC software in front of us! After clicking the X icon in the upper-right corner of the window, there are a lot of software doing the same thing.

It is a typical practice to pass the buck on to the user, to put it bluntly. Seems to be warning the user: "Really want to quit?" I'll leave you alone! "

We should use as few dialog boxes as possible to provide the necessary fault-tolerant support. Allow users to make mistakes and give them a chance to recover. For example, you can allow users to return to the scene once they have pressed the return key to leave the application. This is reflected in a number of good third-party applications, such as Twitter, rice chat ...

Of course, except for immersive applications. For example, the video is playing or the game is on the screen, should be as far as possible not to let users make mistakes are withdrawn. Immersive applications should provide immersion protection, because the game or movie to half of the exit is often unable to return to the scene.

Finally, add: "Exit" in this article means quitting the application, not the login status of the exit account. If your application requires the user to log in with the password, it is necessary to provide an "exit login" (or "logoff") function.

Article Source: azero.tsang.blog.163.com reprint Please indicate the source link.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.