自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(6)
  • 收藏
  • 关注

原创 Android 读取本地照片

Android 读取本地照片。

2023-06-25 20:47:10 939

原创 Android studio 向手机存储写入txt内容

//path: 路径//Msg: 要写入的内容//isCover: 是否覆盖原有内容, true 覆盖, false 新增public static boolean writeFile(String path, String Msg, boolean isCover) {try {File file = new File(path);if (file.isDirectory()) {...

2020-04-14 23:22:06 3374

原创 Android studio 读取txt文件内容

//读取txt文件, 返回值永远不为null//注意要有存储权限public static String readFile(String path) {String result;try {File file = new File(path);//先读取info.txtif (!file.exists()) {return “”;}int length = (int) file....

2020-04-14 23:11:12 3051

原创 Android studio 获取SD卡根目录

//获取 SD 卡路径//注意: 最后有///注意: 从 Android 5.0 Lollipop 开始(SD卡只能读不能写)//注意添加存储权限////public static String getSdcardRootPath(Context context) {try {StorageManager storageManager = (StorageManager) cont...

2020-04-14 23:07:33 2723

原创 Android studio 获取一个随机数

获取一个随机数, 取值在 min--max 之间包括 min 和 maxpublic static int random(int min, int max) { if (min > max) { return (int) (max + (min - max + 1) * Math.random()); } return (int) (min + (m...

2020-04-14 22:59:36 2249

原创 Android studio 获取两数最大公约数

废话不多说, 直接给代码public static int getGreatestCommonNum(int a, int b) {if (a == b) {if (a == 0)return 1;elsereturn a;}int small = Math.min(a, b);if(small == 0)return 1;int big = Math.max(a, b);...

2020-04-14 22:51:57 436

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除