A kind of method and system of Android simulator Fast Installation APK program
Technical field
The invention belongs to field of computer technology, be specifically related to a kind of method and system of Android simulator Fast Installation APK program.
Background technology
Android is a kind of freedom based on Linux and the operating system of open source code, is mainly used in portable equipment, as smart mobile phone and panel computer.Not yet have at present unified Chinese, the more people in CONTINENTAL AREA OF CHINA uses " Android " or " peace causes ".Android operating system is developed by Andy Rubin at first, mainly supports mobile phone.Within 2005, registered capital to by Google purchase, and the open mobile phone of establishment alliance development and improvement subsequently, expands to gradually on panel computer and other field.First Android smart mobile phone is published in October, 2008.The first quarter in 2011, Android exceedes Saipan system first in the global market share, leaps to the whole world first.In November, 2012, data showed, Android occupies the share in global operation system of smart phone market 76%, and Chinese market occupation rate is 90%.
Android simulator is Android SDK(Software Development Kit, i.e. SDK (Software Development Kit)) carry a mobile simulator.It is a virtual unit may operate on computer.Android simulator can not need to use physical equipment to get final product preview, development& testing Android application program.
APK is the abbreviation of Android Package, i.e. Android installation kit (APK).APK is the file layout of similar Symbian Sis or Sisx.Carry out and can install by APK file directly being passed in Android simulator or Android mobile phone.APK file is the same with sis, and the engineering of android sdk compiling is packaged into an installation procedure file, and form is apk.APK file is zip form in fact, but suffix name is modified to apk, after UnZip decompress(ion), can see Dex file, Dex is the full name of Dalvik VM executes, i.e. Android Dalvik executive routine, the not bytecode of Java ME but Dalvik bytecode.
At present, for by APK installation to Android simulator, be first by APK program copy under a temp directory of simulator, then call PM(package manager) manager attaches it in Android system.Owing to being limited to the performance of simulator itself, APK program copy is slower to the speed under the temp directory of simulator, conventionally in 50K speed per second, thereby make the whole installation process of APK program consuming time longer, can not meet people's demand.
Summary of the invention
In order to address the above problem, the object of the present invention is to provide a kind of method and system of Android simulator Fast Installation APK program.
In order to realize foregoing invention object, obtain following technical scheme:
A method for Android simulator Fast Installation APK program, comprises the following steps:
(1) described APK program is written in SD card image file;
(2) described SD card image file is loaded in Android system;
(3) call PM manager and complete the installation of described APK program.
Further, described (1) step is specifically:
Open the SD card image file of simulator;
With SD card image file described in the format analysis of FAT32, the position that need to write to obtain described APK program;
Described APK program is written to above-mentioned position;
Close described SD card image file.
Further, described (2) step is specifically:
In the time that simulator normally starts, by simulator, described SD card image file is loaded in Android system automatically.
Further, described (2) step is specifically:
In the time that simulator starts from the image recovery of having preserved, first unload SD card, and then carry SD sticks into and described SD card image file is loaded in Android system.
A system for Android simulator Fast Installation APK program, comprises with lower module:
Writing module, for being written to SD card image file by described APK program;
Load-on module, for being loaded into Android system by described SD card image file;
Installation module, completes the installation of described APK program for calling PM manager.
Further, said write module comprises following submodule:
Open submodule, for opening the SD card image file of simulator;
Analyzing sub-module, for SD card image file described in the format analysis with FAT32, the position that need to write to obtain described APK program;
Write submodule, for described APK program is written to above-mentioned position;
Close closed submodule, for closing described SD card image file.
Further, described load-on module is loaded into described SD card image file in Android system, specifically: in the time that simulator normally starts, by simulator, described SD card image file is loaded in Android system automatically.
Further, described load-on module is loaded into described SD card image file in Android system, specifically: in the time that simulator starts from the image recovery of having preserved, first unload SD card, and then carry SD sticks into and described SD card image file is loaded in Android system.
Wherein, SD card (Secure Digital Memory Card) translator of Chinese is safe digital card, it is a kind of memory device of new generation of based semiconductor fast-flash memory device, it is used widely on mancarried device, such as digital camera, personal digital assistant (PDA) and multimedia player etc.
Wherein, image file is in fact similar with ZIP compressed package, and it is made into single file by specific a series of files according to certain form, to facilitate user to download and to use, and for example operating system, the game etc. of a beta version.Its most important feature is and can directly be burnt on CD by specific software identification.
Wherein, the form of SD card image file own is FAT32 form, and FAT32 is the one of Windows system disk zoned format.This form adopts the file allocation table of 32, its managerial ability to disk is strengthened greatly, has broken through FAT16 the capacity of each subregion is only had the restriction of 2GB.Because present hard disk manufacture cost declines, its capacity is increasing, uses after the zoned format of FAT32, and we can be defined as a subregion by a big hard disk and needn't be divided into several subregions uses, greatly facilitate the management to disk.
Before the present invention has changed, APK program file is copied to the mode of installing under simulator temp directory, but be written in SD card image file, thereby greatly improved installation rate, user no longer needs to wait as long for.
Brief description of the drawings
The picture that this brief description of the drawings provides is used for assisting a further understanding of the present invention, forms the application's a part, does not form inappropriate limitation of the present invention, in the accompanying drawings:
Fig. 1 is main flow chart corresponding to the inventive method;
Fig. 2 is the concrete sub-process of Fig. 1 (1) step;
Fig. 3 is system chart corresponding to the inventive method;
Fig. 4 is the submodule block diagram of Fig. 3 writing module.
Embodiment
As shown in Figure 1, the present embodiment discloses a kind of method of Android simulator Fast Installation APK program, comprises the following steps:
(1) described APK program is written in SD card image file; By this step than existing copy APK program to simulator temp directory a lot of soon;
(2) described SD card image file is loaded in Android system; This step, according to the characteristic of simulator itself, can, in the time normally starting by simulator, be loaded into described SD card image file in Android system by simulator automatically; Can also, in the time that simulator starts from the image recovery of having preserved, first unload SD card, and then carry SD stick into and described SD card image file is loaded in Android system;
(3) call PM manager and complete the installation of described APK program.
As shown in Figure 2, described (1) step specifically comprises following sub-step:
(11) open the SD card image file of simulator;
(12) with SD card image file described in the format analysis of FAT32, the position that need to write to obtain described APK program; Because SD card image file is FAT32 form, so must adopt same form to resolve it;
(13) described APK program is written to above-mentioned position;
(14) close described SD card image file.
As shown in Figure 3, the present embodiment also discloses a kind of system of Android simulator Fast Installation APK program, comprises with lower module:
Writing module 1, for being written to SD card image file by described APK program;
Load-on module 2, for being loaded into Android system by described SD card image file; Described load-on module is loaded into described SD card image file in Android system, can, in the time that simulator normally starts, by simulator, described SD card image file be loaded in Android system automatically; Also can, in the time that simulator starts from the image recovery of having preserved, first unload SD card, and then carry SD stick into and described SD card image file is loaded in Android system;
Installation module 3, completes the installation of described APK program for calling PM manager.
As shown in Figure 4, writing module 1 comprises following submodule:
Open submodule 11, for opening the SD card image file of simulator;
Analyzing sub-module 12, for SD card image file described in the format analysis with FAT32, the position that need to write to obtain described APK program;
Write submodule 13, for described APK program is written to above-mentioned position;
Close closed submodule 14, for closing described SD card image file.
The present embodiment is written to the mode in simulator by changing APK file, and then has greatly improved its installation rate, and then has improved user's experience effect.
More than describe preferred embodiment of the present invention in detail, should be appreciated that the ordinary skill of this area just can design according to the present invention be made many modifications and variations without creative work.Therefore, all technician in the art according to the present invention design on prior art basis by logic analysis, reasoning or according to the available technical scheme of limited experiment, all should be among by the determined protection domain of these claims.