LOADER AND METHOD FOR PROCESSING A RESOURCE BUNDLE
In accordance with some embodiments, a loader is operable to download a resource bundle from a server to a user device and process/load at least one resource included in the resource bundle before the whole resource bundle is downloaded. A novel data structure for the resource bundle header and the resources of the bundle allows the loading of the resources into a program as the resource bundle continues to be downloaded, thus decreasing the time between a start of the download and a time at which the resources included in the resource bundle are available for use by the program.
1 . A computer-implemented method of processing a resource bundle downloaded from a server to a user device, the method comprising:
recognizing by a loader a beginning of a download of a resource bundle, the resource bundle comprising a plurality of resources to be loaded for use in a program and wherein a data format for the resource bundle includes:
a header data structure for the resource bundle that includes an indication of a total size of the resource bundle; and
a respective resource data structure for each resource of the plurality of resources, each such resource data structure including an indication of a total size of the resource corresponding to the resource data structure, the indication of the total size of the resource being located in the resource data structure before any data comprising the resource, such that both the total size of the resource bundle and the total size of each resource included in the resource bundle is determinable by the loader before the data comprising the resource is processed;
determining, from the header data structure, the total size of the resource bundle being downloaded;
determining, from the data structure of a first resource included in the resource bundle, a total size of the first resource;
determining, as the resource bundle continues to be downloaded and based on the total size of the resource bundle and the total size of the first resource, that sufficient data has been downloaded to process the first resource, and
process the first resource while the remainder of the resource bundle continues to be downloaded and before the download of the resource bundle is complete.
2 . The method of claim 1 , wherein processing the first resource comprises loading the first recourse into the program such that it is available for use by the program.
3 . The method of claim 1 , wherein the loader is a module of the program.
4 . The method of claim 1 , wherein the loader is a software application corresponding to a first entity and the program is a software application of a second entity.
5 . The method of claim 1 , wherein the loader and the program are stored locally on the user device.
6 . The method of claim 1 , wherein the total size of the resource bundle and the total size of the first resource is measured in bytes.
7 . The method of claim 1 , wherein the total size of the first resource comprises a minimum amount of data required to be downloaded prior to the loader being operable to process the first resource.
8 . The method of claim 1 , wherein the method further comprises:
monitoring, by the loader, the download of the resource bundle; and
determining, based on the monitoring, that the minimum amount of data required to be downloaded has been downloaded.
9 . The method of claim 8 , wherein monitoring comprises checking the download process at predetermined intervals.
10 . The method of claim 1 , wherein the program is an online game program and wherein at least one of the resources comprises at least one of an audio, graphical and video resource for the online game program.
11 . A non-transitory computer-readable medium storing instructions comprising a loader mechanism for processing and loading resources to a program, which instructions when executed by a processor cause the processor to:
recognize a beginning of a download of a resource bundle, the resource bundle comprising a plurality of resources to be loaded for use m a program and wherein a data format for the resource bundle includes:
a header data structure for the resource bundle that includes an indication of a total size of the resource bundle; and
a respective resource data structure for each resource of the plurality of resources, each such resource data structure including an indication of a total size of the resource corresponding to the resource data structure, the indication of the total size of the resource being located in the resource data structure before any data comprising the resource, such that both the total size of the resource bundle and the total size of each resource included in the resource bundle is determinable by the loader before the data comprising the resource is processed:
determine, from the header data structure, the total size of the resource bundle being downloaded;
determine, from the data structure of a first resource included in the resource bundle, a total size of the first resource;
determining, as the resource bundle continues to be downloaded and based on the total size of the resource bundle and the total size of the first resource, that sufficient data has been downloaded to process the first resource; and
process the first resource while the remainder of the resource bundle continues to be downloaded and before the download of the resource bundle is complete.
12 . The non-transitory computer-readable medium of claim 11 , wherein processing the first resource comprises loading the first recourse into the program such that it is available for use by the program.
13 . The non-transitory computer-readable medium of claim 11 , wherein the loader is a module of the program.
14 . The non-transitory computer-readable medium of claim 11 , wherein the loader is a software application corresponding to a first entity and the program is a software application of a second entity.
15 . The non-transitory computer-readable medium of claim 11 , wherein the loader and the program are stored locally on the user device.
16 . The non-transitory computer-readable medium of claim 11 , wherein the total size of the resource bundle and the total size of the first resource is measured in bytes.
17 . The non-transitory computer-readable medium of claim 11 , wherein the total size of the first resource comprises a minimum amount of data required to be downloaded prior to the loader being operable to process the first resource.
18 . The non-transitory computer-readable medium of claim 11 , wherein the method further comprises:
monitoring, by the loader, the download of the resource bundle; and
determining, based on the monitoring, that the minimum amount of data required to be downloaded has been downloaded.
19 . The non-transitory computer-readable medium of claim 18 , wherein monitoring comprises checking the download process at predetermined intervals.
20 . The non-transitory computer-readable medium of claim 11 , wherein the program is an online game program and wherein at least one of the resources comprises at least one of an audio, graphical and video resource for the online game program.