Design and Implementation of Campus Competition Information Sharing Platform Based on Android

At present, the market share of the Android system in the smartphone operating system has reached 90%. In view of the limitations of the existing sharing platform for campus competition information, a campus APP, which integrates competition and activity information release, information sharing and interrogative interaction, is put forward. In this paper, the overall architecture design, function module design, database design and RESTful API design are carried out. The Java language and MVP pattern are used by Android part. Python language, RESTful architecture and ORM technology are used at the backend to realize the information of publishing competition information, the list of competition information, the information of search competition and the management of competition information. The platform is running on the North Campus of Guizhou University, the current operation


Introduction
At present, enterprises and institutions in our country have higher and higher requirements for the comprehensive practical ability of college students. Participating in professional competitions and activities during the university period is an important way to improve students' comprehensive practical ability and enrich campus life [1]. The platforms for publishing and sharing campus competition information and activity information include QQ group, super curriculum schedule and saikr, etc. The QQ group has simple functions, limited information and messy information. The super curriculum schedule takes the curriculum schedule as the main body and involves all kinds of information on campus and lacks professionalism. Saikr is facing the national competition platform for college students, which has space limitations.
According to the market share data of smart phone system released by Gartner, a famous market research company in 2017, Android system share has reached 86% [2]. Therefore, in view of the various limitations of the current campus event information platform, this paper proposes a campus competition information sharing platform based on Android operating system. Through this platform, students' enthusiasm for participating in competition activities can be improved, and students' comprehensive practical ability and experience can be improved.

Introduction of related technology
The Android -based campus event information sharing platform mainly uses three technical frameworks: MVP pattern, RESTful architecture and ORM technology.
(1) MVP pattern MVP pattern refers to Model, View and Presenter [3]. MVP patterns have evolved from the classic MVC patterns, they have similar ideas. Controller / Presenter is responsible for logical processing, Model is responsible for providing data, and View is responsible for displaying. In Android projects, Activity and Fragment occupy most of the development work. MVP pattern is the code used to optimize activity and fragment. The advantage of MVP pattern is that the model is completely separated from the view, it is not affected by the model when modifying the view, and the model can be used more efficiently [4] .
(2) RESTful architecture REST [5,6] (Representational State Transfer, which represents the layer state transition) is a set of architectural constraints and principles. An application or design that meets these constraints and principles is RESTful, and an API that conforms to REST architecture is called RESTful API. The RESTful API has three important features [7,8]: First, make full use of the semantics of the HTTP protocol itself to regulate the use of request actions. RESTful uses the standard HTTP method and there are four commonly used methods: GET, POST, PUT and DELETE. Second, exposed resources exist, and the URI transparently displays the requested resource. Third, the RESTful API is stateless, regardless of context and current state, greatly reducing complexity.
(3) ORM technology ORM (Object Relational Mapping) is used to implement the conversion between data of different types of systems in the object-oriented programming language [9]. In effect, ORM technology can create virtual object database in programming language and add, delete, modify and query mapping objects. There is no need to write SQL statements, which greatly simplifies program development and effectively avoids SQL injection vulnerabilities.
3 Design of campus competition information sharing platform 3

.1 Overall architecture design
This platform is developed with a layered architecture, which can reduce the coupling degree between layers as much as possible to ensure that there will be no mutual interference in the development process and improve work efficiency. The overall architecture design of this platform is shown in figure 1. It can be seen from the figure that the system architecture is divided into a Data Layer and an APP Layer. The back-end database uses MySQL, the development language uses Python, the database operation uses Python's third-party library SQLAlchemy, the back-end service uses Python's Web application framework Flask, and the unit test uses Python's third-party library Nose. Android is developed in Java language and adopts SSM framework and MVP design mode. The RESTful API is used for data interaction between Android and back-end.

Functional module design
The campus competition information sharing platform based on Android includes a client module and a background management module, and its functional module design is shown in figure 2.
(1) Client module. The main functions of the client module include user registration, user login, password retrieval, classified display of competition information, search for competition information, application for release authority, release of competition information, my attention, my collection, my information, information settings, viewing of competition details, etc.
(2) Background management module. The main functions of the background management module include user login, user management, system parameter management, competition information management, statistical analysis, etc.

Database design
According to the functional module design of the campus competition app, it is determined that the main entities in the platform are users, user information, search records, application information, collection information, forwarding information, praise information, comment information, competition information and competition tags. Part of the entity-relationship of the platform is shown in figure 3. According to entity-attribute analysis, the database  table of the platform mainly includes user table, user  information table, user authentication table, search record  table, application information table, competition  information table, competition label table, classification  table, picture table, attachment information table,  attention information table, collection information table,  forwarding information table, praise information table  and comment table. The fields in the competition information table include competition number, competition theme, competition release unit, registration or competition time, competition description, competition link, release time, classification number and user number. Competition number is primary key, category number and user number are foreign keys.

API design
This platform uses RESTful architecture style to design API. RESTful abstracts everything on the network into resources, each resource has a unique resource identifier URI. There are 46 APIs designed for the campus competition APP, including displaying the competition information list on the home page, applying for secondary administrator, forwarding the competition information, commenting on the competition information, displaying the competition information details, keyword search, tag search, publishing the competition information, displaying my favorite competition, super administrator reviewing the competition information and so on.
Due to limited space, we will only introduce the API design for displaying the competition information list on the home page, as shown in figure 4.

Implementation of campus competition information sharing platform
According to APP requirements, overall architecture design, database design and RESTful API design, Python language, ORM and Flask framework are used in the back end, and Java language, SSM framework and MVP pattern are used in the mobile end to encode and implement all functions in the platform function module design. Due to space constraints, the following only describes the Android end and back end implementation processes for displaying the competition list.

Implementation of Android side for displaying competition list
The interface for displaying the competition information list is shown in figure 5.  In MVP pattern, Presenter completely separates Model from View, and the main program logic is implemented in Presenter. Part of the code that implements the Presenter layer function fetchArticles ( ) displayed in the competition information list is as follows:

Implementation of back-end for displaying competition list
The back-end code implementation process for displaying the competition information list is shown in figure 7.

Conclusion
According to the actual needs of college students, this paper designs the overall architecture, functional modules, database and RESTful API of the campus competition information sharing platform. Android uses Java language and MVP pattern, while Python language, RESTful architecture and ORM technology are used in the back end to realize the functions of publishing event information, displaying event information list, searching event information and event information management. The platform has been put into trial operation in the north campus of Guizhou University and is now in good condition.