當前位置:首頁 » 學校課程 » android實現課程表文字表達

android實現課程表文字表達

發布時間: 2021-03-14 14:33:10

① 你好,我想請教一下如何在安卓課程表APP中添加一個備忘錄功能,具體應該怎麼實現,謝謝了

單擊某一天的 然後跳轉到一個界面 然後就是添加備忘信息 然後把信息 寫到資料庫 每次啟動程序的時候 去資料庫查詢一下

② 想實現以下功能:我有一個課程表,我設置了button,點擊button可以篩選出周六的課程。android如何實現。

這是基本的功能啊,sqlite資料庫存儲數據,sql查詢

③ 基於android課程表怎麼獲取課表

開發過程
一開始因為畢設有關課程表的要求不明,主要就是利用jsoup拉取學校教務管理系統的課程數據進行課程表界面的填充顯示,並不能課程的個性化調整。
後來重新調整了需求,參考了超級課程表的功能。重新設計了實體類,利用bmob移動端雲作為爬取到的數據的數據伺服器進行了重新的開發。
主要代碼
1、課程實體類
package com.mangues.coursemanagement.bean;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import cn.bmob.v3.BmobObject;

public class CourseBean extends BmobObject implements Serializable {
public static final String TAG = "CourseBean";

private String studentId;
private String dataYear;
private String dataTerm;

private String courseName = ""; //課程名
private String courseRoom = ""; //教室
private String courseTeacher = ""; //老師
//private String courseWeekNumber = "0";
private ArrayList<Integer> courseWeekNumber = new ArrayList<>(); //周數
private int courseWeek = 0; //星期幾上課
private int courseLow = 0; //第幾排
private int courseSection = 0; //延續幾節課
//private String courseSection = "12"; //第幾節上課1,2,12(2節課)
//private String courseIn = "3"; //單雙周 1(單),2(雙),3(全)
public CourseBean() {
super();
}

public void setCourseBase(String studentId, String dataYear, String dataTerm) {
this.studentId = studentId;
this.dataYear = dataYear;
this.dataTerm = dataTerm;
}

public CourseBean(String courseName, String courseRoom, String courseTeacher, ArrayList<Integer> courseWeekNumber, int courseWeek, int courseLow, int courseSection) {
this.courseName = courseName;
this.courseRoom = courseRoom;
this.courseTeacher = courseTeacher;
this.courseWeekNumber = courseWeekNumber;
this.courseWeek = courseWeek;
this.courseLow = courseLow;
this.courseSection = courseSection;
}

/**
* str 數據到bean
* @Name: stringToBean
* @param str
* @return
* @Time: 2015-12-21 上午11:00:57
* @Return: CourseBean
*/
public static CourseBean stringToBean(String str) {
return toBean(str);
}

//輔助
private static CourseBean toBean(String courseDatas){
CourseBean bean = null;
String[] courseData = courseDatas.split("◇");
if(courseData.length>3){ //有數據
bean = new CourseBean();
String courseName = courseData[0];
String courseRoom = courseData[2];
//獲取上課周數
findWeekNumberFromStr(courseData[1],bean);
bean.setCourseName(courseName);
bean.setCourseRoom(courseRoom);
findCourseInFromStr(courseData[4],bean);
}
return bean;
}

/**
* 找出上課周數,老師名字
* @Name: findFromStr
* @return
* @Time: 2015-12-21 上午11:22:30
* @Return: String
*/
public static void findWeekNumberFromStr(String courseData,CourseBean bean){
Pattern pattern = Pattern.compile("(\\w*)\\((\\d+)-(\\d+)\\)");
Matcher matcher = pattern.matcher(courseData);
if(matcher.find()){
String teacher = matcher.group(1);
bean.setCourseTeacher(teacher);
String weekNumberstart = matcher.group(2);
String weekNumberfinish = matcher.group(3);
Integer weekNumberstartInt = Integer.parseInt(weekNumberstart);
Integer weekNumberfinishInt = Integer.parseInt(weekNumberfinish);
for (int i = weekNumberstartInt;i<=weekNumberfinishInt;i++){
bean.getCourseWeekNumber().add(i);
}
}
}

/**
* 找出 上課是不是單雙周,幾節課
* @Name: findCourseInFromStr
* @param courseData
* @return
* @Time: 2015-12-21 下午1:29:05
* @Return: String
*/
public static void findCourseInFromStr(String courseData,CourseBean bean){
Pattern pattern = Pattern.compile("(\\w*)\\{(\\d*)節\\}");
Matcher matcher = pattern.matcher(courseData);
if(matcher.find()){
String str = matcher.group(1);
ArrayList<Integer> list = bean.getCourseWeekNumber();
switch (str) {
case "單周":
for (int i = 0;i< list.size();i++){
Integer weekNumber = list.get(i);
if (weekNumber%2==0){ //移除偶數
bean.getCourseWeekNumber().remove(i);
}
}
break;
case "雙周":
for (int i = 0;i< list.size();i++){
Integer weekNumber = list.get(i);
if (weekNumber%2!=0){ //移除奇數
bean.getCourseWeekNumber().remove(i);
}
}
break;
default:
break;
}
String str2 = matcher.group(2);
String[] args = str2.split("");
if (args.length==3){
Integer integer = Integer.parseInt(args[1]);
Integer integer2 = Integer.parseInt(args[2]);
bean.setCourseLow(integer);
bean.setCourseSection(integer2-integer+1);

}else if (args.length==4){
Integer integer = Integer.parseInt(args[1]);
Integer integer2 = Integer.parseInt(args[2]+args[3]);
bean.setCourseLow(integer);
bean.setCourseSection(integer2-integer+1);

}else if (args.length==5){
Integer integer = Integer.parseInt(args[1]+args[2]);
Integer integer2 = Integer.parseInt(args[3]+args[4]);
bean.setCourseLow(integer);
bean.setCourseSection(integer2-integer+1);

}else if (args.length==2){
Integer integer = Integer.parseInt(args[1]);
bean.setCourseLow(integer);
bean.setCourseSection(1);
}

}
}

public String getCourseName() {
return courseName;
}

public void setCourseName(String courseName) {
this.courseName = courseName;
}

public String getCourseRoom() {
return courseRoom;
}

public void setCourseRoom(String courseRoom) {
this.courseRoom = courseRoom;
}

public String getCourseTeacher() {
return courseTeacher;
}

public void setCourseTeacher(String courseTeacher) {
this.courseTeacher = courseTeacher;
}

public ArrayList<Integer> getCourseWeekNumber() {
return courseWeekNumber;
}

public void setCourseWeekNumber(ArrayList<Integer> courseWeekNumber) {
this.courseWeekNumber = courseWeekNumber;
}

public int getCourseWeek() {
return courseWeek;
}

public void setCourseWeek(int courseWeek) {
this.courseWeek = courseWeek;
}

public int getCourseLow() {
return courseLow;
}

public void setCourseLow(int courseLow) {
this.courseLow = courseLow;
}

public int getCourseSection() {
return courseSection;
}

public void setCourseSection(int courseSection) {
this.courseSection = courseSection;
}

public String getStudentId() {
return studentId;
}

public void setStudentId(String studentId) {
this.studentId = studentId;
}

public String getDataYear() {
return dataYear;
}

public void setDataYear(String dataYear) {
this.dataYear = dataYear;
}

public String getDataTerm() {
return dataTerm;
}

public void setDataTerm(String dataTerm) {
this.dataTerm = dataTerm;
}
}

2、課程歸類處理

//按天查詢數據
private void getDayDate(List<CourseBean> list){
boolean boo = SaveUtil.getSharedPreferencesSwitch(mContext);
ArrayList<CourseBean> integerA = new ArrayList<>();
if (boo){
if (weekNum!=-1){
for (int l=0;l<list.size();l++){ //去除
ArrayList<Integer> integerArrayList = list.get(l).getCourseWeekNumber();
if (!integerArrayList.contains(weekNum)){ //不包含,就是不是本周,去除
integerA.add(list.get(l));
}
}
list.removeAll(integerA);

}
}

List<CourseBean> list1 = null;
Map<Integer,List<CourseBean>> map = new HashMap<>();

for (CourseBean be :list) {

Integer weekNum = be.getCourseWeek();
if (map.containsKey(weekNum)){ //有數據
list1 = map.get(weekNum);
}else {
list1 = new ArrayList<>();
map.put(weekNum,list1);
}
list1.add(be);
}

ArrayList<CourseBeanMap> ls = new ArrayList<>();

//按星期幾處理
for (Map.Entry<Integer,List<CourseBean>> entry : map.entrySet()) {
List<CourseBeanMap> mapw = handleRepeat(entry.getValue(),entry.getKey());
ls.addAll(mapw);

}

//本地存儲存儲使用
TimeTableBmob bmob = new TimeTableBmob();
bmob.setStudentId(CourseApplication.getInstance().getUserInfo().getStudentId());
bmob.setCourseList(ls);
bmob.setTerm(dataTerm);
bmob.setYear(dataYear);
CourseApplication.getInstance().setTimeTableBmob(bmob);

dataBack.onDataBack(ls);
}

//處理重復
private List<CourseBeanMap> handleRepeat(List<CourseBean> list,Integer weekNum){

Collections.sort(list,new Comparator<CourseBean>(){
public int compare(CourseBean arg0, CourseBean arg1) {
Integer year1 = arg0.getCourseLow();
Integer year2 = arg1.getCourseLow();
return year1.compareTo(year2);
}
});

List<CourseBeanMap> listKey = new ArrayList<>();
List<String> liststr = new ArrayList<>();

int size = list.size();

for (int h=0;h<list.size();h++){
CourseBean bean = list.get(h);
Integer low = bean.getCourseLow();
Integer sesson = bean.getCourseSection();
Boolean isAdd = false;

④ android 怎麼實現簡單課程表顯示

行為主義,來認知主義,建構主源義——三大基礎學習理論

教學設計中涉及到三大學習理論,行為主義學習理論、認知主義學習理論和建構主義學習理論。相應的教學設計也經歷了行為主義教學設計、認知主義教學設計和建構主義教學設計階段。

1.行為主義:基於可觀察的行為上的變化,行為主義關注對某一行為的重復,直至它變為自動、無意識的。

2.認知主義:基於行為背後的思維過程,我們觀察到的行為可用來分析了學習者內心的變化。

⑤ android如何開發課程表應用用神馬控制項

是要做一個應用軟體還是就做一張表?
只做表的話用TextView就好了吧。回
歡迎答來我的BLOG: http://blog.csdn.net/dbkmeteor

⑥ 高分求一個Android手機課程表軟體的源代碼,畢業設計參考用,時間不多,求大神們速度,感激不盡

給一個android源碼下載地址,裡面有很多的相關源碼可供下載: 一、Android開發圖書推薦:http://book.apkbus.com/ 二、Android開發精選源碼推薦:http://demo.apkbus.com/ 三、Android 開發 UI設計http://www.apkbus.com/design/ 四、 Android開發系列教程合集http://dev.apkbus.com/ 五、Android開發入門到精通http://android.apkbus.com/ 游戲類

熱點內容
武漢大學學生會輔導員寄語 發布:2021-03-16 21:44:16 瀏覽:612
七年級學生作文輔導學案 發布:2021-03-16 21:42:09 瀏覽:1
不屑弟高考成績 發布:2021-03-16 21:40:59 瀏覽:754
大學畢業證會有成績單 發布:2021-03-16 21:40:07 瀏覽:756
2017信陽學院輔導員招聘名單 發布:2021-03-16 21:40:02 瀏覽:800
查詢重慶2018中考成績查詢 發布:2021-03-16 21:39:58 瀏覽:21
結業考試成績怎麼查詢 發布:2021-03-16 21:28:40 瀏覽:679
14中醫醫師資格筆試考試成績查分 發布:2021-03-16 21:28:39 瀏覽:655
名著賞析課程標准 發布:2021-03-16 21:27:57 瀏覽:881
北京大學商業領袖高端培訓課程 發布:2021-03-16 21:27:41 瀏覽:919