android 复制文件

把程序文件下的数据库文件复制到其他目录,需要用到文件复制。 /** * @author ptz * @date 2022/02/05 * @description */ public class CopyFile { private static final String TA...

[转] android崩溃日志保存在本地

转自: https://blog.csdn.net/cf8833/article/details/92662279 遇到的坑: 这个东西只能保存崩溃的错误日志,有点局限性 文件权限申请,文件权限申请,文件权限申请,重要的事情讲三遍, 这个生成之后的文件,一定要用手机去看,千万不要用电脑,别问...

android studio 打包 apk,自动修改文件名称

增加时间戳 在 app/build.gradle 的 android 闭包之外增加: def generateTime() { return new Date().format("yyyy_MM_dd_HH_mm_ss") } 增加文件名 在 app/build.gradle 的 an...

sqlite 删除前 n 条数据

sqlite 数据库设计超过容量就删除最前面的 n 行数据,用到的 sql 语句如下: public void deleteTableHead(SQLiteDatabase db, String table, String...

android 实时时间

android 需要显示实时时间,可以使用 google 提供好的 TextClock xml <TextClock android:layout_width="wrap_content" android:layout_height="wrap_conte...

android 多线程

参考 理解 Activity.runOnUiThread https://www.jianshu.com/p/e39449026f21 Thread interrupt() 线程中断的详细说明 https://www.cnblogs.com/zh94/p/14097922.html Thr...

sg 滤波器

sg 滤波器: Savitsky Golay filter 库 github 上面可用的库有两个: savitzky-golay-filter: https://github.com/ruozhuochen/savitzky-golay-filter https://github.com/...

Duplicate class org.apache.maven.surefire.report.SafeThrowable found in modules jetified-common-java5-2.19.1

报错 今天在引入 jdsp 这个库是,直接使用 implementation 'com.github.psambit9791:jdsp:1.0.0',结果 androidstudio 报错如下: Duplicate class org.apache.maven.surefire.report...

android sqlite 获取数据条数

直接使用 sql 语句 SQLiteDatabase db = analysisDBOpenHelper.getReadableDatabase(); String find = "select count(*) from " + "info"; ...

[转] Android APP:检测实体按键事件

转自: https://blog.csdn.net/qq_37858386/article/details/103834675 Android APP:检测实体按键事件 一、检测点击按键事件一般不对手机上的输入按键进行处理,直接由系统按照默认情况操作。 当然有时为了改善用户体验,需要让应用...