An Android group notification app's data frame

Source: Internet
Author: User
Tags format definition

Project Address: Https://github.com/wlkdb/GA_network_info

Click to open link


1, the entire app is divided into android client, Java Server and data layer, the client and the server call the data layer to complete data-related functions.


Data layer includes data format, data network transmission, database reading and writing.



2, the data format module defines a series of data classes, each containing its corresponding parameters and methods, and its database read and write interactive method is also in it. There is also an info class responsible for storing the data currently being processed and some string constants.



3, the network transmission module first defines an abstract class, as the parent class of other network transmission classes, which defines the basic parameters and methods of network transmission.



On this basis, a series of classes are defined to deal with specific network transmission tasks, mainly implementing the Run_clienttoserver () and Run_servertoclient () methods. Client Calls Run_clienttoserver (), the server calls run_servertoclient ().




in the run_servertoclient () then invokes the method in the corresponding database module to read and write to the database.




In addition, network_factory is defined in the network communication module, which can invoke the corresponding network communication class according to the string, so as to make the server handle the client's request conveniently.




Also defines an abstract class Networkendab to the client implementation, whose Isend () method is called at the end of the Network_ab's Clienttoserver () method to allow the client to respond to the data returned by the service side.



4, the database module also first defines an abstract class Dbab, sets the basic parameters and methods, on this basis defines a series of classes to process the specific data.




The database reading and writing method in the corresponding data format is called in the specific processing.




5, as shown above, the data layer of the project includes data format definition, data network transmission and database reading and writing, on this basis to develop the client and the server is very easy. This data layer can also be reused in other Android apps that need to handle more data, and is now open source with the following address:
Https://github.com/wlkdb/GA_network_info

Click to open link

An Android group notification app's data frame

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.