Design and Implementation of Track Record System Based on Android Platform

For the problem of losing and missing of vulnerable groups, a track record system is designed. The mobile terminal Android system is used as a platform, with the help of Auto Navi Map Android SDK positioning function, realize the positioning data acquisition of mobile terminals; using Apache Tomcat Server and MySQL database to build a Server which haves C/S(the client and the server) server architecture. The mobile terminal interacts with the server through the JSON data transmission mode based on the HTTP protocol, and the server saves the relevant information provided by the mobile terminal through the JDBC to the corresponding table in the database. It can be used to monitor the trace of the family and friends, compared with the PC terminal, it is not only more flexible, convenient and fast, but also has the characteristics of real-time and high efficiency. Through the test, all functions can be used normally.


Introduction
Android is based on Linux as the core of open source mobile terminal application software platform [1]. According to statistics, the year 2016 Android platform mobile phone global market share has reached 85%. This article to Android mobile terminal as a platform is also because of its openness, cross-platform and the use of breadth based on the choice.
In China, the annual missing children according to incomplete statistics there are about 200,000, and get them back in less than 0.1%, which does not include the lost old man [2]. The annual female college students and other vulnerable groups of missing events are frequently appear in our lives.This is the original purpose of the track record system in this article.The tracking system provides the location information of the stalker in real time with the SDK location function provided by Auto Navi Map.Use the Tomcat server and MySQL database to build the server side. Records, saves and calls the user's account information, the location information of the stalker, and the corresponding relationship of the user. It helps users monitor the movements of the elderly and children in the home, and then it helps prevent the loss of the vulnerable population.The track record system can be extended to all mobile intelligent terminal devices covered by the Android system, and it can be recorded in a fast, realtime and convenient location.

The overall structure of the track record system
In simple terms, track record system is the process of data collection and processing.It's a track record of the movements of the moving application, and the system is the type of C/S software.Compared with the traditional browser-based C/S software system type, we can avoid the fixed and complexity of traditional methods and make full use of mobile, real-time and flexible mobile devices. Figure 1 shows the overall structure of the track record system,and the server is the skeleton and core of the system,all data on the mobile terminal must interact and store data through the server side.For the mobile terminal,need to provide the information of objects, namely, the sending end will actually when positioning information saved to the server through the server database;then we can use the receiving end to read the stored data from the server to the sending end.The data from the system is based primarily on the mobile location.

Function design
According to the above system functional requirements analysis, the system mainly includes the following functions:registration/login, self-positioning, location information upload, receiver follow /unfollow sender, receiver select time period view the sender's track, lost prompt.As shown in Figure 2.

Figure 2. System main function
The positioning function of the track record system is mainly realized through the android SDK provided by the open platform of Auto Navi Map.In order to improve the positioning precision of the system, adopted based on the hybrid precise positioning of GPS + base + WiFi.The hybrid localization way has the advantage of millisecond response of milliamperes power, accuracy within 10 meters, is not only dependent on the GPS, break through the traditional mode of GPS positioning to the success of high power consumption, regional requirements open defect. No matter in the city or in the valley, skyscrapers can achieve more accurate positioning.

The overall service terminal design
The server is mainly composed of Apache server and MySQL database, and the peripherals include Android phone and PC [3].Overall framework of the server shown in Figure 3,the sender sends location data to the Apache server and stores the data through the MySQL database,receiver through port 80 to monitor the server, the data through the JSON format data interaction between them, the system administrator can through the PC to server maintenance.

The service terminal database structure design
Database is the support of data information for the entire design.According to the system's implementation, three tables are required in the database.The first table is used to save the user registration information, name it User. The main function is to record the user's account password, user type and phone number, and independent number for the above information.The second table is used to store information uploaded on the sending end,name it Path. The main function is to record the sender to upload the location of the longitude and latitude, name, phone remaining power and upload time.The last table is used to store the user relationship information, named Userinfo, mainly on the status of attention to real-time records, to avoid repeated attention. The other two tables create the same code, just slightly modified on the constraints.

The service terminal data preservation and interface design
The data is primarily saved through the service terminal, and the server is mainly used to interact with the data on the mobile terminal through the interface.The code is as follows:  The service terminal interaction with the mobile terminal in addition to the commonly used hypertext transfer protocol HTTP,JDBC, which is based on Java's API, is an important part in the database that the service terminal brings to the database through a network request.As shown in Figure 4,SQL statements can be easily transmitted to almost any database using JDBC,programs written in Java can automatically send SQL statements to the appropriate database server.This can be achieved through the addition and deletion of SQL statements to achieve service terminal interface and database data interaction process.So,the service terminal is mostly interacting with the mobile data through HTTP, through the JDBC implementation of the data interaction with the database,save the data collected on the mobile end to the database.

Mobile terminal software design
The mobile terminal of the track record system, namely the sender and receiver, need to be implemented on the intelligent terminal device, APP form implantation of the Android system.Considering the limitations of mobile terminal hardware and network factors, the complex data mainly processing realized through the service terminal.The main function of the mobile terminal is to locate data collection and transmission, user interface drawing and simple user data non-null verification.The main function is shown in figure 5 as follows:

Figure 5. Android mobile terminal software design
The function of locating data on the sender is based on the long connection method based on the HTTP protocol [4].Because all functions in the design of the amount of data transferred is less, and the data structure is relatively simple,so achieve the unity of data so all transmit and receive data via JSON data format [5,6].

Registration function test
Open the phone client, enter the registration interface, fill in the registration information, and submit it, and then click back to the login screen.Then enter the MySQL database to see the registration information has been written in the user table and whether the registration information is incorrect.The test results are shown in figure 6.Registered function after the test is available. Figure 6. Registration function test

Login function test
If enter the wrong username or password, the system cannot login,as shown in figure 7(a).If enter the correct username and password, login successfully and jump to the location map interface,as shown in figure 7(b).After testing, the login function can be used normally.

Location function test
Login the sender account, open the MySQL database, and see the latitude and longitude data is successfully written or not.As shown in figure 8,the real-time latitude and longitude data have been written into the database,the location function is normal.

Attention function test
The receiver can be attention/cancel attention to the sender, and can view the track of the sender at the selected time period.Login to the receiver account, click the "Attention" button in the upper right corner of the interface to enter the phone number who needs attention.If enter the wrong information or the phone was not registered,will receive a system prompt.Only when you enter the correct phone number, it will shows "success!",as shown in figure 9(a).Click "My attention" to list the phone number that has been concerned,click on the corresponding phone number and select the start and end times that you want to view,then user's trajectory will appear,as shown in figure 9(b).If you need to cancel attention, touch and hold the phone number, as shown in figure 9(c). After testing, the attention function can be used normally.

Lost prompt function test
Shut off the sender phone APP for 24 hours,that is,24 hours did not upload location data.View on the receiver,the system prompts the user is in a lost state,and show the user's last occurrence of the location and the remaining battery power,as shown in Figure 10.After testing, Lost prompt function can be used normally.

Epilogue
This paper presents a model of the inbound record system, which is embedded into mobile devices based on the Android platform.Achieve a location function of the mobile terminal through the Auto Navi Map open platform.Using Apache Tomcat server and MySQL database to build service terminal.System realized many functions such as the sender data preservation ,the receiver attention to the sender,data calling and view the sender's track. It can be used to monitor the trace of the family and friends,designed to protect children, the elderly and other vulnerable groups.Through the test,all functions can be used normally. Compared with the PC terminal, it is not only more flexible,convenient and fast,but also more real-time and high efficiency.