Design and Implementation of Henan Huinong Client System Based on iOS

In order to meet the demands of customers related to agriculture who can obtain some Comprehensive agricultural information service of Henan Province through the intelligent mobile terminal, on the base of the Zhong yuan Rural Information Port integrated platform, employing IOS, Java, Eclipse, XML, SAX technology, we designed and developed Henan Huinong client systems based on ios mobile terminal. This system has achieved the multiple applications, such as agricultural information browsing, network consulting, expert online, crop rermote diagnosis and so on.


Introduction
The smart phone, as a means of media, with characteristics of high penetration and portability, provides a new information transmission tool for information mobile services in rural areas as well as strong support for the innovation of rural information service. With the continuous rapid increase of smart phone holding quantity in rural areas and the increase of recognition rate of farmers on mobile phone information spreading, the launch of relevant softwares and services based on mobile phones is relatively lagging. Therefore, it is particularly urgent to develop the corresponding application softwares and provide relevant mobile services.
Henan Province, located in the middle east of China, is a province with the largest population, a large agricultural province, strong grain-producing province and large animal husbandry province, which plays an important strategic role in the overall situation of reform and development in China. Accelerating the informatization is a key strategy to promote the construction of Central Plains Economic Zone, realize the rising of central China and promote leapfrog development of Henan Province. Improving the rural information service level and accelerating the rural informatization is the only way to realize agricultural modernization, and the effective method of realizing the"Sanhua" coordinated and scientific development of "Sanhua" in Central Plains Economic Zone. In February 2012, the pilot work of constructing national rural informatization demonstration province performed by Henan Province was approved by the Ministry of Science and Technology, the CPC's Organization Department and the Ministry of Industry and Information. This paper, taking the implementation of provincial major special project "Development and Application of Key Technology of Henan Rural Information Integrated Service" as opportunity, based on the establishment of the Comprehensive Portal Platform of Central Plains Rural Information Port, and by means of the Huinong client software developed by Objective-C language and Xcode tool and suitable for smart phone of IOS platform, provides functions for smart phone users. These functions, based on the Comprehensive Portal Platform of Central Plains Rural Information Port, are about individual push of agricultural technology consultation, market directional push, agricultural information query as well as audio and video interaction.

Key Technologies
X Code is Apple's suite of development tools. It can be used to manage project, edit the code, structure the executable file, debug the source code level, manage the storage of source code, adjust the performance and so on. The core of the suite is XCode application itself, which is used to provide the development environment of source code. Key technologies that will be used in developing IOS software are as follows.

X code
X code is an integrated development environment, including processes from the establishment and management of the source file to chain programming of the source code to executable file, and operating the code in equipments, or debugging all the tools required for the code on the iPhone simulator.
When the Xcode is used to program applications, it can be connected with the iPhone simulator or equipment. Simulator provides the local environment for application tests. It also can be used to test whether the application has the correct behavior. When the basic behavior of application meets the expected goals, connect it with the equipment with Xcode, then operate the application on the IOS device which has been connected to the computer. The operation of the application on the equipment is the final test environment. During the process of the test, Xcode allows you to bound the built-in debugger to the code operated on the equipment, and to debug it directly on the equipment.

Simulator
The iPhone Simulator is a useful tool in the iPhone SDK, which can be used to test the application without using the actual iPhone/iPod Touch. Usually there's no need to start the iPhone Simulator directly-it will start automatically when the application is operated (or debugged) by the Xcode. Xcode will automatically install the application on the iPhone Simulator.
During the process of creating applications with Xcode, developers have to choose the iPhone simulator as well as the equipment when compiling these applications. The iPhone simulator provides a local application test environment. After passing the test on the iPhone simulator, the application can be compiled by Xcode and operated on the iPhone which has been connected to the computer. Operating the application on the iPhone provides the most comprehensive test environment. Xcode can track the code by the built-in debugger during the period of equipment testing.

Interface Builder
Interface Builder is built into user's interface by WYSIWYG. Through Interface Builder, drag the standard system control to the application window, and finally assemble user interface of the application program. You can use inspector to configure component properties, and establish correct association between subjects and codes. When user's interface meets the requirement, save it and save the contents of the interface to the nib file (a customized resource file format).
After using Interface Builder, you will no longer need to write custom codes when creating, configuring, and placing interface objects, because it is a kind of visual editor, the interface you see when editing is what you get in running.

Instruments
To ensure that the software provides the best user experience, when the IOS application routine is running on the emulator or device, can use Instruments environment to analyze its performance. Instruments will collect data of the running programs, and show the data in a time line. The collectible application data including application memory usage, disk activity, network activity, and graphics performance.

The Overall Design and Huinong Mobile Phone Client
Huinong mobile client is the extension of the central plains rural information platform PC access terminal, according to the characteristics of the central plains rural information port service platform, the main functions mobile phone client needs to provide are convenient, clear user interface and data storage and fetch. Moreover, according to the characteristics of mobile communication, the client also needs to actively connect the server through background services within the corresponding time period to get information, while upload data to make it convenient for the server to analyze the users' using custom, and make adjustment. Huinong mobile client can realize agricultural technology consulting personalized push, market orientation push, agricultural information query, audio and video interaction and other functions, the client module diagram is as shown in Fig. 1.

Figure1. Client Module Diagram
In Fig. 1, the business layer mainly provides agricultural policies and regulations information, agricultural market information (agricultural product supply and demand information, market prices, agricultural supplies, agricultural machinery prices, etc.) , agricultural foundational information (agricultural production knowledge: farming, forestry, animal husbandry and fishery), plant diseases and insect pests prevention and control knowledge, agricultural science knowledge (the common sense of science and technology, agriculture common sense, weather forecasting, etc.) and other agricultural information, these data all come from the background database of central plains rural information port platform. Through background service module, video diagnosis module, voice module and personalized push and custom module and other intelligent information processing platforms, the supporting layer can finally realize all kinds of agricultural information service, achieving agricultural information browsing, consulting, customization and push and other functions. Communication module realizes the communication between client and server, through wireless network on phones to make access to the servers on the Internet, through the communication module, the client calls WebService provided by the servers to get the data.
Huinong mobile client, based on central plains rural information port platform, provides a smart phone unified technology platform for agricultural information access and management for the majority of farmers, agricultural enterprises and agricultural experts. Through business interaction, business management, content management, statistical analysis and other functions with central plains rural information port platform, voice service system, video service system and other peripheral equipments, realized the service of browsing, consulting, customization of all kinds of agricultural information. The specific functions include: agricultural information, agricultural science and technology, agricultural application, agricultural trade, etc.

Interaction Method of Huinong Mobile Client and Server
The interaction of mobile client and server gets the data based on Http protocol, as shown in Fig. 2. Its working principle is to submit the client's request through a browser page to a Web application server, application server submits the received data to the server-side logic to process, then output the result to a Web page, the client program access website URL gets the data and makes analytical processing. According to client request, the server sends the corresponding data in the form of XML page to the browser. The client, after a visit to a web address, analyzes the obtained XML data and displays the results.

Data Interaction Method of Huinong Mobile Client
There are usually two methods for client data interaction: Json and XML. Json is a lightweight data interactive format, easy to read and write, also easy to parse and generate by machines at the same time, it is a subset based on JavaScript Programming Language Standard ECMA-262 3rd Edition-December 1999. Json uses a text format completely independent from language, but also uses custom similar to C language family. XML (extensible markup language) is a kind of language similar to HTML , it has no predefined tags, uses DTD (document type definition) document type definition to organize data, with unified format, cross-platform and cross-language, has become the industry recognized standards.
In this system, we designed to use XML files to solve the data format definition problem in network communication. XML (Extensible Markup Language) is a Standard released By W3C in February 1998, it beautifully integrated the rich functionality of SHML (Standard Generalized Markup Language) and the usability of HTML into Web applications, defined the data structure in an open and self description method. While describing the data content, it can also highlight the description of the structure, so as to reflect the relationship between the data, the data such organized are friendly and operational for both applications and users, because XML is described in text form, so it is suitable for data exchange of all kinds of platform environment, for the same reason, XML can also get over different platforms obstacle to make normal exchange.

Interface Design of Huinong Mobile Client
According to the division of Huinong mobile client function modules, The bulk of the designed service interface is as shown in Table 1. In Table 1, [] means optional parameters, plate means the current node id, page means that the current displayed page, the size means how many items showed on one page, the default is 10, area is the id of information supply and demand zone, attr is the category name, character type of the supplied and demanded information.

Data Storage Design on Huinong Mobile Phone Client
Because the data of Huinong mobile phone client all comes from the background database of info port platform in rural area of central China, and the mobile phone client doesn't need to save much data, so instead of individual database in mobile phone client, it just needs effective buffer memory space. Therefore, this client uses the open source components application Android-Universal-Image-loader from the third party, which can provide a reusable device to load, cache and display asynchronous image, it is also one of the most common open source libraries as well as the mainstream application, timing buffer memory release can be carried out with its deletion strategy.

Huinong Mobile Phone Client System Implementation
Relevant interfaces of the client are as shown in Fig. 3~Fig. 6. Consultation column: to be divided into three parts: important news on three agricultures, working trends, policies and regulations.
Science and Technology Column: to be divided into animal husbandry and veterinary medicine, food crop, economic crop, landscape and horticulture, agriculture products processing, can be access to the following content classification information on agricultural science and technology. Column: to be divided into hotline(integration of the third-party system, the web page link is provided by the third party, clicking to call directly), remote diagnosis (invoking the software system of the third party), weather service, price information, it can realize agricultural condition guiding, livestock and poultry guiding, disaster warning and agricultural meteorology, etc.
Business Column: It can show the name of products, name of market, time of delivery and supply and demand information.