Skip to content

Commit 66ae25e

Browse files
author
ctj
committed
减少图片占用空间
1 parent 63881d3 commit 66ae25e

File tree

8 files changed

+40
-24
lines changed

8 files changed

+40
-24
lines changed

base_iotutils/src/main/java/com/face_chtj/base_iotutils/TimeUtils.java

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
* {@link #getTime()} 获取当前系统的时间戳
2020
* {@link #getTodayAddMonthDate(int)} 获取今天添加月份的日期
2121
* {@link #getUTCTimeStr()} 得到UTC时间,类型为字符串,格式为"yyyy-MM-dd HH:mm
22+
* {@link #differentDaysByMillisecond(Date, Date)} 两个Date间隔天数计算
23+
* {@link #getWeekOfDate()} 获取当前日期是星期几
2224
*
2325
*/
2426
public class TimeUtils {
@@ -125,4 +127,30 @@ public static String getUTCTimeStr() {
125127
return UTCTimeBuffer.toString();
126128
}
127129

130+
131+
/**
132+
* 两个Date间隔天数计算
133+
* @param after 临近的时间
134+
* @param before 之前的时间
135+
* @return 间隔天数
136+
*/
137+
public static int differentDaysByMillisecond(Date after, Date before) {
138+
return Math.abs((int) ((after.getTime() - before.getTime()) / (1000 * 3600 * 24)));
139+
}
140+
141+
/**
142+
* 获取当前日期是星期几<br>
143+
*
144+
* @return 当前日期是星期几
145+
*/
146+
public static String getWeekOfDate() {
147+
String[] weekDays = {"星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"};
148+
Calendar cal = Calendar.getInstance();
149+
cal.setTime(new Date());
150+
int w = cal.get(Calendar.DAY_OF_WEEK) - 1;
151+
if (w < 0)
152+
w = 0;
153+
return weekDays[w];
154+
}
155+
128156
}
-486 Bytes
Loading
-3.63 KB
Loading
-911 Bytes
Loading
-1.4 KB
Loading
-1.43 KB
Loading
-882 Bytes
Loading

other/adbshell.txt

Lines changed: 12 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -36,19 +36,10 @@ mmm packages/apps/ethNetwork //
3636
Ȼ������android studio
3737

3838
-----------------------�����--------------------------
39-
cat xxx.txt //�鿴�ļ�����
40-
41-
adb pull sdfilepath computer //��sd�������������
42-
43-
��Ӧ�ø��Ƶ�system/priv_app
44-
adb push C:/dell/test.txt /system/
45-
cat /system/SecureSetting.apk > /system/app/SecureSetting.apk // ��һ�������� cp ʵ�֣���һ���豸��û�а��������
46-
47-
rm -r path ɾ���ļ����ļ��µ�����
48-
rm path ɾ���ļ�
39+
cat /sdcard/xxx.txt //�鿴�ļ�����
4940

5041
ls -al �鿴�ļ�Ȩ��
51-
chmod 765 filename ΪӦ������Ȩ��
42+
chmod 777 filename ΪӦ������Ȩ��
5243
-------------------------------------------------
5344
----------xshell/putty ����
5445
rz �ϴ��ļ�
@@ -85,14 +76,7 @@ wm density 480 //
8576
-------------------------------------------------
8677
logcat -b radio -v time //�鿴����
8778
-------------------------------------------------
88-
adb logcat V/D/I/W/E/F/S �鿴��־
89-
V Verbose
90-
D Debug
91-
I Info
92-
W Warn
93-
E Error
94-
F Fatal
95-
S Silent (supress all output)
79+
adb logcat -V/D/I/W/E/F/S �鿴��־
9680
//���������־
9781
adb logcat -c -b main -b events -b radio -b system
9882
-----------------------------------------------
@@ -104,10 +88,6 @@ mount -o rw,remount /system system
10488

10589
mount -o rw,remount -t ext4 /system //ͨ��
10690

107-
mount -o rw,remount -t ext4 /dev/block/platform/ff0f0000.dwmmc/by-name/system 3288��д
108-
109-
mount -o ro,remount -t ext4 /dev/block/platform/ff0f0000.dwmmc/by-name/system 3288ֻ��
110-
11191
#����MainActivity�����ٶ� ִ��10�� ���Բ鿴ƽ��ֵ
11292
adb shell am start -S -R 10 -W packagename/.MainActivity
11393

@@ -129,4 +109,12 @@ el
129109

130110
# ��ȡ����Ӧ��
131111
java: dumpsys window | grep mCurrentFocus
132-
cmd:adb shell dumpsys window | findstr mCurrentFocus
112+
cmd:adb shell dumpsys window | findstr mCurrentFocus
113+
114+
# android 4.4.2���Ҵ���50M���ļ���ָ���ļ���
115+
cd sdcard;busybox find ./ -size +51200k > /sdcard/report.txt;cd /
116+
117+
# android 7.1.2���Ҵ���50M���ļ���ָ���ļ���
118+
find sdcard/ -size +50M > /sdcard/report.txt
119+
#�г�sdcar�ļ����²㼶Ϊ1 ���ļ���Ϣ
120+
du -m -d 1 /sdcard/*

0 commit comments

Comments
 (0)