Patent ID: 9116745
Filing Date: 2015-08-25
Classification: G06F

Abstract:
1. A resource allocation method for foreground switch of a JAVA 2 Platform Micro Edition (J2ME) application, comprising: when a JAVA application program is switching to background from foreground, receiving a first message from a JAVA virtual machine, wherein the first message carries information indicating that the JAVA application program needs to release partial resources; and the JAVA application program returning a first response message to the JAVA virtual machine; upon receiving the first response message, the JAVA virtual machine releasing the partial resources to be released, according to the first response message, wherein the first response message carries information indicating the partial resources to be released and resources to be necessarily reserved for restoring the JAVA application program to an executing state; wherein the partial resources comprises at least one of the resources of: multimedia resources, CPU resources; and when the JAVA application program switches to foreground from background, the method further comprises: the JAVA application program receives a second message from the JAVA virtual machine, wherein the second message carries the information indicating that the JAVA application program need to restore partial resources released; the JAVA application program returns a second response message to the JAVA virtual machine so as to realize the restore of the resources to be restored, wherein the second response message carries the information of the resources to be restored.