Test the Android application process lifecycle and recovery state when the empty process state is reached

Recently, I have been trying to improve my knowledge and skills in managing Android application status at all stages of the application process life cycle. Specifically, I have been testing various methods of maintain and share global data between activities. In my test application, in order to test the re creation of global application data and / or single instance data, I need to wait a few hours or more to make my phone decide that other processes are more important, and put my test application in the empty process state defined in process lifecycle documentation. At this time, the data of the application will be released and needs to be recreated when the application returns to the foreground again. If the operation is incorrect, The last known state reinitialization of the application may cause force shutdown for various reasons

So, my question is, in addition to waiting for this to happen organically, there is a real-world way to test this. For example, QA use cases look like testing the application into the background for a (very) extended period of time, and then into the foreground again after the application reaches the empty process state?

resolvent:

Invalid Sign

In the end, this boils down to the fact that each activity can restore its state independently. This also applies to applications. The "empty process" state is that the operating system puts the application in the final state after it is regarded as no longer important

The following is how the empty process scenario for testing my application works:

>Open your app to relevant pages. > push the button "home" on your phone. > open no less than 3 apps with high resource utilization and long scrolling list view (I use Facebook, youtube and Google play store). > scrolling list view in each app is equivalent to using system resources. > reopen your app after completing all 3 apps

Invalid Sign

This is a p.i.t.a., but it is effective

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>