Simple implementation of the Android Student management system (with source code) _android

Source: Internet
Author: User
Tags reflection

This article describes the implementation of the Android student management system, sharing for everyone to reference. Specifically as follows:

(1) The functions of the management system are as follows: Students, teachers registration, and elective courses, as well as the revision of students ' performance and other basic simple functions, the most important thing is to achieve some dialog use.
The interface is as follows:

(2) The main code is as follows: (personal notes, such as the need for complete code, at the bottom of the free download)

The bottom is an adapter that sets the value for a listvie that is loaded with a itemview, and an inherited method is used in the adapter to notify the adapter to update.

public class Courseadapter extends Baseadapter {private context context;

 Private list<course> coursetlist;
 Public Courseadapter (context context, list<course> coursetlist) {this.context = context;
 This.coursetlist = coursetlist;
 public int GetCount () {return coursetlist.size ();
 Public Object getitem (int position) {return coursetlist.get (position);
 public long getitemid (int position) {return position;
 /** * Notify Adapter UPDATE Data * * * @Override public void notifydatasetchanged () {super.notifydatasetchanged (); Public View GetView (int position, View Convertview, ViewGroup parent) {if (Convertview = null) {//Every item item loaded here
 Layout file Convertview = Layoutinflater.from (context). Inflate (R.layout.student_score_item, NULL);
 } TextView Tv_name = (TextView) Convertview.findviewbyid (r.id.tv_name);
 TextView Tv_course = (TextView) convertview. Findviewbyid (R.id.tv_course); TextView Tv_score = (TextView) Convertview.findviewbyid (R.id.tv_score);

 To obtain a position of student Course Course = coursetlist.get (position);
 Tv_name.settext (Course.getstudentname () + "");
 Tv_course.settext (Course.getcoursename () + "");

 Tv_score.settext (Course.getcoursesocre () + "");
 return convertview;

 }

}

The

(3) also uses the Java reflection mechanism to operate in conjunction with the factory pattern:

The public class Personfactory {/** * produces objects based on the name of the class: Java reflection mechanism uses * * @param className * * @return * * Public personinter Getpersonbyclass (String className) {try {personinter personinter = (personinter) class.forname (className). newinstance
 ();
 return personinter;
 catch (Instantiationexception e) {e.printstacktrace ();
 catch (Illegalaccessexception e) {e.printstacktrace ();
 catch (ClassNotFoundException e) {e.printstacktrace ();
 return null; /** * Create object by Type/public Personinter Gethair (String key) {if (' Student '. Equals (key)) {return new Studentimpl ()
 ;
 else if ("Teacher". Equals (Key)) {return new Teacherimpl ();
 return null; /** * produces objects based on the name of the class: Java Mapping/public personinter Getpersonbyclasskey (String key) {try {map<string, String&gt ;

 Map = new Propertiesreader (). GetProperties ();
 Personinter person = (personinter) class.forname (Map.get (Key)). Newinstance ();
 return person;
 catch (Instantiationexception e) {e.printstacktrace ();catch (Illegalaccessexception e) {e.printstacktrace ();
 catch (ClassNotFoundException e) {e.printstacktrace ();
 return null;
 }
}

SOURCE Download: Android Student Management system

I hope this article will help you learn about Android software programming.

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.