Based on the development approach of mixed mode cross-platform
Technical field
The present invention relates to a kind of development approach based on mixed mode cross-platform, belong to technical field of virtualization.
Background technology
Along with the development of mobile Internet, the intelligent mobile terminal such as mobile phone, panel computer becomes the important carrier of information, and under the trend of mobile, traditional business starts progressively to mobile service expansion, and the demand of enterprise application system mobile is also thereupon growing.
At present, man-to-man Development control area pattern is all located in electrical network business mobile application and development, result in the present situation that the mobile platform of enterprise's existence is little, many, assorted.
Man-to-man Development control area pattern, because producer is different, result in Technical Architecture and the complete disunity of standard, centralized management difficulty is large, there is greater risk in information security, and construction cycle length can be made, there is serious overlapping development problem, cause construction investment to be wasted greatly.
The unified management and control means of each operation system Mobile solution construction disappearance, information security and managing risk high.
Still have by conventional P C machine finishing service in electrical network business simultaneously, due to the combined platform that neither one is unified, business has been difficult in different mobile platform and PC mutual fast.
Summary of the invention
The object of the invention is: a kind of development approach based on the cross-platform Mobile solution of mixed mode is provided, the resource that can realize between different mobile platform and Mobile solution layer is mutual, can ensure that again the resource between conventional P C machine and Mobile solution layer is handed over mutually, to solve current existing technical matters.
Technical scheme of the present invention
A kind of development approach based on mixed mode cross-platform, when Mobile solution layer obtains remote pages information by different platform, adopt between Mobile solution layer and mobile platform, arrange a JS storehouse, realize the page and platform alternately, wherein platform comprises mobile platform and PC.
In the aforesaid development approach based on the cross-platform Mobile solution of mixed mode, concrete methods of realizing can be divided into two kinds: one is that remote pages is split as data and page structure, page structure provides assembly needed for page structure and layout method by JS storehouse, and the ability of visit data, then in JS storehouse, the engine corresponding with platform is set with between platform, the browser corresponding with platform and public function module is provided with in engine, when Mobile solution layer is wanted to obtain remote pages information, JS storehouse receives instruction and is passed in engine by instruction, the platform corresponding with engine only obtains the data of long-range page, and data to be turned back in JS storehouse by former road and together with page structure corresponding with data in JS storehouse, show in Mobile solution layer, another kind is that remote pages is split as data and page structure, page structure provides assembly needed for page structure and layout method by JS storehouse, and the ability of visit data, in JS storehouse, be also provided with engine general module corresponding to PC simultaneously, realize JS storehouse and remote pages is directly handed over mutually, namely mobile layer is when obtaining remote pages information by PC, JS storehouse receives instruction and instruction is penetrated engine general module in JS storehouse, the data of direct acquisition remote pages, the former road of data is put back to and together with page structure corresponding with data in JS storehouse, show in Mobile solution layer, then the first implementation method is still adopted for during mobile platform, namely in JS storehouse, the engine corresponding with mobile platform is set with between platform, the browser corresponding with mobile platform and public function module is provided with in engine, when Mobile solution layer is wanted to obtain remote pages information, JS storehouse receives instruction and is passed in engine by instruction, the mobile platform corresponding with engine only obtains the data of long-range page, and data to be turned back in JS storehouse by former road and together with page structure corresponding with data in JS storehouse, show in Mobile solution layer.
In the aforesaid development approach based on the cross-platform Mobile solution of mixed mode, mobile platform comprises IOS, Androld and Windows Phone.
In the aforesaid development approach based on the cross-platform Mobile solution of mixed mode, described engine general module is based on ajcx technical design.
Owing to have employed technique scheme, compared with prior art, the invention remote pages is split as page structure and data, and JS storehouse provides assembly needed for page structure and layout method, make Mobile solution layer when obtaining remote pages information, only need obtain data and without the need to obtaining page structure, greatly reduce system cloud gray model desired data amount, again by arranging for engine corresponding to different mobile platform, realize Mobile solution layer and moved the ability obtaining remote pages by different platform, when Mobile solution layer obtains remote pages information by PC, can adopt and the engine corresponding with PC is set or engine general module corresponding to PC is set in JS storehouse, realize Mobile solution layer and obtain remote pages ability by PC, the principle of the invention is simple, greatly reduce running frequency and the desired data of internal system.
Accompanying drawing explanation
Accompanying drawing 1 is the principle schematic of embodiment one in the present invention;
Accompanying drawing 2 is principle schematic of embodiment two in the present invention.
Embodiment
Embodiments of the invention one: a kind of development approach based on mixed mode cross-platform, as shown in Figure 1, when Mobile solution layer obtains remote pages information by different platform, adopt and a JS storehouse is set between Mobile solution layer and mobile platform, realize the page and platform mutual, wherein platform comprises mobile platform and PC.
Concrete methods of realizing is: remote pages is split as data and page structure, page structure provides assembly needed for page structure and layout method by JS storehouse, and the ability of visit data, then in JS storehouse, the engine corresponding with platform is set with between platform, the browser corresponding with platform and public function module is provided with in engine, when Mobile solution layer is wanted to obtain remote pages information, JS storehouse receives instruction and is passed in engine by instruction, the platform corresponding with engine only obtains the data of long-range page, and data to be turned back in JS storehouse by former road and together with page structure corresponding with data in JS storehouse, show in Mobile solution layer, wherein mobile platform comprises IOS, Androld and Windows Phone.
It may be noted that, in the present embodiment, Mobile solution layer is the mixed mode applications layer based on HTML5 JS CSS3;
JS storehouse provides assembly needed for page structure and layout method for JS storehouse, and the ability of visit data, wherein assembly is the basic configuration module (i.e. page structure) of remote pages, this JS of visit data ability storehouse itself has ability, and namely those skilled in the art complete the exploitation in JS storehouse after by the thinking of the present embodiment by prior art.
(namely engine comprises the engine corresponding with different mobile platform and the engine corresponding with PC to the engine corresponding from different platform, together with the engine corresponding with PC need be installed with PC), the browser comprised in engine is browser corresponding to different platform, this is prior art, the general module corresponding with different platform is also prior art, and its both organic unities above-mentioned are just got up to realize the maintenance of greatly saving manpower and later stage in later stage programming by the present embodiment.
The present embodiment specific implementation process, if Mobile solution layer needs to obtain personal information by remote pages, first personal information is divided into personal information structure and personal information data, as shown in fig. 1 by means of arrows, Mobile solution layer sends instruction and penetrates in JS storehouse, extract in JS storehouse personal information structure assembly (namely in personal information as name, height, the arrangement mode of the data such as age in the page and the universal coding of itself), and simultaneously by personal information request of data by (in the present embodiment, mobile platform can comprise IOS with different platform, Androld, Windows Phone and PC) in corresponding engine, arrange browser corresponding to different platform and general module in engine, if be obtain remote pages information by this IOS mobile platform when obtaining personal information, then (in this engine, the browser corresponding with IOS mobile platform and general module are set by the engine corresponding with IOS, command signal first passes through browser by JS system, pass to general module again), then IOS mobile platform is entered, then IOS mobile platform completes and obtains personal information data Bing Anyuan road from remote pages and return and enter JS storehouse, and the personal information textural association corresponding with JS storehouse showing in Mobile solution layer, same principle, Mobile solution layer is by Androld, Windows Phone and PC platform complete same operation, thus complete the cross-platform Mobile solution of Mobile solution layer.
Same principle, the present embodiment also can realize Mobile solution layer obtains local resource ability by different platform, and its principle is consistent with acquisition remote pages information.
Embodiments of the invention two: a kind of development approach based on mixed mode cross-platform, as shown in Figure 2, when Mobile solution layer obtains remote pages information by different platform, adopt and a JS storehouse is set between Mobile solution layer and mobile platform, realize the page and platform mutual, wherein platform comprises mobile platform and PC.
Concrete methods of realizing is: remote pages is split as data and page structure, page structure provides assembly needed for page structure and layout method by JS storehouse, and the ability of visit data, in JS storehouse, be also provided with engine general module corresponding to PC simultaneously, realize JS storehouse and remote pages is directly handed over mutually, namely mobile layer is when obtaining remote pages information by PC, JS storehouse receives instruction and instruction is penetrated engine general module in JS storehouse, the data of direct acquisition remote pages, the former road of data is put back to and together with page structure corresponding with data in JS storehouse, show in Mobile solution layer, then the first implementation method is still adopted for during mobile platform, namely in JS storehouse, the engine corresponding with mobile platform is set with between platform, the browser corresponding with mobile platform and public function module is provided with in engine, when Mobile solution layer is wanted to obtain remote pages information, JS storehouse receives instruction and is passed in engine by instruction, the mobile platform corresponding with engine only obtains the data of long-range page, and data to be turned back in JS storehouse by former road and together with page structure corresponding with data in JS storehouse, show in Mobile solution layer, wherein mobile platform comprises IOS, Androld and Windows Phone, this engine general module is based on ajcx technical design.
It may be noted that, in the present embodiment, Mobile solution layer is the mixed mode applications layer based on HTML5 JS CSS3;
JS storehouse provides assembly needed for page structure and layout method for JS storehouse, and the ability of visit data, wherein assembly is the basic configuration module (i.e. page structure) of remote pages, this JS of visit data ability storehouse itself has ability, namely those skilled in the art complete the exploitation in JS storehouse after by the thinking of the present embodiment by prior art, engine in JS storehouse is based on ajcx technological development by module, and JS storehouse is handed over mutually by PC and remote pages, and this is also prior art.
(mobile platform comprises IOS from engine corresponding to different mobile platform, Androld and Windows Phone), the browser comprised in engine is the browser that different mobile platform is corresponding, this is prior art, the general module corresponding from different mobile platform is also prior art, and its both organic unities above-mentioned are just got up to realize the maintenance of greatly saving manpower and later stage in later stage programming by the present embodiment.
The present embodiment specific implementation process, if Mobile solution layer needs to obtain personal information by remote pages, first personal information is divided into personal information structure and personal information data, as shown in the arrow in accompanying drawing two, Mobile solution layer sends instruction and penetrates in JS storehouse, extract in JS storehouse personal information structure assembly (namely in personal information as name, height, the arrangement mode of the data such as age in the page and the universal coding of itself), and simultaneously by personal information request of data by (in the present embodiment, mobile platform can comprise IOS from different mobile platform, Androld, Windows Phone) in corresponding engine, arrange browser corresponding to different mobile platform and general module in engine, if be obtain remote pages information by this IOS mobile platform when obtaining personal information, then (in this engine, the browser corresponding with IOS mobile platform and general module are set by the engine corresponding with IOS, command signal first passes through browser by JS system, pass to general module again), then IOS mobile platform is entered, then IOS mobile platform completes and obtains personal information data Bing Anyuan road from remote pages and return and enter JS storehouse, and the personal information textural association corresponding with JS storehouse showing in Mobile solution layer, same principle, Mobile solution layer completes same operation by Androld and Windows Phone mobile platform, thus complete the cross-platform Mobile solution of Mobile solution layer.
If when Mobile solution layer needs to obtain remote resource by PC, then first personal information is divided into personal information structure and personal information data, as shown in the arrow in accompanying drawing two, Mobile solution layer sends instruction and penetrates in JS storehouse, extract in JS storehouse personal information structure assembly (namely in personal information as name, height, the arrangement mode of the data such as age in the page and the universal coding of itself), and personal information request of data is passed through in the engine general module in JS storehouse simultaneously, engine general module to be returned from a remote pages goods power personal information data Bing Anyuan road by PC and enters JS storehouse, and the personal information textural association corresponding with JS storehouse showing in Mobile solution layer
Same principle, the present embodiment also can realize Mobile solution layer obtains local resource ability by PC, and its principle is consistent with acquisition remote pages information.