最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

簡單實(shí)現(xiàn)Android學(xué)生管理系統(tǒng)(附源碼)

 更新時(shí)間:2015年12月11日 14:15:58   作者:徐劉根  
這篇文章主要介紹了如何簡單實(shí)現(xiàn)Android學(xué)生管理系統(tǒng),特別適合計(jì)算機(jī)專業(yè)的即將畢業(yè)的同學(xué)學(xué)習(xí)借鑒制作學(xué)生管理系統(tǒng),感興趣的小伙伴們可以參考一下

本文實(shí)例講述了Android實(shí)現(xiàn)學(xué)生管理系統(tǒng),分享給大家供大家參考。具體如下:

(1)管理系統(tǒng)實(shí)現(xiàn)的功能主要是:學(xué)生、教師的注冊登錄,和選課,以及修改學(xué)生的成績等基本簡單的功能,最主要的是實(shí)現(xiàn)一些Dialog的使用。
界面如下:

(2)主要代碼如下:(個(gè)人留作筆記,如需要完整代碼,在最下邊免費(fèi)下載)

下邊是一個(gè)適配器,適配器是為了一個(gè)listvie進(jìn)行設(shè)置值,其中加載的是一個(gè)itemview,適配器中還是用了繼承的方法,用于通知適配器進(jìn)行更新。

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;
 }

 /**
 * 通知adapter更新數(shù)據(jù)
 */
 @Override
 public void notifyDataSetChanged() {
 super.notifyDataSetChanged();
 }

 public View getView(int position, View convertView, ViewGroup parent) {

 if (convertView == null) {
 //這里加載的每一個(gè)item條目的布局文件
 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);

 // 獲得某一個(gè)位置的student
 Course course = coursetList.get(position);
 tv_name.setText(course.getStudentName() + "");
 tv_course.setText(course.getCourseName() + "");
 tv_score.setText(course.getCourseSocre() + "");

 return convertView;
 }

}

(3)還用到了Java的反射機(jī)制,結(jié)合工廠模式進(jìn)行操作:

public class PersonFactory {

 /**
 * 根據(jù)類的名稱來生產(chǎn)對象:java的反射機(jī)制使用
 * 
 * @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;
 }

 /**
 * 根據(jù)類型來創(chuàng)建對象
 */
 public PersonInter getHair(String key) {
 if ("student".equals(key)) {
 return new StudentImpl();
 } else if ("teacher".equals(key)) {
 return new TeacherImpl();
 }
 return null;
 }

 /**
 * 根據(jù)類的名稱來生產(chǎn)對象:java的映射
 */
 public PersonInter getPersonByClassKey(String key) {

 try {
 Map<String, String> 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;
 }
}

源碼下載: Android學(xué)生管理系統(tǒng)

希望本文所述對大家學(xué)習(xí)Android軟件編程有所幫助。

相關(guān)文章

最新評論

汉川市| 高安市| 叶城县| 凤冈县| 山阳县| 聂荣县| 武鸣县| 昔阳县| 天门市| 天镇县| 临沂市| 荥经县| 盐池县| 朝阳市| 通山县| 揭西县| 永德县| 左贡县| 黔江区| 广水市| 鹤峰县| 蒙阴县| 金溪县| 左权县| 黄骅市| 建瓯市| 东乡| 共和县| 凤山县| 南安市| 峨山| 九龙城区| 保德县| 炉霍县| 克东县| 白银市| 楚雄市| 南汇区| 长宁县| 沙田区| 土默特左旗|