Education Management System--android Parent Client

Source: Internet
Author: User

  Recently made a small Android project, the server has been set up, using spring MVC as a back-end technology, published a series of web interfaces to accept the data submitted by the client and return the data requested by the client, the Web side using Ext JS as the front-end technology. Also need an Android client and iOS client, temporarily developed an Android client, because the server-side interface has been written, Android this side only need to access these interfaces to get the data needed to display and submit data, development is not very difficult. Because the time is more urgent, so did not do detailed design, resulting in a lot of actually more redundant code, in fact, can be a good design to reduce the amount of code, good inheritance can be, this is a lesson, later in the development of object-oriented needs attention. In addition, there is no caching mechanism design, which means that all the data required by the application is taken at the server side when the user requests it, and the data is not saved locally, which reduces the complexity of the logic and facilitates the development speed. However, it is possible to change the buffer mechanism later.

The following is a brief description of the logic flow of the application, first of all the user must be logged in to authenticate to enter the application, the purpose is to reduce the complexity of business logic. When the user authentication successfully enters the application, will show the user Three tab, is the News Notice Tab,mytab,message tab, in which the news notice is used to display the school publishes the various news and the notice, my tab is to provide the user to inquire various information the place, A message is a place to view and send letters to the teacher in the station. Here is a description of the various components or mechanisms used in this.

Thread and handler: When the user does login verification or other operations that need to connect to the network, it is necessary to use thread to make a network connection using httpclient in thread, when the data transferred to the server is obtained and processed, Network threads work with the handler mechanism to synchronize data with threads that turn on a network thread, handler is generally passed to thread as an object in the main thread, so the UI in the main thread can be processed in handler. In Java, everything is an object, and thread also has a run function in thread that is the function that is executed after the start of threads, and the thread executes after the new thread in the main thread is called to start.

Fragment: Today's application, the UI is becoming more complex, the original simple in the activity to build the UI becomes less flexible, now wirelessly introduced the fragment mechanism, an activity can use multiple fragment to build the UI interface, This makes it easy to build complex UI interfaces in the life cycle of an activity without having to switch activity. Similar to the OnCreate method in activity, the Oncreateview in fragment is responsible for the primary work of fragment initialization, which returns a view of this fragment to the activity, Fragment also uses a layout file to initialize the interface, using the Inflater inflate method to initialize the interface.

ListView: This application mainly uses the ListView control to display data information, multiple ListItem to construct a Listview,listitem interface can be defined using a layout file, while the ListView has a AddHeader method, You can add a view to the ListView header to display it in the ListView. At the same time, the ListView can implement the Onscrolllistener interface to achieve the effect of the ListView drag.

Adapter: Adapters, like a ListView control, require an adapter to populate the data, and the adapter typically binds to a list data structure, and the Android system builds the number and content of the ListItem based on the size of the list.

The four controls described here are the more important four controls in the Android app, just a brief description of what is more complex than what is described here, and the specifics of the four controls that are described in more detail in time.

Education Management System--android Parent Client

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.