Summary of the invention
To take too much memory system in order solving in smart mobile phone, to consume a large amount of mobile phone electric weight, make the reaction velocity of mobile phone reduce, affect user's experience problem, the embodiment of the present invention provides a kind of method and device of managing the application program unloading.Described technical scheme is as follows:
First aspect, provide a kind of method of managing the application program unloading, and described method comprises:
Pre-set inquiry constantly;
When the current time, be described inquiry constantly the time, the last start-up time of obtaining successively corresponding application programs from the time array;
Calculate not start-up time of the value of current application program according to described last start-up time and current time, according to described time value, judge whether to meet default discharge time;
When described time value meets default discharge time, current application program is unloaded to management.
Preferably, describedly also comprise before pre-seting inquiry constantly:
Time Created, array, be stored in the start-up time of application program as respective element in described time array, the initial time using the time of set up applications as respective element, and described time array is for storing the last start-up time of application program.
Preferably, described not start-up time of the value that calculates current application program according to described last start-up time and current time, judge whether to meet default discharge time according to described time value, comprising:
To deduct the last start-up time of the corresponding application program of currentElement the current time, obtain not start-up time of the value of current application program, judge whether described time value is more than or equal to default discharge time, described default discharge time refers to the time that whether needs unloading while not starting application program for prompting.
Preferably, describedly when described time value meets default discharge time, current application program is unloaded to management, comprising:
When described time value meets default discharge time, judge whether the application program that the current time array element is corresponding is starting up's application program;
If starting up's application program shows the selection prompting frame, and carry out corresponding operation according to user's selection;
If not starting up's application program, judge in described time array whether also have next element, when having next element, obtain not start-up time of the value that described next element obtains corresponding application programs, return and continue value computing time, carry out corresponding steps.
Preferably, described if starting up's application program shows the selection prompting frame, and carry out corresponding operation according to user's selection, specifically comprise:
The type of judgement user's options, when the type of user's options is the unloading type, unload current application program; When the type of user's options is type of backup, unload and back up current application program; When the type of user's options when ignoring type of message, undo.
Second aspect, provide a kind of device of managing the application program unloading, and described device comprises:
Presetting module, for pre-seting inquiry constantly;
Acquisition module, be described inquiry constantly the time when the current time, the last start-up time of obtaining successively corresponding application programs from the time array;
Judge module, calculate not start-up time of the value of current application program according to described last start-up time and current time, according to described time value, judge whether to meet default discharge time;
Processing module, when described time value meets default discharge time, unload management to current application program.
Preferably, described device also comprises:
Set up module, for array Time Created, using the start-up time of application program as respective element, be stored in described time array, the initial time using the time of set up applications as respective element, described time array is for storing the last start-up time of application program.
Preferably, described judge module will be specifically for deducting the last start-up time of the corresponding application program of currentElement the current time, obtain not start-up time of the value of current application program, judge whether described time value is more than or equal to default discharge time, described default discharge time refers to the time that whether needs unloading while not starting application program for prompting.
Preferably, described processing module comprises:
Judging unit, for when described time value meets default discharge time, judge whether the application program that the current time array element is corresponding is starting up's application program;
The first performance element, for if starting up's application program, show and select prompting frame, and carry out corresponding operation according to user's selection;
The second performance element, be used for if not starting up's application program, judge in described time array and whether also have next element, when having next element, obtain not start-up time of the value that described next element obtains corresponding application programs, return and continue value computing time, carry out corresponding steps.
Preferably, described the first performance element, specifically for judgement user's the type of options, during for the unloading type, unload current application program when the type of user's options; When the type of user's options is type of backup, unload and back up current application program; When the type of user's options when ignoring type of message, undo.
The beneficial effect that the technical scheme that the embodiment of the present invention provides is brought is:
By inquiry being set constantly, the program process unloading management do not started reaching Preset Time within the cycle, provide information to the user, according to user's selection application programs, process accordingly, to enable the application program that unloading is of little use in time, reduce taking of internal memory, and the consumption that reduces circuit, make the reaction velocity of smart mobile phone improve, improve user's experience.
Embodiment
For making the purpose, technical solutions and advantages of the present invention clearer, below in conjunction with accompanying drawing, embodiment of the present invention is described further in detail.
Embodiment mono-
The embodiment of the present invention one provides a kind of method of managing the application program unloading, and as shown in Figure 1, described method comprises:
Step 101: pre-set inquiry constantly.
Wherein, described inquiry refers in cycle length the last start-up time of corresponding application program for each element of query time array constantly, for example, take one day as the cycle, and the 12:00 of every day is set to inquiry constantly.
Preferably, in the present embodiment, before step 101, also comprise:
Time Created, array, be stored in described time array the initial time using the time of set up applications as respective element using the start-up time of application program as respective element.
Described time array is for storing the last start-up time of application program, element in described time array is the last time started of corresponding application programs, for example, when opening an application, by element position corresponding in the access time start-up time array of this application, wherein, the initial time of time array element is for installing the time of respective application.
Wherein, described last refers to the time of last startup corresponding application programs start-up time, for example, first element of described time array refers to application program " excellent cruel client ", when starting " excellent cruel client ", by the position of the first element of current access time start-up time array and replace the first current element.
Step 102: when the current time, be described inquiry constantly the time, the last start-up time of obtaining successively corresponding application programs from the time array.
For example, when the current time, for inquiry, constantly during 12:00, start the inquiry service module, the element of acquisition time array, i.e. the last start-up time of corresponding application programs successively from the time array.
Step 103: calculate not start-up time of the value of current application program according to described last start-up time and current time, according to described time value, judge whether to meet default discharge time.
Particularly, step 103 specifically comprises: the last start-up time that will deduct the corresponding application program of currentElement the current time, obtain not start-up time of the value of current application program, judge whether described time value is more than or equal to default discharge time, described default discharge time refers to the time that whether needs unloading while not starting application program for prompting, whether for example, application program is set starts and points out and unload in 60 days.
Step 104: when described time value meets default discharge time, current application program is unloaded to management.
Wherein, step 104 as shown in Figure 2, specifically comprises:
Step 201: when described time value meets default discharge time, judge whether the application program that the current time array element is corresponding is starting up's application program,
Step 202: if starting up's application program shows the selection prompting frame, and carry out corresponding operation according to user's selection;
In the present embodiment, for example, when current application program is starting up's application program, eject prompting frame, content is specially " this application has had 60 days and do not used; this is applied as automatic startup application program, the suggestion unloading ", and provides " unloading ", " unloading backup " and " ignoring this message " to select for the user.
Particularly, as shown in Figure 3, step 202 comprises:
Step 301: the type of judgement user's options,
Step 302: when the type of user's options is the unloading type, unload current application program;
The api that can call in PackageManager particularly, unloads current application.
Step 303: when the type of user's options is type of backup, unload and back up current application program;
Particularly, by this application copy to " application backup " file in mobile phone;
Step 304: when the type of user's options when ignoring type of message, undo.
Step 203: if not starting up's application program, judge in described time array whether also have next element, when having next element, obtain not start-up time of the value that described next element obtains corresponding application programs, return and continue value computing time, carry out corresponding steps.
The embodiment of the present invention one is by arranging inquiry constantly, the program process unloading management do not started reaching Preset Time within the cycle, provide information to the user, according to user's selection application programs, process accordingly, to enable the application program that unloading is of little use in time, effectively reduce taking of internal memory, and the consumption that reduces circuit, make the reaction velocity of smart mobile phone improve, improve user's experience.
Embodiment bis-
The embodiment of the present invention two provides a kind of device of managing the application program unloading, and as shown in Figure 4, described method comprises:
Presetting module 401, for pre-seting inquiry constantly;
Wherein, described inquiry refers in cycle length the last start-up time of corresponding application program for each element of query time array constantly, for example, take one day as the cycle, and the 12:00 of every day is set to inquiry constantly.
Acquisition module 402, be described inquiry constantly the time when the current time, the last start-up time of obtaining successively corresponding application programs from the time array;
For example, when the current time, for inquiry, constantly during 12:00, start the inquiry service module, the element of acquisition time array, i.e. the last start-up time of corresponding application programs successively from the time array.
Judge module 403, calculate not start-up time of the value of current application program according to described last start-up time and current time, according to described time value, judge whether to meet default discharge time;
Concrete, judge module 403 will be specifically for deducting the last start-up time of the corresponding application program of currentElement the current time, obtain not start-up time of the value of current application program, judge whether described time value is more than or equal to default discharge time, described default discharge time refers to the time that whether needs unloading while not starting application program for prompting; Whether for example, application program is set starts and points out and unload in 60 days.
Processing module 404, when described time value meets default discharge time, unload management to current application program.
In conjunction with above-described embodiment, as shown in Figure 5, described device also comprises:
Set up module 501, for array Time Created, using the start-up time of application program as respective element, be stored in described time array, the initial time using the time of set up applications as respective element, described time array is for storing the last start-up time of application program.
Described time array is for storing the last start-up time of application program, element in described time array is the last time started of corresponding application programs, for example, when opening an application, by element position corresponding in the access time start-up time array of this application, wherein, the initial time of time array element is for installing the time of respective application.
Wherein, described last refers to the time of last startup corresponding application programs start-up time, for example, first element of described time array refers to application program " excellent cruel client ", when starting " excellent cruel client ", by the position of the first element of current access time start-up time array and replace the first current element.
Particularly, as shown in Figure 6, processing module 404 comprises:
Judging unit 601, for when described time value meets default discharge time, judge whether the application program that the current time array element is corresponding is starting up's application program;
The first performance element 602, for if starting up's application program, show and select prompting frame, and carry out corresponding operation according to user's selection;
In the present embodiment, for example, when current application program is starting up's application program, eject prompting frame, content is specially " this application has had 60 days and do not used; this is applied as automatic startup application program, the suggestion unloading ", and provides " unloading ", " unloading backup " and " ignoring this message " to select for the user.
Particularly, the first performance element 602, specifically for the type of judgement user's options, when the type of user's options is the unloading type, unloads current application program; When the type of user's options is type of backup, unload and back up current application program; When the type of user's options when ignoring type of message, undo.
The api that wherein, can call in PackageManager unloads current application; When selecting the unloading backup, by this application copy to " application backup " file in mobile phone.
The second performance element 603, be used for if not starting up's application program, judge in described time array and whether also have next element, when having next element, obtain not start-up time of the value that described next element obtains corresponding application programs, return and continue value computing time, carry out corresponding steps.
In conjunction with above-described embodiment, as shown in Figure 5, described device also comprises:
Set up module 501, for array Time Created, using the start-up time of application program as respective element, be stored in described time array, the initial time using the time of set up applications as respective element, described time array is for storing the last start-up time of application program.
Described time array is for storing the last start-up time of application program, element in described time array is the last time started of corresponding application programs, for example, when opening an application, by element position corresponding in the access time start-up time array of this application, wherein, the initial time of time array element is for installing the time of respective application.
Wherein, described last refers to the time of last startup corresponding application programs start-up time, for example, first element of described time array refers to application program " excellent cruel client ", when starting " excellent cruel client ", by the position of the first element of current access time start-up time array and replace the first current element.
The embodiment of the present invention two is by arranging inquiry constantly, the program process unloading management do not started reaching Preset Time within the cycle, provide information to the user, according to user's selection application programs, process accordingly, to enable the application program that unloading is of little use in time, reduce taking of internal memory, and the consumption that reduces circuit, make the reaction velocity of smart mobile phone improve, improve user's experience.
The invention described above embodiment sequence number, just to describing, does not represent the quality of embodiment.
One of ordinary skill in the art will appreciate that all or part of step that realizes above-described embodiment can complete by hardware, also can come the hardware that instruction is relevant to complete by program, described program can be stored in a kind of computer-readable recording medium, the above-mentioned storage medium of mentioning can be ROM (read-only memory), disk or CD etc.
The foregoing is only preferred embodiment of the present invention, in order to limit the present invention, within the spirit and principles in the present invention not all, any modification of doing, be equal to replacement, improvement etc., within all should being included in protection scope of the present invention.