package com.example.dao;
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import com.example.model.Word;
import com.example.model.WordRecord;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.TreeMap;
public class WordRecordDao {
private DBOpenHelper helper;
private SQLiteDatabase db;
private Context context;
//构造方法
public WordRecordDao(Context context){
this.context=context;
}
//添加方法
public void add(WordRecord wordRecord) {
helper=new DBOpenHelper(context);
db=helper.getReadableDatabase();
ContentValues values=new ContentValues();
values.put("wordId", wordRecord.getWordId());
values.put("isFalse", wordRecord.getIsFalse());
values.put("isFlag", wordRecord.getIsFlag());
values.put("reperaNum", wordRecord.getReperaNum());
values.put("timeFirst", wordRecord.getTimeFirst());
values.put("timeFinish", wordRecord.getTimeFinish());
db.insert("tb_wordrecord",null,values);
//关闭数据库
db.close();
helper.close();
}
//更新方法
public void update(WordRecord wordRecord) {
helper=new DBOpenHelper(context);
db=helper.getReadableDatabase();
ContentValues values=new ContentValues();
values.put("wordId", wordRecord.getWordId());
values.put("isFalse", wordRecord.getIsFalse());
values.put("isFlag", wordRecord.getIsFlag());
values.put("reperaNum", wordRecord.getReperaNum());
values.put("timeFirst", wordRecord.getTimeFirst());
values.put("timeFinish", wordRecord.getTimeFinish());
db.update("tb_wordrecord",values,"wordId=?",new String[]{String.valueOf(wordRecord.getWordId())});
//关闭数据库
db.close();
helper.close();
}
//查找方法
public WordRecord find(Word word) {
helper=new DBOpenHelper(context);
db=helper.getReadableDatabase();
String sql="select * from tb_wordrecord where wordId=?";
Cursor cursor=db.rawQuery(sql,new String[]{String.valueOf(word.get_id())});
if (cursor.moveToNext()){
int _id=cursor.getInt(cursor.getColumnIndex("_id"));
int wordId=cursor.getInt(cursor.getColumnIndex("wordId"));
int isFalse=cursor.getInt(cursor.getColumnIndex("isFalse"));
int isFlag=cursor.getInt(cursor.getColumnIndex("isFlag"));
int reperaNum=cursor.getInt(cursor.getColumnIndex("reperaNum"));
long timeFirst=cursor.getLong(cursor.getColumnIndex("timeFirst"));
long timeFinish=cursor.getLong(cursor.getColumnIndex("timeFinish"));
WordRecord wordRecord =new WordRecord(_id,wordId,isFalse,isFlag,reperaNum,timeFirst,timeFinish);
//关闭游标和数据库
cursor.close();
db.close();
helper.close();
return wordRecord;
}
//关闭游标和数据库
cursor.close();
db.close();
helper.close();
return null;
}
//返回本难度所有背过的单词数据
public List<Word> getLearnedWords() {
List<Word> words_list=new ArrayList<Word>();
helper=new DBOpenHelper(context);
db=helper.getReadableDatabase();
SettingDao settingDao=new SettingDao(context);
String type=settingDao.getDifficulty();
String sql="select * from tb_word,tb_wordrecord where tb_word._id=tb_wordrecord.wordId and tb_word.wordType=? and reperaNum>0";
Cursor cursor=db.rawQuery(sql,new String[]{type});
while (cursor.moveToNext()){
int _id=cursor.getInt(cursor.getColumnIndex("wordId"));
int wordRank=cursor.getInt(cursor.getColumnIndex("wordRank"));
String headWord=cursor.getString(cursor.getColumnIndex("headWord"));
String sentences=cursor.getString(cursor.getColumnIndex("sentences"));
String usphone=cursor.getString(cursor.getColumnIndex("usphone"));
String ukphone=cursor.getString(cursor.getColumnIndex("ukphone"));
String syno=cursor.getString(cursor.getColumnIndex("syno"));
String phrases=cursor.getString(cursor.getColumnIndex("phrases"));
String tranCN=cursor.getString(cursor.getColumnIndex("tranCN"));
String tranEN=cursor.getString(cursor.getColumnIndex("tranEN"));
String wordType=cursor.getString(cursor.getColumnIndex("wordType"));
Word word=new Word(_id,wordRank,headWord,sentences,usphone,ukphone,syno,phrases,tranCN,tranEN,wordType);
words_list.add(word);
}
cursor.close();
db.close();
helper.close();
return words_list;
}
//返回本难度所有背过的单词数据
public List<Word> getLearnedWords(String type) {
List<Word> words_list=new ArrayList<Word>();
helper=new DBOpenHelper(context);
db=helper.getReadableDatabase();
String sql="select * from tb_word,tb_wordrecord where tb_word._id=tb_wordrecord.wordId and tb_word.wordType=? and reperaNum>0";
Cursor cursor=db.rawQuery(sql,new String[]{type});
while (cursor.moveToNext()){
int _id=cursor.getInt(cursor.getColumnIndex("wordId"));
int wordRank=cursor.getInt(cursor.getColumnIndex("wordRank"));
String headWord=cursor.getString(cursor.getColumnIndex("headWord"));
String sentences=cursor.getString(cursor.getColumnIndex("sentences"));
String usphone=cursor.getString(cursor.getColumnIndex("usphone"));
String ukphone=cursor.getString(cursor.getColumnIndex("ukphone"));
String syno=cursor.getString(cursor.getColumnIndex("syno"));
String phrases=cursor.getString(cursor.getColumnIndex("phrases"));
String tranCN=cursor.getString(cursor.getColumnIndex("tranCN"));
String tranEN=cursor.getString(cursor.getColumnIndex("tranEN"));
String wordType=cursor.getString(cursor.getColumnIndex("wordType"));
Word word=new Word(_id,wordRank,headWord,sentences,usphone,ukphone,syno,phrases,tranCN,tranEN,wordType);
words_list.add(word);
}
cursor.close();
db.close();
helper.close();
return words_list;
}
//返回本难度需复习的单词数据
public List<Word> getNeedReWords(int todayneedreview) {
List<Word> words_list=new ArrayList<Word>();
helper=new DBOpenHelper(context);
db=helper.getReadableDatabase();
SettingDao settingDao=new SettingDao(context);
String type=settingDao.getDifficulty();
String sql="select * from tb_word,tb_wordrecord where tb_word._id=tb_wordrecord.wordId and reperaNum<5 and reperaNum>=1 and tb_word.wordType=? order by timeFirst ASC limit ?";
Cursor cursor=db.rawQuery(sql,new String[]{type,String.valueOf(todayneedreview)});
while (cursor.moveToNext()){
int _id=cursor.getInt(cursor.getColumnIndex("wordId"));
int wordRank=cursor.getInt(cursor.getColumnIndex("wordRank"));
String headWord=cursor.getString(cursor.getColumnIndex("headWord"));
String sentences=cursor.getString(cursor.getColumnIndex("sentences"));
String usphone=cursor.getString(cursor.getColumnIndex("usphone"));
String ukphone=cursor.getString(cursor.getColumnIndex("ukphone"));
String syno=cursor.getString(cursor.getColumnIndex("syno"));
String phrases=cursor.getString(cursor.getColumnIndex("phrases"));
String tranCN=cursor.getString(cursor.getColumnIndex("tranCN"));
String tranEN=cursor.getString(cursor.getColumnIndex("tranEN"));
String wordType=cursor.getString(cur
没有合适的资源?快使用搜索试试~ 我知道了~
Android期末大作业Android Studio开发的单词本APP源码(95分以上)
共275个文件
xml:155个
java:75个
jpg:11个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 141 浏览量
2024-12-14
16:30:27
上传
评论
收藏 6.36MB ZIP 举报
温馨提示
Android期末大作业Android Studio开发的单词本APP源码(95分以上),个人经导师指导并认可通过的高分大作业项目,评审分98分,项目中的源码都是经过本地编译过可运行的,都经过严格调试,确保可以运行!主要针对计算机相关专业的正在做大作业的学生和需要项目实战练习的学习者,资源项目的难度比较适中,内容都是经过助教老师审定过的能够满足学习、使用需求,如果有需要的话可以放心下载使用。 Android期末大作业Android Studio开发的单词本APP源码(95分以上)Android期末大作业Android Studio开发的单词本APP源码(95分以上)Android期末大作业Android Studio开发的单词本APP源码(95分以上)Android期末大作业Android Studio开发的单词本APP源码(95分以上)Android期末大作业Android Studio开发的单词本APP源码(95分以上)Android期末大作业Android Studio开发的单词本APP源码(95分以上)Android期末大作业Android Studio开发的单词本APP源码
资源推荐
资源详情
资源评论
收起资源包目录
Android期末大作业Android Studio开发的单词本APP源码(95分以上) (275个子文件)
gradlew.bat 2KB
gradlew.bat 2KB
now_word.db 5.03MB
.gitignore 1KB
.gitignore 6B
build.gradle 3KB
build.gradle 617B
settings.gradle 44B
gradlew 5KB
gradlew 5KB
commons-net-3.7.2-sources.jar 427KB
open_sdk_3.5.2.152_r9e04b1c_lite.jar 315KB
commons-net-3.7.2.jar 300KB
gson-2.8.5.jar 236KB
commons-net-examples-3.7.2.jar 90KB
gradle-wrapper.jar 53KB
gradle-wrapper.jar 53KB
WordRecordDao.java 41KB
MPAndroidBarChart.java 22KB
PictureResultActivity.java 21KB
TakePictureActivity.java 20KB
WordBookFragment.java 19KB
MainStudyActivity.java 19KB
WordStudyActivity.java 18KB
WordDao.java 18KB
TabFragment.java 17KB
SockScreenActivity.java 13KB
SearchWordActivity.java 12KB
OWLoadingView.java 11KB
SettingActivity.java 11KB
MainHomeActivity.java 10KB
QQLoginManager.java 10KB
SettingDao.java 10KB
DictateWordStudyActivity.java 9KB
FTPManager.java 8KB
StatisticsActivity.java 8KB
MPAndroidLineChart.java 7KB
HomeFragment.java 7KB
MPAndroidCombineChart.java 6KB
StudyRecordDao.java 6KB
WordDetailsActivity.java 6KB
MyWelcomeActivity.java 5KB
HttpGet.java 5KB
ReviewFragment.java 5KB
WordBookAdapter.java 4KB
WordTypeDao.java 4KB
LoginActivity.java 4KB
Word.java 4KB
WordAdapter.java 4KB
LauncherActivity.java 4KB
MD5.java 4KB
MPAndroidPieChart.java 4KB
ArrowTextView.java 4KB
LockScreenService.java 3KB
AudioMediaPlayer.java 3KB
WordListActivity.java 3KB
Setting.java 3KB
BaiduGetToken.java 3KB
HttpUtil.java 3KB
Base64Util.java 3KB
StudyRecord.java 2KB
WordRecord.java 2KB
DBOpenHelper.java 2KB
FileUtil.java 2KB
CoverFlowAdapter.java 2KB
WisdomDao.java 2KB
BaiduOCR.java 2KB
AboutActivity.java 2KB
LocalTrueFalseMediaPlayer.java 2KB
MPChartMarkerView.java 2KB
Tran_CN_split.java 2KB
StringUtils.java 1KB
TransApi.java 1KB
DonateActivity.java 1KB
GetStyleTheme.java 1KB
BaseApplication.java 1002B
IsIntenet.java 991B
Wisdom.java 961B
SelectZhengImage.java 914B
FragmentAdapter.java 881B
NoScrollViewPager.java 862B
LockScreenReceiver.java 853B
WordType.java 833B
GsonUtils.java 813B
ExampleInstrumentedTest.java 754B
FirstInto.java 710B
StringAxisValueFormatter.java 690B
MyValueFormatter.java 448B
ExampleUnitTest.java 381B
ReviewCardEntity.java 367B
WordBookEntity.java 293B
Sentence_split.java 208B
donate_zhifubao.jpg 230KB
welcome_pager_two.jpg 174KB
welcome_pager_one.jpg 125KB
slide_header_img.jpg 120KB
welcome_pager_three.jpg 116KB
welcome_pager_four.jpg 77KB
sock_screen_background.jpg 46KB
review_birds.jpg 32KB
共 275 条
- 1
- 2
- 3
资源评论
程序员张小妍
- 粉丝: 1w+
- 资源: 3418
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 水印检测44-CreateML数据集合集.rar
- heap-20s-heap-40s-heap-60s-heap-gc
- 水下裂缝检测57-YOLO(v5至v9)、COCO、CreateML、Darknet、Paligemma、TFRecord、VOC数据集合集.rar
- 微信小程序点餐系统微信小程序开发实战项目源码(高分完整项目)
- 云计算的css的学习1111111
- 基于微信小程序的点餐系统源码(完整项目代码)
- 基于微信小程序的外卖点餐系统源码+数据库(高分项目)
- 水下塑料分类58-YOLO(v5至v9)、COCO、CreateML、Darknet、Paligemma、VOC数据集合集.rar
- python代码使用Pygame库构建了一个简单的坦克大战游戏的基础框架 它实现了创建游戏窗口、定义游戏角色(两辆玩家控制的坦克)及其控制按键、管理游戏中的精灵(坦克和子弹)、处理游戏事件
- 植物识别检测53-YOLO(v5至v9)数据集合集.rar
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功