-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
315 lines (272 loc) · 44 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
<!DOCTYPE html><html lang="zh-CN" data-theme="light"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0,viewport-fit=cover"><title>Blog-无泪真伤 - 记录学习</title><meta name="author" content="无泪真伤"><meta name="copyright" content="无泪真伤"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="#ffffff"><meta name="referrer" content="no-referrer"><meta name="description" content="不会爱,不愿爱!">
<meta property="og:type" content="website">
<meta property="og:title" content="Blog-无泪真伤">
<meta property="og:url" content="https://www.wuleizhenshang.love/index.html">
<meta property="og:site_name" content="Blog-无泪真伤">
<meta property="og:description" content="不会爱,不愿爱!">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://pic.imgdb.cn/item/65582252c458853aeff7c6f5.jpg">
<meta property="article:author" content="无泪真伤">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://pic.imgdb.cn/item/65582252c458853aeff7c6f5.jpg"><link rel="shortcut icon" href="/img/86634.jpg"><link rel="canonical" href="https://www.wuleizhenshang.love/index.html"><link rel="preconnect" href="//cdn.jsdelivr.net"/><link rel="preconnect" href="//busuanzi.ibruce.info"/><link rel="stylesheet" href="/css/index.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free/css/all.min.css" media="print" onload="this.media='all'"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox/fancybox.min.css" media="print" onload="this.media='all'"><script>const GLOBAL_CONFIG = {
root: '/',
algolia: undefined,
localSearch: {"path":"/search.xml","preload":false,"top_n_per_article":1,"unescape":false,"languages":{"hits_empty":"找不到您查询的内容:${query}","hits_stats":"共找到 ${hits} 篇文章"}},
translate: undefined,
noticeOutdate: undefined,
highlight: {"plugin":"highlighjs","highlightCopy":true,"highlightLang":true,"highlightHeightLimit":200},
copy: {
success: '复制成功',
error: '复制错误',
noSupport: '浏览器不支持'
},
relativeDate: {
homepage: false,
post: false
},
runtime: '天',
dateSuffix: {
just: '刚刚',
min: '分钟前',
hour: '小时前',
day: '天前',
month: '个月前'
},
copyright: {"limitCount":50,"languages":{"author":"作者: 无泪真伤","link":"链接: ","source":"来源: Blog-无泪真伤","info":"著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。"}},
lightbox: 'fancybox',
Snackbar: undefined,
infinitegrid: {
js: 'https://cdn.jsdelivr.net/npm/@egjs/infinitegrid/dist/infinitegrid.min.js',
buttonText: '加载更多'
},
isPhotoFigcaption: false,
islazyload: false,
isAnchor: false,
percent: {
toc: true,
rightside: false,
},
autoDarkmode: false
}</script><script id="config-diff">var GLOBAL_CONFIG_SITE = {
title: 'Blog-无泪真伤',
isPost: false,
isHome: true,
isHighlightShrink: false,
isToc: false,
postUpdate: '2024-10-16 21:13:33'
}</script><script>(win=>{
win.saveToLocal = {
set: (key, value, ttl) => {
if (ttl === 0) return
const now = Date.now()
const expiry = now + ttl * 86400000
const item = {
value,
expiry
}
localStorage.setItem(key, JSON.stringify(item))
},
get: key => {
const itemStr = localStorage.getItem(key)
if (!itemStr) {
return undefined
}
const item = JSON.parse(itemStr)
const now = Date.now()
if (now > item.expiry) {
localStorage.removeItem(key)
return undefined
}
return item.value
}
}
win.getScript = (url, attr = {}) => new Promise((resolve, reject) => {
const script = document.createElement('script')
script.src = url
script.async = true
script.onerror = reject
script.onload = script.onreadystatechange = function() {
const loadState = this.readyState
if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
script.onload = script.onreadystatechange = null
resolve()
}
Object.keys(attr).forEach(key => {
script.setAttribute(key, attr[key])
})
document.head.appendChild(script)
})
win.getCSS = (url, id = false) => new Promise((resolve, reject) => {
const link = document.createElement('link')
link.rel = 'stylesheet'
link.href = url
if (id) link.id = id
link.onerror = reject
link.onload = link.onreadystatechange = function() {
const loadState = this.readyState
if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
link.onload = link.onreadystatechange = null
resolve()
}
document.head.appendChild(link)
})
win.activateDarkMode = () => {
document.documentElement.setAttribute('data-theme', 'dark')
if (document.querySelector('meta[name="theme-color"]') !== null) {
document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d')
}
}
win.activateLightMode = () => {
document.documentElement.setAttribute('data-theme', 'light')
if (document.querySelector('meta[name="theme-color"]') !== null) {
document.querySelector('meta[name="theme-color"]').setAttribute('content', '#ffffff')
}
}
const t = saveToLocal.get('theme')
if (t === 'dark') activateDarkMode()
else if (t === 'light') activateLightMode()
const asideStatus = saveToLocal.get('aside-status')
if (asideStatus !== undefined) {
if (asideStatus === 'hide') {
document.documentElement.classList.add('hide-aside')
} else {
document.documentElement.classList.remove('hide-aside')
}
}
const detectApple = () => {
if(/iPad|iPhone|iPod|Macintosh/.test(navigator.userAgent)){
document.documentElement.classList.add('apple')
}
}
detectApple()
})(window)</script><meta name="generator" content="Hexo 7.0.0"></head><body><div id="web_bg"></div><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="avatar-img is-center"><img src="https://pic.imgdb.cn/item/65582252c458853aeff7c6f5.jpg" onerror="onerror=null;src='/img/friend_404.gif'" alt="avatar"/></div><div class="sidebar-site-data site-data is-center"><a href="/archives/"><div class="headline">文章</div><div class="length-num">19</div></a><a href="/tags/"><div class="headline">标签</div><div class="length-num">6</div></a><a href="/categories/"><div class="headline">分类</div><div class="length-num">6</div></a></div><hr class="custom-hr"/><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> 首页</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> 时间轴</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></div></div></div></div><div class="page" id="body-wrap"><header class="full_page" id="page-header" style="background-image: url('https://pic.imgdb.cn/item/655825b2c458853aef027a19.jpg')"><nav id="nav"><span id="blog-info"><a href="/" title="Blog-无泪真伤"><span class="site-name">Blog-无泪真伤</span></a></span><div id="menus"><div id="search-button"><a class="site-page social-icon search" href="javascript:void(0);"><i class="fas fa-search fa-fw"></i><span> 搜索</span></a></div><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> 首页</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> 时间轴</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></div></div><div id="toggle-menu"><a class="site-page" href="javascript:void(0);"><i class="fas fa-bars fa-fw"></i></a></div></div></nav><div id="site-info"><h1 id="site-title">Blog-无泪真伤</h1><div id="site-subtitle"><span id="subtitle"></span></div></div><div id="scroll-down"><i class="fas fa-angle-down scroll-down-effects"></i></div></header><main class="layout" id="content-inner"><div class="recent-posts" id="recent-posts"><div class="recent-post-item"><div class="post_cover left"><a href="/2024/09/16/%E4%BB%A3%E7%A0%81%E9%9A%8F%E6%83%B3%E5%BD%95/" title="代码随想录学习记录"><img class="post-bg" src="https://s2.loli.net/2024/09/16/rdv2wuJ17ghb3Qj.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="代码随想录学习记录"></a></div><div class="recent-post-info"><a class="article-title" href="/2024/09/16/%E4%BB%A3%E7%A0%81%E9%9A%8F%E6%83%B3%E5%BD%95/" title="代码随想录学习记录">代码随想录学习记录</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2024-09-16T07:54:00.000Z" title="发表于 2024-09-16 15:54:00">2024-09-16</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/Android%E9%9D%A2%E8%AF%95/">Android面试</a><i class="fas fa-angle-right article-meta-link"></i><a class="article-meta__categories" href="/categories/Android%E9%9D%A2%E8%AF%95/%E7%AE%97%E6%B3%95/">算法</a></span></div><div class="content">代码随想录学习记录数组双指针思想
二分查找这道题目的前提是数组为有序数组,同时题目还强调数组中无重复元素,因为一旦有重复元素,使用二分查找法返回的元素下标可能不是唯一的,这些都是使用二分法的前提条件,当大家看到题目描述满足如上条件的时候,可要想一想是不是可以用二分法了。
704. 二分查找
35. 搜索插入位置
34. 在排序数组中查找元素的第一个和最后一个位置
69. x 的平方根
367. 有效的完全平方数
704. 二分查找
704. 二分查找 - 力扣(LeetCode)
12345678910111213141516171819202122class Solution { public int search(int[] nums, int target) { int left = 0, right = nums.length - 1; // 左闭右闭 while (left <= right) { int mid = left + ((right - left) ...</div></div></div><div class="recent-post-item"><div class="post_cover right"><a href="/2024/09/16/Leecode%E5%8A%9B%E6%89%A3%E9%9D%A2%E8%AF%95%E7%BB%8F%E5%85%B8150%E9%A2%98/" title="Leecode面试经典150题"><img class="post-bg" src="https://s2.loli.net/2024/09/16/JTzk8CZGW7vjXor.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="Leecode面试经典150题"></a></div><div class="recent-post-info"><a class="article-title" href="/2024/09/16/Leecode%E5%8A%9B%E6%89%A3%E9%9D%A2%E8%AF%95%E7%BB%8F%E5%85%B8150%E9%A2%98/" title="Leecode面试经典150题">Leecode面试经典150题</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2024-09-16T07:17:00.000Z" title="发表于 2024-09-16 15:17:00">2024-09-16</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/Android%E9%9D%A2%E8%AF%95/">Android面试</a><i class="fas fa-angle-right article-meta-link"></i><a class="article-meta__categories" href="/categories/Android%E9%9D%A2%E8%AF%95/%E7%AE%97%E6%B3%95/">算法</a></span></div><div class="content">Leecode面试经典150题数组 / 字符串88. 合并两个有序数组一开始个人写法
12345678910111213141516171819202122class Solution { public void merge(int[] nums1, int m, int[] nums2, int n) { int[] ints = new int[m + n]; int t = 0, t1 = 0, t2 = 0; while (t1 < m && t2 < n) { if (nums1[t1] < nums2[t2]) { ints[t++] = nums1[t1++]; } else { ints[t++] = nums2[t2++]; } } while ( ...</div></div></div><div class="recent-post-item"><div class="post_cover left"><a href="/2024/09/16/%E5%89%91%E6%8C%87offer%E4%B8%AA%E4%BA%BA%E7%AE%97%E6%B3%95%E5%87%86%E5%A4%87/" title="剑指offer个人算法准备"><img class="post-bg" src="https://s2.loli.net/2024/09/16/dOZFEfXMl4j2VAs.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="剑指offer个人算法准备"></a></div><div class="recent-post-info"><a class="article-title" href="/2024/09/16/%E5%89%91%E6%8C%87offer%E4%B8%AA%E4%BA%BA%E7%AE%97%E6%B3%95%E5%87%86%E5%A4%87/" title="剑指offer个人算法准备">剑指offer个人算法准备</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2024-09-16T07:17:00.000Z" title="发表于 2024-09-16 15:17:00">2024-09-16</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/Android%E9%9D%A2%E8%AF%95/">Android面试</a><i class="fas fa-angle-right article-meta-link"></i><a class="article-meta__categories" href="/categories/Android%E9%9D%A2%E8%AF%95/%E7%AE%97%E6%B3%95/">算法</a></span></div><div class="content">剑指offer个人算法准备剑指Offer数据结构链表双指针
JZ6 从尾到头打印链表
JZ24 反转链表
JZ25 合并两个排序的链表
JZ52 两个链表的第一个公共结点
JZ23 链表中环的入口结点
JZ22 链表中倒数最后k个结点
JZ35 复杂链表的复制
JZ76 删除链表中重复的结点
JZ18 删除链表的节点
JZ6 从尾到头打印链表
翻转,浪费时间
123456789101112131415161718192021222324252627282930313233343536373839import java.util.*;/*** public class ListNode {* int val;* ListNode next = null;** ListNode(int val) {* this.val = val;* }* }**/import java.util.ArrayList;public class Solution { ...</div></div></div><div class="recent-post-item"><div class="post_cover right"><a href="/2024/06/19/%E9%9D%A2%E8%AF%95%E5%87%86%E5%A4%87(%E6%A1%86%E6%9E%B6%E9%83%A8%E5%88%86)/" title="面试准备(框架部分)"><img class="post-bg" src="https://pic.imgdb.cn/item/66723b31d9c307b7e9cbf899.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="面试准备(框架部分)"></a></div><div class="recent-post-info"><a class="article-title" href="/2024/06/19/%E9%9D%A2%E8%AF%95%E5%87%86%E5%A4%87(%E6%A1%86%E6%9E%B6%E9%83%A8%E5%88%86)/" title="面试准备(框架部分)">面试准备(框架部分)</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2024-06-19T04:33:46.000Z" title="发表于 2024-06-19 12:33:46">2024-06-19</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/%E5%85%B6%E4%BB%96/">其他</a></span><span class="article-meta tags"><span class="article-meta-separator">|</span><i class="fas fa-tag"></i><a class="article-meta__tags" href="/tags/%E5%85%B6%E4%BB%96/">其他</a></span></div><div class="content">面试准备(框架部分)Glide先上其他大牛的博客链接
面试官:简历上最好不要写Glide,不是问源码那么简单 - 掘金 (juejin.cn)
Android | 《看完不忘系列》之Glide - 掘金 (juejin.cn)
基础流程开始自己的记录
需要明确的是看其他人的图片加载框架其实就是为了学习如果自己要搭建一个图片加载框架需要做的各个方面的工作
首先看最简单的用法
1234Glide.with(this).load(url).into(imageView);//with(Context/Activity/Fragment)决定Glide加载图片的生命周期//load(url)url包括网络图片、本地图片、应用资源、二进制流、Uri对象等等(重载)//into(imageView)
最简单的用法可以看作主干,其实就是三部曲
更进阶一点的用法这里贴出来,当然还有更多
123456//扩展功能.placeholder(R.drawable.loading)//加载图片过程占位符,加载完成会替换占位符.error(R.drawable.error)//加载图片错误占位符.asGif( ...</div></div></div><div class="recent-post-item"><div class="post_cover left"><a href="/2024/06/19/%E9%9D%A2%E8%AF%95%E5%87%86%E5%A4%87(%E5%AE%89%E5%8D%93%E9%83%A8%E5%88%86)/" title="面试准备(安卓部分)"><img class="post-bg" src="https://pic.imgdb.cn/item/66725566d9c307b7e9f4c95d.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="面试准备(安卓部分)"></a></div><div class="recent-post-info"><a class="article-title" href="/2024/06/19/%E9%9D%A2%E8%AF%95%E5%87%86%E5%A4%87(%E5%AE%89%E5%8D%93%E9%83%A8%E5%88%86)/" title="面试准备(安卓部分)">面试准备(安卓部分)</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2024-06-19T03:49:04.000Z" title="发表于 2024-06-19 11:49:04">2024-06-19</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/%E5%85%B6%E4%BB%96/">其他</a></span><span class="article-meta tags"><span class="article-meta-separator">|</span><i class="fas fa-tag"></i><a class="article-meta__tags" href="/tags/%E5%85%B6%E4%BB%96/">其他</a></span></div><div class="content">面试准备(安卓部分)四大组件Activity,Broadcast Receiver,Service以及Content Provider。
Fragment也写到这里来吧
Activity官方给出的生命周期图片,对照了Activity和Fragment的生命周期
四个状态
活动状态(Running/Active)、暂停状态(Paused)、停止状态(Stopped)、销毁状态(Killed)
四个启动模式
Standard
SingleTask
SingleTop
SingleInstance
Flags标识
FLAG_ACTIVITY_NEW_TASK 跟在AndroidManifest设置launchMode为SingleTask一样效果,但是Flags的优先级更高
FLAG_ACTIVITY_SINGLE_TOP 跟在AndroidManifest设置launchMode为SingleTop一样效果
FLAG_ACTIVITY_CLEAR_TOP 一般跟SingleTop同时出现,当然也可以跟其他一起用,会将这个实例连同他之上的Activity都出栈,然后再新建一个实例 ...</div></div></div><div class="recent-post-item"><div class="post_cover right"><a href="/2024/06/19/%E9%9D%A2%E8%AF%95%E5%87%86%E5%A4%87(java%E9%83%A8%E5%88%86)/" title="面试准备(Java部分)"><img class="post-bg" src="https://pic.imgdb.cn/item/66723ae2d9c307b7e9cb8bc9.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="面试准备(Java部分)"></a></div><div class="recent-post-info"><a class="article-title" href="/2024/06/19/%E9%9D%A2%E8%AF%95%E5%87%86%E5%A4%87(java%E9%83%A8%E5%88%86)/" title="面试准备(Java部分)">面试准备(Java部分)</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2024-06-19T01:56:04.000Z" title="发表于 2024-06-19 09:56:04">2024-06-19</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/%E5%85%B6%E4%BB%96/">其他</a></span><span class="article-meta tags"><span class="article-meta-separator">|</span><i class="fas fa-tag"></i><a class="article-meta__tags" href="/tags/%E5%85%B6%E4%BB%96/">其他</a></span></div><div class="content">面试准备(Java部分)Java是一种技术,由四个方面组成:Java编程语言、Java类文件格式、Java虚拟机和Java应用程序接口(Java API)
Java Class 类文件格式看这一篇就够了_java class文件-CSDN博客
JVMJVM(虚拟机):指以软件的方式模拟具有完整硬件系统功能、运行在一个完全隔离环境中的计算机系统,是物理机的软件实现,Java虚拟机是采用虚拟化技术,隔离出一块独立的子操作系统,使Java软件不受任何影响在虚拟机内进行执行。
Java虚拟机阵营:Sun HotSpot VM、BEA JRockit VM(JDK1.8合并)
开发人员编写Java代码,并将Java源代码文件(.java文件)通过Java编译器进行编译后形成java字节码文件(.class文件),通过类加载子系统加载到运行时数据区(内存空间),再通过JVM执行引擎进行执行。
JVM实现了Java平台的无关性
在Java平台的结构中, 可以看出,Java虚拟机(JVM) 处在核心的位置,是程序与底层操作系统和硬件无关的关键。它的下方是移植接口,移植接口由两部分组成:适配器和Ja ...</div></div></div><div class="recent-post-item"><div class="post_cover left"><a href="/2024/05/19/Android%E6%A8%A1%E5%9D%97%E5%8C%96%E5%92%8C%E7%BB%84%E4%BB%B6%E5%8C%96/" title="Android模块化开发和组件化开发"><img class="post-bg" src="https://pic.imgdb.cn/item/664a0d30d9c307b7e980f34a.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="Android模块化开发和组件化开发"></a></div><div class="recent-post-info"><a class="article-title" href="/2024/05/19/Android%E6%A8%A1%E5%9D%97%E5%8C%96%E5%92%8C%E7%BB%84%E4%BB%B6%E5%8C%96/" title="Android模块化开发和组件化开发">Android模块化开发和组件化开发</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2024-05-19T14:31:00.000Z" title="发表于 2024-05-19 22:31:00">2024-05-19</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/Android/">Android</a></span><span class="article-meta tags"><span class="article-meta-separator">|</span><i class="fas fa-tag"></i><a class="article-meta__tags" href="/tags/Android/">Android</a><span class="article-meta-link">•</span><a class="article-meta__tags" href="/tags/%E5%BC%80%E5%8F%91%E5%B8%B8%E7%94%A8/">开发常用</a></span></div><div class="content">Android模块化开发和组件化开发简介单工程项目
单工程项目结构
单工程项目的缺陷
随着应用的不断迭代更新,业务代码持续增加,随之而来的问题逐步呈现出来:
各种业务代码混杂在同一个模块中,开发人员在开发、调试过程中的效率越来越低,比如定位某个业务问题,需要在多个业务代码混合的模块中寻找和跳转。
工程师需要了解各个业务的功能,避免代码的改动影响其他业务的功能,导致开发和维护成本不断增加。
由于功能工程越来越庞大,编译完整代码所花费的时间越来越长。
多人协同开发时,开发风格不一,又难以将业务完全分割,大家互相影响,导致开发效率低下。
代码复用性差,写过的代码又很难抽离出来再次使用。
模块化和组件化
什么是组件化
组件(Component),对数据和方法的简单封装,功能单一,高内聚,并且是业务能划分的最小粒度。
组件化是基于可重用的目的,将大型的软件系统按照分离关注点的形式,拆分成多个独立的组件,使得整个软件系统也能做到电路板一样,是单个或多个组件元件组装起来,哪个组件坏了,整个系统可继续运行,而不出现崩溃或不正常现象,做到更少的耦合和更高的内聚。
为什么需要使用组件化 ...</div></div></div><div class="recent-post-item"><div class="post_cover right"><a href="/2024/05/19/%E5%AF%BC%E5%85%A5%E9%A1%B9%E7%9B%AE%E5%92%8C%E7%8E%AF%E5%A2%83%E8%AF%B4%E6%98%8E/" title="Android导入项目及环境说明"><img class="post-bg" src="https://pic.imgdb.cn/item/664a0a9ad9c307b7e97d01c6.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="Android导入项目及环境说明"></a></div><div class="recent-post-info"><a class="article-title" href="/2024/05/19/%E5%AF%BC%E5%85%A5%E9%A1%B9%E7%9B%AE%E5%92%8C%E7%8E%AF%E5%A2%83%E8%AF%B4%E6%98%8E/" title="Android导入项目及环境说明">Android导入项目及环境说明</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2024-05-19T14:18:00.000Z" title="发表于 2024-05-19 22:18:00">2024-05-19</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/Android/">Android</a></span><span class="article-meta tags"><span class="article-meta-separator">|</span><i class="fas fa-tag"></i><a class="article-meta__tags" href="/tags/Android/">Android</a><span class="article-meta-link">•</span><a class="article-meta__tags" href="/tags/%E5%BC%80%E5%8F%91%E5%B8%B8%E7%94%A8/">开发常用</a></span></div><div class="content">Android导入项目及环境说明配置 build | Android Studio | Android Developers
这里有完整的Android项目构建的不同部分的说明,可以根据需求点击跳转去查看
环境说明首先需要知道的是不同的版本的Android Studio支持的AGP版本范围是不同的,不同的AGP能支持的Gradle版本也是不同的,项目使用不同的API版本也需要不同的AGP支持,这就是几者之间的关系,具体需要可以参考官网。
Android Gradle 插件 8.4 版本说明 | Android Studio | Android Developers (google.cn)
而项目使用的JDK只是构建项目使用
导入项目因版本不匹配出现的编译错误一般JDK版本是没什么问题的,可以在project structure中选择SDK Location,里面…可以找到jdk的设置,如果项目sync失败可以进去看看,顺便看JDK有没有问题再做其他修改了,也可以在setting中直接搜索Gradle也可以找到。
主要看API版本先,旧版的Gradle构建出来的项目是可以在pro ...</div></div></div><div class="recent-post-item"><div class="post_cover left"><a href="/2024/02/28/%E7%BB%8F%E5%85%B8%E6%8E%92%E5%BA%8F%E7%AE%97%E6%B3%95+%E7%89%9B%E5%AE%A2%E9%9D%A2%E8%AF%95%E5%BF%85%E5%88%B7101/" title="牛客面试必刷101(包含经典排序算法)"><img class="post-bg" src="https://pic.imgdb.cn/item/6602823e9f345e8d03cbcbff.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="牛客面试必刷101(包含经典排序算法)"></a></div><div class="recent-post-info"><a class="article-title" href="/2024/02/28/%E7%BB%8F%E5%85%B8%E6%8E%92%E5%BA%8F%E7%AE%97%E6%B3%95+%E7%89%9B%E5%AE%A2%E9%9D%A2%E8%AF%95%E5%BF%85%E5%88%B7101/" title="牛客面试必刷101(包含经典排序算法)">牛客面试必刷101(包含经典排序算法)</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2024-02-28T15:33:46.000Z" title="发表于 2024-02-28 23:33:46">2024-02-28</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/Android%E9%9D%A2%E8%AF%95/">Android面试</a><i class="fas fa-angle-right article-meta-link"></i><a class="article-meta__categories" href="/categories/Android%E9%9D%A2%E8%AF%95/%E7%AE%97%E6%B3%95/">算法</a></span></div><div class="content">面试算法准备(Java)十大经典排序算法经典的十大排序算法可以大致分为两类:
比较类排序:
冒泡排序 =》快速排序(冒泡排序优化)
插入排序=》希尔排序(插入排序优化)
选择排序=》堆排序(选择排序优化)
归并排序(二路、多路)
非比较类排序:
计数排序 = 》桶排序
基数排序
冒泡排序123456789101112131415161718192021222324252627282930313233343536373839404142public class BubbleSort { public static void main(String[] args) { int[] ints = new int[]{2343, 234, 765, 1, 23, 5, 3, 2, 0, 3}; bubbleSort(ints); for (int i : ints) { System.out.print(i + & ...</div></div></div><div class="recent-post-item"><div class="post_cover right"><a href="/2024/02/28/%E5%87%86%E5%A4%87/" title="小白个人Android面试准备"><img class="post-bg" src="https://pic.imgdb.cn/item/65df52089f345e8d030edde4.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="小白个人Android面试准备"></a></div><div class="recent-post-info"><a class="article-title" href="/2024/02/28/%E5%87%86%E5%A4%87/" title="小白个人Android面试准备">小白个人Android面试准备</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2024-02-28T15:33:46.000Z" title="发表于 2024-02-28 23:33:46">2024-02-28</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/%E5%85%B6%E4%BB%96/">其他</a></span><span class="article-meta tags"><span class="article-meta-separator">|</span><i class="fas fa-tag"></i><a class="article-meta__tags" href="/tags/%E5%85%B6%E4%BB%96/">其他</a></span></div><div class="content">准备整体知识框架
Java知识Tempstatic:是静态的意思;
final:是最后的意思;
区别:
1.final可以修饰类,方法和变量,但是static只能修饰方法和变量;
2.final可以修饰全局变量和局部变量,但是static只能修饰全局变量,不能修饰局部变量;
3.final不可以修饰代码块,但是static可以修饰代码块。
static与final的区别_static和final的区别-CSDN博客
作用域public/private/protected的具体区别_public protected private的作用域-CSDN博客
泛型
Java的泛型符号的名称不要求,个数也不要求,一般有T type,E element,K key,V value,Java的泛型是一个占位符,先给引用类型进行占位,泛型符号可以应用在类的声明处、接口声明、方法的声明
泛型类
ArrayList<E>和HashMap<K,V>就是泛型类
在类中声明了之后就需要在创建类的对象的时候就需要去确定类的声明处定义的泛型的具体类型,如果在构建对象的时候 ...</div></div></div><nav id="pagination"><div class="pagination"><span class="page-number current">1</span><a class="page-number" href="/page/2/#content-inner">2</a><a class="extend next" rel="next" href="/page/2/#content-inner"><i class="fas fa-chevron-right fa-fw"></i></a></div></nav></div><div class="aside-content" id="aside-content"><div class="card-widget card-info"><div class="is-center"><div class="avatar-img"><img src="https://pic.imgdb.cn/item/65582252c458853aeff7c6f5.jpg" onerror="this.onerror=null;this.src='/img/friend_404.gif'" alt="avatar"/></div><div class="author-info__name">无泪真伤</div><div class="author-info__description">不会爱,不愿爱!</div></div><div class="card-info-data site-data is-center"><a href="/archives/"><div class="headline">文章</div><div class="length-num">19</div></a><a href="/tags/"><div class="headline">标签</div><div class="length-num">6</div></a><a href="/categories/"><div class="headline">分类</div><div class="length-num">6</div></a></div><a id="card-info-btn" target="_blank" rel="noopener" href="https://github.com/wuleizhenshang"><i class="fab fa-github"></i><span>Follow Me</span></a></div><div class="card-widget card-announcement"><div class="item-headline"><i class="fas fa-bullhorn fa-shake"></i><span>公告</span></div><div class="announcement_content">本人新人一枚!写博客知识记录个人学习经历,有错误请见谅!</div></div><div class="sticky_layout"><div class="card-widget card-recent-post"><div class="item-headline"><i class="fas fa-history"></i><span>最新文章</span></div><div class="aside-list"><div class="aside-list-item"><a class="thumbnail" href="/2024/09/16/%E4%BB%A3%E7%A0%81%E9%9A%8F%E6%83%B3%E5%BD%95/" title="代码随想录学习记录"><img src="https://s2.loli.net/2024/09/16/rdv2wuJ17ghb3Qj.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="代码随想录学习记录"/></a><div class="content"><a class="title" href="/2024/09/16/%E4%BB%A3%E7%A0%81%E9%9A%8F%E6%83%B3%E5%BD%95/" title="代码随想录学习记录">代码随想录学习记录</a><time datetime="2024-09-16T07:54:00.000Z" title="发表于 2024-09-16 15:54:00">2024-09-16</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2024/09/16/Leecode%E5%8A%9B%E6%89%A3%E9%9D%A2%E8%AF%95%E7%BB%8F%E5%85%B8150%E9%A2%98/" title="Leecode面试经典150题"><img src="https://s2.loli.net/2024/09/16/JTzk8CZGW7vjXor.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="Leecode面试经典150题"/></a><div class="content"><a class="title" href="/2024/09/16/Leecode%E5%8A%9B%E6%89%A3%E9%9D%A2%E8%AF%95%E7%BB%8F%E5%85%B8150%E9%A2%98/" title="Leecode面试经典150题">Leecode面试经典150题</a><time datetime="2024-09-16T07:17:00.000Z" title="发表于 2024-09-16 15:17:00">2024-09-16</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2024/09/16/%E5%89%91%E6%8C%87offer%E4%B8%AA%E4%BA%BA%E7%AE%97%E6%B3%95%E5%87%86%E5%A4%87/" title="剑指offer个人算法准备"><img src="https://s2.loli.net/2024/09/16/dOZFEfXMl4j2VAs.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="剑指offer个人算法准备"/></a><div class="content"><a class="title" href="/2024/09/16/%E5%89%91%E6%8C%87offer%E4%B8%AA%E4%BA%BA%E7%AE%97%E6%B3%95%E5%87%86%E5%A4%87/" title="剑指offer个人算法准备">剑指offer个人算法准备</a><time datetime="2024-09-16T07:17:00.000Z" title="发表于 2024-09-16 15:17:00">2024-09-16</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2024/06/19/%E9%9D%A2%E8%AF%95%E5%87%86%E5%A4%87(%E6%A1%86%E6%9E%B6%E9%83%A8%E5%88%86)/" title="面试准备(框架部分)"><img src="https://pic.imgdb.cn/item/66723b31d9c307b7e9cbf899.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="面试准备(框架部分)"/></a><div class="content"><a class="title" href="/2024/06/19/%E9%9D%A2%E8%AF%95%E5%87%86%E5%A4%87(%E6%A1%86%E6%9E%B6%E9%83%A8%E5%88%86)/" title="面试准备(框架部分)">面试准备(框架部分)</a><time datetime="2024-06-19T04:33:46.000Z" title="发表于 2024-06-19 12:33:46">2024-06-19</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2024/06/19/%E9%9D%A2%E8%AF%95%E5%87%86%E5%A4%87(%E5%AE%89%E5%8D%93%E9%83%A8%E5%88%86)/" title="面试准备(安卓部分)"><img src="https://pic.imgdb.cn/item/66725566d9c307b7e9f4c95d.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="面试准备(安卓部分)"/></a><div class="content"><a class="title" href="/2024/06/19/%E9%9D%A2%E8%AF%95%E5%87%86%E5%A4%87(%E5%AE%89%E5%8D%93%E9%83%A8%E5%88%86)/" title="面试准备(安卓部分)">面试准备(安卓部分)</a><time datetime="2024-06-19T03:49:04.000Z" title="发表于 2024-06-19 11:49:04">2024-06-19</time></div></div></div></div><div class="card-widget card-categories"><div class="item-headline">
<i class="fas fa-folder-open"></i>
<span>分类</span>
</div>
<ul class="card-category-list" id="aside-cat-list">
<li class="card-category-list-item "><a class="card-category-list-link" href="/categories/Android/"><span class="card-category-list-name">Android</span><span class="card-category-list-count">2</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/Android%E9%9D%A2%E8%AF%95/"><span class="card-category-list-name">Android面试</span><span class="card-category-list-count">4</span></a><ul class="card-category-list child"><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/Android%E9%9D%A2%E8%AF%95/%E7%AE%97%E6%B3%95/"><span class="card-category-list-name">算法</span><span class="card-category-list-count">4</span></a></li></ul></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/%E5%85%B6%E4%BB%96/"><span class="card-category-list-name">其他</span><span class="card-category-list-count">5</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/%E5%AD%A6%E4%B9%A0/"><span class="card-category-list-name">学习</span><span class="card-category-list-count">4</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/%E5%BC%80%E5%8F%91%E5%B8%B8%E7%94%A8/"><span class="card-category-list-name">开发常用</span><span class="card-category-list-count">4</span></a></li>
</ul></div><div class="card-widget card-tags"><div class="item-headline"><i class="fas fa-tags"></i><span>标签</span></div><div class="card-tag-cloud"><a href="/tags/%E5%BC%80%E5%8F%91%E6%8A%80%E6%9C%AF/" style="font-size: 1.1em; color: #999">开发技术</a> <a href="/tags/%E8%87%AA%E7%84%B6%E8%AF%AD%E8%A8%80%E5%A4%84%E7%90%86/" style="font-size: 1.1em; color: #999">自然语言处理</a> <a href="/tags/Android/" style="font-size: 1.2em; color: #999da3">Android</a> <a href="/tags/%E5%BC%80%E5%8F%91%E5%B8%B8%E7%94%A8/" style="font-size: 1.5em; color: #99a9bf">开发常用</a> <a href="/tags/%E5%AD%A6%E4%B9%A0/" style="font-size: 1.3em; color: #99a1ac">学习</a> <a href="/tags/%E5%85%B6%E4%BB%96/" style="font-size: 1.4em; color: #99a5b6">其他</a></div></div><div class="card-widget card-archives"><div class="item-headline"><i class="fas fa-archive"></i><span>归档</span></div><ul class="card-archive-list"><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2024/09/"><span class="card-archive-list-date">九月 2024</span><span class="card-archive-list-count">3</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2024/06/"><span class="card-archive-list-date">六月 2024</span><span class="card-archive-list-count">3</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2024/05/"><span class="card-archive-list-date">五月 2024</span><span class="card-archive-list-count">2</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2024/02/"><span class="card-archive-list-date">二月 2024</span><span class="card-archive-list-count">4</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2023/11/"><span class="card-archive-list-date">十一月 2023</span><span class="card-archive-list-count">5</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2023/10/"><span class="card-archive-list-date">十月 2023</span><span class="card-archive-list-count">1</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2022/02/"><span class="card-archive-list-date">二月 2022</span><span class="card-archive-list-count">1</span></a></li></ul></div><div class="card-widget card-webinfo"><div class="item-headline"><i class="fas fa-chart-line"></i><span>网站资讯</span></div><div class="webinfo"><div class="webinfo-item"><div class="item-name">文章数目 :</div><div class="item-count">19</div></div><div class="webinfo-item"><div class="item-name">已运行时间 :</div><div class="item-count" id="runtimeshow" data-publishDate="2023-11-17T16:00:00.000Z"><i class="fa-solid fa-spinner fa-spin"></i></div></div><div class="webinfo-item"><div class="item-name">本站总字数 :</div><div class="item-count">326.9k</div></div><div class="webinfo-item"><div class="item-name">本站访客数 :</div><div class="item-count" id="busuanzi_value_site_uv"><i class="fa-solid fa-spinner fa-spin"></i></div></div><div class="webinfo-item"><div class="item-name">本站总访问量 :</div><div class="item-count" id="busuanzi_value_site_pv"><i class="fa-solid fa-spinner fa-spin"></i></div></div><div class="webinfo-item"><div class="item-name">最后更新时间 :</div><div class="item-count" id="last-push-date" data-lastPushDate="2024-10-16T13:13:33.150Z"><i class="fa-solid fa-spinner fa-spin"></i></div></div></div></div></div></div></main><footer id="footer"><div id="footer-wrap"><div class="copyright">©2023 - 2024 By 无泪真伤</div><div class="framework-info"><span>框架 </span><a target="_blank" rel="noopener" href="https://hexo.io">Hexo</a><span class="footer-separator">|</span><span>主题 </span><a target="_blank" rel="noopener" href="https://github.com/jerryc127/hexo-theme-butterfly">Butterfly</a></div><div class="footer_custom_text">Welcome to my blog! --by Wuleizhenshang</div></div></footer></div><div id="rightside"><div id="rightside-config-hide"><button id="darkmode" type="button" title="浅色和深色模式转换"><i class="fas fa-adjust"></i></button><button id="hide-aside-btn" type="button" title="单栏和双栏切换"><i class="fas fa-arrows-alt-h"></i></button></div><div id="rightside-config-show"><button id="rightside-config" type="button" title="设置"><i class="fas fa-cog fa-spin"></i></button><button id="go-up" type="button" title="回到顶部"><span class="scroll-percent"></span><i class="fas fa-arrow-up"></i></button></div></div><div><script src="/js/utils.js"></script><script src="/js/main.js"></script><script src="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox/fancybox.umd.min.js"></script><div class="js-pjax"><script>window.typedJSFn = {
init: (str) => {
window.typed = new Typed('#subtitle', Object.assign({
strings: str,
startDelay: 300,
typeSpeed: 150,
loop: true,
backSpeed: 50,
}, null))
},
run: (subtitleType) => {
if (true) {
if (typeof Typed === 'function') {
subtitleType()
} else {
getScript('https://cdn.jsdelivr.net/npm/typed.js/dist/typed.umd.min.js').then(subtitleType)
}
} else {
subtitleType()
}
}
}
</script><script>function subtitleType () {
if (true) {
typedJSFn.init(["如果你很迷茫的话就去读书,健身,这是唯一你付出就会有回报的东西","Nothing is impossible!"])
} else {
document.getElementById("subtitle").textContent = "如果你很迷茫的话就去读书,健身,这是唯一你付出就会有回报的东西"
}
}
typedJSFn.run(subtitleType)</script></div><script id="canvas_nest" defer="defer" color="0,0,255" opacity="0.7" zIndex="-1" count="99" mobile="false" src="https://cdn.jsdelivr.net/npm/butterfly-extsrc/dist/canvas-nest.min.js"></script><script src="https://cdn.jsdelivr.net/npm/butterfly-extsrc/dist/activate-power-mode.min.js"></script><script>POWERMODE.colorful = true;
POWERMODE.shake = false# open shake (抖動特效);
POWERMODE.mobile = false;
document.body.addEventListener('input', POWERMODE);
</script><script id="click-heart" src="https://cdn.jsdelivr.net/npm/butterfly-extsrc/dist/click-heart.min.js" async="async" mobile="false"></script><script async data-pjax src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script><div id="local-search"><div class="search-dialog"><nav class="search-nav"><span class="search-dialog-title">搜索</span><span id="loading-status"></span><button class="search-close-button"><i class="fas fa-times"></i></button></nav><div class="is-center" id="loading-database"><i class="fas fa-spinner fa-pulse"></i><span> 数据库加载中</span></div><div class="search-wrap"><div id="local-search-input"><div class="local-search-box"><input class="local-search-box--input" placeholder="搜索文章" type="text"/></div></div><hr/><div id="local-search-results"></div><div id="local-search-stats-wrap"></div></div></div><div id="search-mask"></div><script src="/js/search/local-search.js"></script></div></div></body></html>