The sharing method of application program between mobile terminal in LANTechnical field
The present invention relates to the communications field, more particularly to the sharing method of application program between mobile terminal in a kind of LAN.
Background technology
Intelligent mobile terminal is the trend of current development in science and technology, and the development of intelligent mobile terminal is also along with development and the variation of increasing application program.The application of current application program the most very diversification, the field related to is also a lot, comprise diet, chat, game etc..But, at present intelligence move these application programs that can run in terminal be all download up from the Internet install file or from computer direct copying file is installed, the mobile terminal that cannot be provided with application program in the case of not linking the Internet from another obtains installation file up, such as, one mobile phone is mounted with that some is applied, but can not give another mobile phone by the installation sharing files of this application in the case of not linking the Internet.There is following defect in above downloading mode: down loading mounting software needs to connect the Internet, needs to use flow, uneconomical;From computer, directly copy software, downloaded software whenever and wherever possible cannot be accomplished again, very inconvenient.
Summary of the invention
The technical problem to be solved in the present invention is to provide a kind of easy to use, can mutually share the installation method of the local area network applications program installing file between multiple intelligent terminal in the case of not networking.
The technical solution of the present invention is, the sharing method of application program between mobile terminal is provided in a kind of LAN having steps of, shares second mobile terminal being provided with Android system of application program including the first mobile terminal being provided with Android system and request actively sharing application program;The method comprises the following steps:
One, the application program of the first mobile terminal is opened;
Two, by androidsdk(Android SDK) in the info class of PackageInfo(application package) class is applied program application.flags(application program labelling) and value X and application.FLAG_SYSTEM (FLAG_SYSTEM refer to application be positioned at/system/app under labelling) value Y;Then judge whether the application journey in the first described mobile terminal is that user installs voluntarily according to value X and value Y;The application program that user installs voluntarily can be shared with the second described mobile terminal;The application program that first mobile terminal system carries can not be shared with the second described mobile terminal;Concrete judgment mode is as follows:
(1) if value X≤0 obtained and value Y≤0, then judge that this application program is that user installs voluntarily, can share;
(2) if value X≤0 obtained and value Y > 0, then judge that this application program is the program of system, it is impossible to share;
(3) if the value X > 0 obtained and value Y≤0, then judge that this application program is the program of system, it is impossible to share;
(4) if the value X > 0 obtained and value Y > 0, then judge that this application program is the program of system, it is impossible to share;
Three, obtain sharing the list of application program by step 2, use file copying method by the installation document copy of application program that can share to SD card;Then the storing path installing document of each application program is obtained;The physical address of the installation document storing according to the application program obtained, generates the http(hyper text protocol that can download) address that accesses, and this address is the most dynamically generated the download address of Quick Response Code;
Four, the second described mobile terminal is according to the http(hyper text protocol generated) download address of download address or Quick Response Code all can download the installation document of application program.
After using above structure, in the LAN of the present invention, the sharing method of application program between mobile terminal, compared with prior art, has the advantage that
Due to the sharing method of application program between mobile terminal in the LAN of the present invention, as long as user is in same LAN, without being connected into the Internet, use httpservice technology generate application program that in the first described mobile terminal, user installs voluntarily http download address and Quick Response Code, the second described mobile terminal downloads application program according to the http download address generated or Quick Response Code, directly can download application program above the mobile terminal of the other side, mobile terminal is made to eliminate the flow downloading application program, without the software that removal search of taking time is corresponding, greatly facilitate user and share speed and the effect of application program, bring convenience to the user of mobile terminal.
Detailed description of the invention
In the LAN of the present invention, between mobile terminal, the sharing method of application program includes that the first mobile terminal being provided with Android system actively sharing application program shares second mobile terminal being provided with Android system of application program with request, the first described mobile terminal and the second mobile terminal refer to can be between two mobile terminals, it is also possible to be between multiple mobile terminal.The method comprises the following steps:
One, the application program of the first mobile terminal is opened.
Two, it is applied value X of program application.flags and value Y of application.FLAG_SYSTEM by PackageInfo class in androidsdk;Then judge whether the application program in the first described mobile terminal is that user installs voluntarily according to value X and value Y;The application program that user installs voluntarily can be shared with the second described mobile terminal;The application program that first mobile terminal system carries can not be shared with the second described mobile terminal.Concrete judgment mode is as follows:
(1) if value X≤0 obtained and value Y≤0, then judge that this application program is that user installs voluntarily, can share;
(2) if value X≤0 obtained and value Y > 0, then judge that this application program is the program of system, it is impossible to share;
(3) if the value X > 0 obtained and value Y≤0, then judge that this application program is the program of system, it is impossible to share;
(4) if the value X > 0 obtained and value Y > 0, then judge that this application program is the program of system, it is impossible to share;
Three, obtain sharing the list of application program by step 2, use file copying method by the installation document copy of application program that can share to SD card;Then the installation document storing path of each application program is obtained;The physical address of the installation document storing according to the application program obtained, produces the address that the http that can download accesses, and this address is the most dynamically produced the download address of Quick Response Code.The described Quick Response Code that dynamically produces refers to, the wifi network that mobile terminal connects every time is obstructed, so the IP address got also can be different, it is that the address that on IP and SD, application program preserves is formed that generation can access the http address of download, and Quick Response Code is constantly in change with the IP address got.
Four, the second described mobile terminal all can download the installation document of application program according to the download address of the http download address generated or Quick Response Code.
Use above method to share application program, as long as two mobile terminals are all in same LAN, just can mutually share the application program that user in mobile terminal installs voluntarily, very easy to use.Described mobile terminal can be smart mobile phone etc..