CN105630513A - Framework building method and framework building device - Google Patents
Framework building method and framework building device Download PDFInfo
- Publication number
- CN105630513A CN105630513A CN201610097125.XA CN201610097125A CN105630513A CN 105630513 A CN105630513 A CN 105630513A CN 201610097125 A CN201610097125 A CN 201610097125A CN 105630513 A CN105630513 A CN 105630513A
- Authority
- CN
- China
- Prior art keywords
- framework
- volley
- data
- request
- interface
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Withdrawn
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/30—Creation or generation of source code
- G06F8/38—Creation or generation of source code for implementing user interfaces
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/30—Creation or generation of source code
- G06F8/31—Programming languages or programming paradigms
- G06F8/315—Object-oriented languages
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/30—Creation or generation of source code
- G06F8/36—Software reuse
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Human Computer Interaction (AREA)
- Computing Systems (AREA)
- Information Transfer Between Computers (AREA)
Abstract
The invention discloses a framework building method and a framework building device.In the framework building method, a network communication library Volley on the client side sends request data to a server; the server processes the request data and calls the data back to the Volley after data acquisition is completed, and the Volley converts the received callback data into corresponding entity-class objects for interface display and data library storage; the Volley stores the entity-class objects into a database and calls back an interface to refresh.The framework building method and the framework building device have the advantages that by means of integrating a basic service function SDK (software development kit) development framework, development efficiency is improved, development difficulty is reduced greatly, development time is shortened, software flow and a hierarchical structure are clearer and maintenance and expansion in a later period are facilitated greatly.
Description
Technical field
The present invention relates to the communications field, in particular to a kind of framework building method and device.
Background technology
Software development is played vital effect by framework, and it is just as the support of whole building, as long as the support of building has been put up remaining having only to and added brick cover tile. Good Software Architecture Frame can allow the functional development in later stage reach the effect got twice the result with half the effort, and the flow process simultaneously making software is apparent, hierarchical structure is clearly more demarcated, the later stage is more convenient for safeguards and expand.
Android (Android) application and development is mainly concerned with interface display, network data request and parsing, database manipulation etc. It is described separately below:
First, be all the code writing interface and the data control logic thereof presenting to user in the most of the time of application and development, can be appreciated that in Activity a lot of similar below code:
These codes seem quite similar, are entirely muscular labor for these codes repeating to write developer, it appears very dull. And due to the statement of control with initialize often interval large number of rows code, it is necessary to scroll-up/down could link up so that the readability of code is substantially reduced.
Second, network request is indispensable in the application, unless application is uniprocessor version, if developer oneself writes this partial code, then be required for the operation writing substantial amounts of code to carry out network in each place needing request network. Or these codes are packaged by developer oneself, the problem that so on the contrary can be avoided code redundancy, but owing to network request relates to a lot of factors needing to consider of repetitive requests control, request thread management, network-caching etc., due to developer's level limited or inconsiderate entirely, cause the BUG usually occurring being difficult to predict.
3rd, data base plays very important role in the application, and the data that application is commonly used all leave in data base, and database manipulation (including increase, deletion, amendment, inquiry etc.) is the basic art of programming that developer must grasp. But the encapsulation done in database manipulation, upgrading etc., also needs to developer at present and learns further.
As can be seen here, for concrete conventional business function, when not expending a large amount of human and material resources and time, how to realize Android client Quick Development Framework and build, be current problem demanding prompt solution.
Summary of the invention
Present invention is primarily targeted at the building method and device that disclose a kind of framework, at least to solve in correlation technique for concrete conventional business function, when not expending a large amount of human and material resources and time, it is achieved the problem that Android client Quick Development Framework is built.
According to an aspect of the invention, it is provided the building method of a kind of framework.
The building method of the framework according to the present invention includes: the network service storehouse Volley of client sends request data to server; At described server, described request data being processed, complete after data acquisition callback data to after described Volley, the callback data received is converted to the entity class object that interface display is corresponding with database purchase by described Volley; Described entity class object is stored data base and adjusts back interface refreshing by described Volley.
According to an aspect of the invention, it is provided a kind of framework build device.
The device of building of the framework according to the present invention includes: the first sending module, for sending request data to server; Processing module, for described request data is processed, completes after data acquisition callback data to described Volley; Memory module, for the callback data received is converted to the entity class object that interface display is corresponding with database purchase, stores described entity class object data base and adjusts back interface refreshing.
Compared with prior art, the embodiment of the present invention at least has the advantage that improve development efficiency by integrated basic service function SDK Development Framework greatly reduces development difficulty and development time, and the flow process simultaneously making software is apparent, hierarchical structure is clearly more demarcated, the later stage is more convenient for safeguards and expand.
Accompanying drawing explanation
Fig. 1 is the flow chart of the building method of framework according to embodiments of the present invention;
Fig. 2 is the flow chart of the building method of framework according to the preferred embodiment of the invention;
Fig. 3 is the flow chart building device of framework according to embodiments of the present invention; And
Fig. 4 is the flow chart building device of framework according to the preferred embodiment of the invention.
Detailed description of the invention
Below in conjunction with Figure of description, specific implementation of the present invention is made a detailed description.
Fig. 1 is the flow chart of the building method of framework according to embodiments of the present invention. As it is shown in figure 1, the building method of this framework includes:
Step S101: the network service storehouse Volley of client sends request data to server;
Step S103: above-mentioned request data is processed at above-mentioned server, completes after data acquisition callback data to after above-mentioned Volley, and the callback data received is converted to the entity class object that interface display is corresponding with database purchase by above-mentioned Volley;
Above-mentioned entity class object is stored data base and adjusts back interface and refresh by step S105: above-mentioned Volley.
Adopt the building method of the framework shown in Fig. 1, decrease the work of developer, adopt third party SDK to realize whole operation flow, greatly reduce development difficulty and development time.
Wherein, the network service storehouse Volley in Android platform, network service can be made faster, more simply, more healthy and stronger. It provide a lot of function easily such as the asynchronous download of JSON, image etc.; The sequence (scheduling) of network request; The priority processing of network request; Buffer memory; Multi-level cancellation is asked; Linkage (simultaneously cancelling all-network request when Activity terminates) etc. with Activity and life cycle. Owing to network request is essentially all employing Json to transmit data, if it is very big that developer oneself writes this partial code workload, and easily make mistakes, therefore a lot of Json SDK (SDK) resolving and encapsulating is occurred in that, that wherein commonly uses has Gson, in addition, also have GreenDao, ORMlite etc. Every kind of SDK emphasis is different, but has all done good encapsulation in database manipulation, upgrading etc.
Preferably, above-mentioned Volley above-mentioned entity class object is stored data base and adjust back interface refresh may further include: above-mentioned Volley call GreenDao SDK above-mentioned entity class object is stored data base and adjust back interface refresh.
Preferably, before the above-mentioned Volley of client sends request data to server, it is also possible to including: write interface layout files, the dependence injection mode of butterknife framework is used to initialize interface control in application component Activity; Required parameter is packaged into JSON object by Gson framework; Packaged above-mentioned JSON object is sent to above-mentioned Volley, so that above-mentioned Volley initiates request according to the request type of above-mentioned JSON object.
Wherein, above-mentioned request type may include that POST; Type, GET type.
Preferably, before writing interface layout files, it is also possible to including: download above-mentioned butterknife framework, network service storehouse Volley, Gson framework, the jar bag of GreenDao framework or source code resource; The resource downloaded is imported in engineering, completes configuration work.
Further describe below in conjunction with example and above-mentioned be preferable to carry out process.
Fig. 2 is the flow chart of the building method of framework according to the preferred embodiment of the invention. As in figure 2 it is shown, the building method of this framework includes:
Step S201: complete interface layout files and write. Before performing step S201, it is necessary to perform some preparations, for instance, the up-to-date jar bag of butterknife, Volley, Gson and GreenDao or source code is downloaded from GitHub website. The resource downloaded being imported in engineering, so all of configuration is complete.
Step S203: use the dependence injection mode of butterknife framework to initialize interface control in Activity.
Step S205: required parameter is packaged into JSON object by Gson.
Step S207: JSON object is passed to Volley.
Step S209:Volley can initiate request according to request type (such as POST or GET).
Step S211: server receives request data and carries out logical process, adjusts back to client after completing data acquisition.
Step S213:Volley receives the readjustment parameter of server.
Step S215: it is the interface display entity class corresponding with database purchase that server is automatically adjusted back Parameters Transformation by Gson.
Step S217: readjustment interface is refreshed.
Step S219: entity class object is directly stored in data base with GreenDao.
Load control, server pull data by above-mentioned entrance interface, deposit data base, refresh the whole operation flow at interface, it is known that developer needs the thing done in fact little, and major part work all transfers to third party SDK to complete.
Fig. 3 is the flow chart building device of framework according to embodiments of the present invention. As it is shown on figure 3, the device of building of this framework includes: the first sending module 30, for sending request data to server; Processing module 32, for above-mentioned request data is processed, completes after data acquisition callback data to above-mentioned Volley; Memory module 34, for the callback data received is converted to the entity class object that interface display is corresponding with database purchase, stores above-mentioned entity class object data base and adjusts back interface refreshing.
Preferably, as shown in Figure 4, this memory module 34 may further include: call unit 340, is used for calling GreenDao framework and above-mentioned entity class object stores data base and adjusts back interface refreshing.
Preferably, as shown in Figure 4, said apparatus can also include: initialization module 36, after being used for writing interface layout files, uses the dependence injection mode of butterknife framework to initialize interface control in application component Activity; Package module 38, for being packaged into JSON object by required parameter by Gson framework; Second sending module 40, for sending packaged above-mentioned JSON object to above-mentioned Volley, so that above-mentioned Volley initiates request according to the request type of above-mentioned JSON object.
Preferably, above-mentioned request type can include but not limited to: POST type, GET type.
Preferably, as shown in Figure 4, said apparatus can also include: download module 42, for downloading above-mentioned butterknife framework, network service storehouse Volley, Gson framework, the jar bag of GreenDao framework or source code resource; Import module 44, import in engineering for the resource that will download, complete configuration work.
In sum, by above-described embodiment provided by the invention, improve development efficiency by integrated basic service function third party's SDK Development Framework and greatly reduce development difficulty and development time, the flow process simultaneously making software is apparent, hierarchical structure is clearly more demarcated, the later stage is more convenient for safeguards and expands.
The several specific embodiments being only the present invention disclosed above, but, the present invention is not limited to this, and the changes that any person skilled in the art can think of all should fall into protection scope of the present invention.
Claims (10)
1. the building method of a framework, it is characterised in that including:
The network service storehouse Volley of client sends request data to server;
At described server, described request data being processed, complete after data acquisition callback data to after described Volley, the callback data received is converted to the entity class object that interface display is corresponding with database purchase by described Volley;
Described entity class object is stored data base and adjusts back interface refreshing by described Volley.
2. method according to claim 1, it is characterized in that, described Volley described entity class object is stored data base and adjust back interface refresh include: described Volley call GreenDao SDK described entity class object is stored data base and adjust back interface refresh.
3. method according to claim 1, it is characterised in that before the described Volley of client sends request data to server, also include:
Write interface layout files, use the dependence injection mode of butterknife framework to initialize interface control in application component Activity;
Required parameter is packaged into JSON object by Gson framework;
Packaged described JSON object is sent to described Volley, so that described Volley initiates request according to the request type of described JSON object.
4. method according to claim 3, it is characterised in that described request type includes: POST type, GET type.
5. method according to claim 3, it is characterised in that before writing interface layout files, also include:
Download described butterknife framework, network service storehouse Volley, Gson framework, the jar bag of GreenDao framework or source code resource;
The resource downloaded is imported in engineering, completes configuration work.
6. a framework build device, it is characterised in that including:
First sending module, for sending request data to server;
Processing module, for described request data is processed, completes after data acquisition callback data to described Volley;
Memory module, for the callback data received is converted to the entity class object that interface display is corresponding with database purchase, stores described entity class object data base and adjusts back interface refreshing.
7. device according to claim 6, it is characterised in that described memory module farther includes: call unit, is used for calling GreenDao framework and described entity class object stores data base and adjusts back interface refreshing.
8. device according to claim 6, it is characterised in that also include:
Initialization module, after being used for writing interface layout files, uses the dependence injection mode of butterknife framework to initialize interface control in application component Activity;
Package module, for being packaged into JSON object by required parameter by Gson framework;
Second sending module, for sending packaged described JSON object to described Volley, so that described Volley initiates request according to the request type of described JSON object.
9. device according to claim 8, it is characterised in that described request type includes: POST type, GET type.
10. device according to claim 8, it is characterised in that also include:
Download module, for downloading described butterknife framework, network service storehouse Volley, Gson framework, the jar bag of GreenDao framework or source code resource;
Import module, import in engineering for the resource that will download, complete configuration work.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610097125.XA CN105630513A (en) | 2016-02-23 | 2016-02-23 | Framework building method and framework building device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610097125.XA CN105630513A (en) | 2016-02-23 | 2016-02-23 | Framework building method and framework building device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN105630513A true CN105630513A (en) | 2016-06-01 |
Family
ID=56045503
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610097125.XA Withdrawn CN105630513A (en) | 2016-02-23 | 2016-02-23 | Framework building method and framework building device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105630513A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109445777A (en) * | 2017-12-29 | 2019-03-08 | 贵阳朗玛信息技术股份有限公司 | Development Framework and method based on the multiple customed products of Android platform |
CN110874380A (en) * | 2018-08-14 | 2020-03-10 | 山东华软金盾软件股份有限公司 | Method and system for refreshing interface based on mobile terminal database |
CN111399837A (en) * | 2020-04-01 | 2020-07-10 | 中电万维信息技术有限责任公司 | Questionnaire survey development method based on android system |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9208253B2 (en) * | 2011-11-09 | 2015-12-08 | Cellco Partnership | Efficient transfer of web content to different user platforms |
CN105302562A (en) * | 2015-11-09 | 2016-02-03 | 深圳市宏辉智通科技有限公司 | Software development system and mode based on template design under Android platform |
-
2016
- 2016-02-23 CN CN201610097125.XA patent/CN105630513A/en not_active Withdrawn
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9208253B2 (en) * | 2011-11-09 | 2015-12-08 | Cellco Partnership | Efficient transfer of web content to different user platforms |
CN105302562A (en) * | 2015-11-09 | 2016-02-03 | 深圳市宏辉智通科技有限公司 | Software development system and mode based on template design under Android platform |
Non-Patent Citations (3)
Title |
---|
匿名: "Android Studio 生成 ButterKnife 注入的插件", 《CSDN网站》 * |
匿名: "Android网络框架-Volley(四) 使用get和post方法发送json请求", 《CSDN网站》 * |
匿名: "整合volley+greendao+gson,让android开发变得非常容易", 《CSDN网站》 * |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109445777A (en) * | 2017-12-29 | 2019-03-08 | 贵阳朗玛信息技术股份有限公司 | Development Framework and method based on the multiple customed products of Android platform |
CN109445777B (en) * | 2017-12-29 | 2022-10-28 | 贵阳朗玛信息技术股份有限公司 | Development framework and method for multiple customized products based on Android platform |
CN110874380A (en) * | 2018-08-14 | 2020-03-10 | 山东华软金盾软件股份有限公司 | Method and system for refreshing interface based on mobile terminal database |
CN111399837A (en) * | 2020-04-01 | 2020-07-10 | 中电万维信息技术有限责任公司 | Questionnaire survey development method based on android system |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111176802B (en) | Task processing method and device, electronic equipment and storage medium | |
CN112162753B (en) | Software deployment method, device, computer equipment and storage medium | |
EP2437524A1 (en) | M2m service platform and work method thereof | |
CN108694564B (en) | Task state control method and device | |
CN110187902B (en) | Project transformation method, device, equipment and storage medium based on spring boot | |
GB2589658A (en) | Method and apparatus for running an applet | |
CA2915620A1 (en) | Method and apparatus for code virtualization and remote process call generation | |
US10521199B2 (en) | System and method for developing mobile based applications using model driven development | |
CN105630513A (en) | Framework building method and framework building device | |
CN106357791A (en) | Method, device and system for processing services | |
CN110069247A (en) | A kind of development approach and device, application method and device of application program | |
CN112035112A (en) | Application program development method, system, medium and electronic device | |
CN106775668A (en) | The mobile applications Development Framework and implementation method of cross operating system | |
CN109857374B (en) | Development method and device of mobile application | |
CN113127000B (en) | Compiling method, compiling device, compiling equipment and compiling storage medium for application program component | |
CN114547604A (en) | Application detection method and device, storage medium and electronic equipment | |
CN109634758A (en) | Method and middleware platform based on JSON document control event and behavior | |
CN105975265B (en) | A kind of device based on modified MVP mode | |
CN114115884A (en) | Management method and related device for programming service | |
CN112241373A (en) | Automatic test method, test device, processor and test system | |
CN116382718A (en) | Code offline deployment method and device, computer equipment and storage medium | |
CN108804088B (en) | Protocol processing method and device | |
CN110399130A (en) | A kind of APP skin change method based on android system | |
Korchi et al. | Classification of existing mobile cross-platform approaches | |
CN114020414A (en) | Symbiotic method and device of Android system and bottom layer Linux, electronic equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
WW01 | Invention patent application withdrawn after publication | ||
WW01 | Invention patent application withdrawn after publication |
Application publication date: 20160601 |