android实现课程表文字表达
① 你好,我想请教一下如何在安卓课程表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/ 游戏类