uniapp android 原生插件开发-测试流程

前言

最近公司要求研究一下 uniapp 的 android 原生插件的开发,为以后的工作做准备。这篇文章记录一下自己的学习过程,也帮助一下有同样需求的同学们 : )


一、下载安装Hbuilder X , Android studio(相关的安装配置过程网上有很多,在这里就不再赘述,具体配置要求也可以访问官网查看Android 插件开发教程)

二、开发步骤

1.下载uniapp 的Android 离线SDK(可以前往官网链接下载Android 离线SDK)

下载后得到压缩包

2.android studio 导入工程

解压压缩包 ,使用android studio 导入压缩包中的UniPlugin-Hello-AS项目

导入后目录结构为

然后就可以开始我们的开发之旅了

3.新建module项目


选择 Android Library 输入你的插件名称 点击finish

将app目录下的libs中的uniapp-v8-release.aar复制到你创建的module目录下的libs中(我创建的是xiaohu_TestModule,后面都用xiaohu_TestModule讲解)
在这里插入图片描述

打开你创建的xiaohu_TestModule目录下的build.gradle
修改依赖为

<span style="color:rgba(0, 0, 0, 0.75)"><span style="color:#000000"><span style="background-color:#282c34"><code class="language-java">dependencies <span style="color:#999999">{</span>compileOnly <span style="color:#61aeee">fileTree</span><span style="color:#999999">(</span>dir<span style="color:#669900">:</span> <span style="color:#669900">'libs'</span><span style="color:#999999">,</span> include<span style="color:#669900">:</span> <span style="color:#999999">[</span><span style="color:#669900">'*.jar'</span><span style="color:#999999">]</span><span style="color:#999999">)</span>compileOnly <span style="color:#61aeee">fileTree</span><span style="color:#999999">(</span>dir<span style="color:#669900">:</span> <span style="color:#669900">'libs'</span><span style="color:#999999">,</span> include<span style="color:#669900">:</span> <span style="color:#999999">[</span><span style="color:#669900">'uniapp-v8-release.aar'</span><span style="color:#999999">]</span><span style="color:#999999">)</span>compileOnly <span style="color:#669900">'androidx.legacy:legacy-support-v4:1.0.0'</span>compileOnly <span style="color:#669900">'androidx.appcompat:appcompat:1.0.0'</span>compileOnly <span style="color:#669900">'androidx.recyclerview:recyclerview:1.0.0'</span><span style="color:#5c6370">//下面的可以删除</span><span style="color:#5c6370">/*implementation 'androidx.appcompat:appcompat:1.2.0'implementation 'com.google.android.material:material:1.2.1'testImplementation 'junit:junit:4.+'androidTestImplementation 'androidx.test.ext:junit:1.1.2'androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'*/</span>
<span style="color:#999999">}</span>
</code></span></span></span>
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17

然后module就配置完了,然后就是android 的开发工作
下面是一个简单的示例。

新建类AndroidDialog 继承UniModule(示例是调用android原生的系统弹窗)

在这里插入图片描述
然后在AndroidDialog内写上自己的代码

<span style="color:rgba(0, 0, 0, 0.75)"><span style="color:#000000"><span style="background-color:#282c34"><code class="language-java"><span style="color:#c678dd">package</span> com<span style="color:#999999">.</span>xiaohu<span style="color:#999999">.</span>xiaohu_testmodule<span style="color:#999999">;</span><span style="color:#c678dd">import</span> android<span style="color:#999999">.</span>app<span style="color:#999999">.</span>Activity<span style="color:#999999">;</span>
<span style="color:#c678dd">import</span> android<span style="color:#999999">.</span>content<span style="color:#999999">.</span>DialogInterface<span style="color:#999999">;</span>
<span style="color:#c678dd">import</span> android<span style="color:#999999">.</span>util<span style="color:#999999">.</span>Log<span style="color:#999999">;</span>
<span style="color:#c678dd">import</span> android<span style="color:#999999">.</span>widget<span style="color:#999999">.</span>Toast<span style="color:#999999">;</span><span style="color:#c678dd">import</span> androidx<span style="color:#999999">.</span>appcompat<span style="color:#999999">.</span>app<span style="color:#999999">.</span>AlertDialog<span style="color:#999999">;</span><span style="color:#c678dd">import</span> com<span style="color:#999999">.</span>taobao<span style="color:#999999">.</span>weex<span style="color:#999999">.</span>annotation<span style="color:#999999">.</span>JSMethod<span style="color:#999999">;</span>
<span style="color:#c678dd">import</span> com<span style="color:#999999">.</span>taobao<span style="color:#999999">.</span>weex<span style="color:#999999">.</span>bridge<span style="color:#999999">.</span>JSCallback<span style="color:#999999">;</span><span style="color:#c678dd">import</span> java<span style="color:#999999">.</span>util<span style="color:#999999">.</span>Map<span style="color:#999999">;</span><span style="color:#c678dd">import</span> io<span style="color:#999999">.</span>dcloud<span style="color:#999999">.</span>feature<span style="color:#999999">.</span>uniapp<span style="color:#999999">.</span>common<span style="color:#999999">.</span>UniModule<span style="color:#999999">;</span><span style="color:#c678dd">public</span> <span style="color:#c678dd">class</span> AndroidDialog <span style="color:#c678dd">extends</span> UniModule <span style="color:#999999">{</span><span style="color:#5c6370">/*** 调用原生Dialog显示*/</span><span style="color:#999999">@JSMethod</span><span style="color:#999999">(</span>uiThread <span style="color:#669900">=</span> <span style="color:#56b6c2">true</span><span style="color:#999999">)</span>   <span style="color:#5c6370">//必须加上注释,不然uniapp无法调用</span><span style="color:#c678dd">public</span> <span style="color:#c678dd">void</span> <span style="color:#61aeee">showDialog</span><span style="color:#999999">(</span>JSCallback jsCallback<span style="color:#999999">)</span> <span style="color:#999999">{</span>    <span style="color:#5c6370">//需为pulic</span><span style="color:#c678dd">if</span> <span style="color:#999999">(</span>mWXSDKInstance <span style="color:#669900">!=</span> <span style="color:#c678dd">null</span> <span style="color:#669900">&&</span> mWXSDKInstance<span style="color:#999999">.</span><span style="color:#61aeee">getContext</span><span style="color:#999999">(</span><span style="color:#999999">)</span> <span style="color:#c678dd">instanceof</span> Activity<span style="color:#999999">)</span> <span style="color:#999999">{</span><span style="color:#c678dd">new</span> AlertDialog<span style="color:#999999">.</span>Builder<span style="color:#999999">(</span>mWXSDKInstance<span style="color:#999999">.</span><span style="color:#61aeee">getContext</span><span style="color:#999999">(</span><span style="color:#999999">)</span><span style="color:#999999">)</span><span style="color:#999999">.</span><span style="color:#61aeee">setTitle</span><span style="color:#999999">(</span><span style="color:#669900">"弹窗"</span><span style="color:#999999">)</span><span style="color:#999999">.</span><span style="color:#61aeee">setMessage</span><span style="color:#999999">(</span><span style="color:#669900">"这是一个测试弹窗"</span><span style="color:#999999">)</span><span style="color:#999999">.</span><span style="color:#61aeee">setPositiveButton</span><span style="color:#999999">(</span><span style="color:#669900">"确定"</span><span style="color:#999999">,</span> <span style="color:#c678dd">new</span> DialogInterface<span style="color:#999999">.</span>OnClickListener<span style="color:#999999">(</span><span style="color:#999999">)</span> <span style="color:#999999">{</span><span style="color:#999999">@Override</span><span style="color:#c678dd">public</span> <span style="color:#c678dd">void</span> <span style="color:#61aeee">onClick</span><span style="color:#999999">(</span>DialogInterface dialog<span style="color:#999999">,</span> <span style="color:#c678dd">int</span> which<span style="color:#999999">)</span> <span style="color:#999999">{</span>jsCallback<span style="color:#999999">.</span><span style="color:#61aeee">invoke</span><span style="color:#999999">(</span><span style="color:#669900">"点击了确定"</span><span style="color:#999999">)</span><span style="color:#999999">;</span><span style="color:#999999">}</span><span style="color:#999999">}</span><span style="color:#999999">)</span><span style="color:#999999">.</span><span style="color:#61aeee">setNegativeButton</span><span style="color:#999999">(</span><span style="color:#669900">"取消"</span><span style="color:#999999">,</span> <span style="color:#c678dd">new</span> DialogInterface<span style="color:#999999">.</span>OnClickListener<span style="color:#999999">(</span><span style="color:#999999">)</span> <span style="color:#999999">{</span><span style="color:#999999">@Override</span><span style="color:#c678dd">public</span> <span style="color:#c678dd">void</span> <span style="color:#61aeee">onClick</span><span style="color:#999999">(</span>DialogInterface dialog<span style="color:#999999">,</span> <span style="color:#c678dd">int</span> which<span style="color:#999999">)</span> <span style="color:#999999">{</span>jsCallback<span style="color:#999999">.</span><span style="color:#61aeee">invoke</span><span style="color:#999999">(</span><span style="color:#669900">"点击了取消"</span><span style="color:#999999">)</span><span style="color:#999999">;</span><span style="color:#999999">}</span><span style="color:#999999">}</span><span style="color:#999999">)</span><span style="color:#999999">.</span><span style="color:#61aeee">show</span><span style="color:#999999">(</span><span style="color:#999999">)</span><span style="color:#999999">;</span><span style="color:#999999">}</span><span style="color:#999999">}</span><span style="color:#5c6370">/*** 调用原生Toast显示传入内容*/</span><span style="color:#999999">@JSMethod</span><span style="color:#999999">(</span>uiThread <span style="color:#669900">=</span> <span style="color:#56b6c2">true</span><span style="color:#999999">)</span><span style="color:#c678dd">public</span> <span style="color:#c678dd">void</span> <span style="color:#61aeee">showToast</span><span style="color:#999999">(</span>String message<span style="color:#999999">)</span> <span style="color:#999999">{</span><span style="color:#c678dd">if</span> <span style="color:#999999">(</span>mWXSDKInstance <span style="color:#669900">!=</span> <span style="color:#c678dd">null</span> <span style="color:#669900">&&</span> mWXSDKInstance<span style="color:#999999">.</span><span style="color:#61aeee">getContext</span><span style="color:#999999">(</span><span style="color:#999999">)</span> <span style="color:#c678dd">instanceof</span> Activity<span style="color:#999999">)</span> <span style="color:#999999">{</span>Toast<span style="color:#999999">.</span><span style="color:#61aeee">makeText</span><span style="color:#999999">(</span>mWXSDKInstance<span style="color:#999999">.</span><span style="color:#61aeee">getContext</span><span style="color:#999999">(</span><span style="color:#999999">)</span><span style="color:#999999">,</span> message<span style="color:#999999">.</span><span style="color:#61aeee">toString</span><span style="color:#999999">(</span><span style="color:#999999">)</span><span style="color:#999999">,</span> Toast<span style="color:#999999">.</span>LENGTH_SHORT<span style="color:#999999">)</span><span style="color:#999999">.</span><span style="color:#61aeee">show</span><span style="color:#999999">(</span><span style="color:#999999">)</span><span style="color:#999999">;</span>Log<span style="color:#999999">.</span><span style="color:#61aeee">e</span><span style="color:#999999">(</span><span style="color:#669900">"调用处理"</span><span style="color:#999999">,</span><span style="color:#669900">"bu显示就bu快乐"</span><span style="color:#999999">)</span><span style="color:#999999">;</span><span style="color:#999999">}</span><span style="color:#999999">}</span>
<span style="color:#999999">}</span></code></span></span></span>
  • 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

到这一个简单的插件就写完了,但是我们肯定要先做一下测试才能发布或者给别人使用

4.调试插件

打开HbuilderX 新建unipp项目 uniTest
在这里插入图片描述
创建完成后的目录结构
在这里插入图片描述
修改index.vue的代码

在这里插入图片描述

<span style="color:rgba(0, 0, 0, 0.75)"><span style="color:#000000"><span style="background-color:#282c34"><code class="language-java"><span style="color:#999999"><</span>template<span style="color:#999999">></span><span style="color:#669900"><</span>view <span style="color:#c678dd">class</span><span style="color:#669900">=</span><span style="color:#669900">"content"</span><span style="color:#669900">></span><span style="color:#669900"><</span>view <span style="color:#c678dd">class</span><span style="color:#669900">=</span><span style="color:#669900">"button1"</span><span style="color:#669900">></span><span style="color:#669900"><</span>button <span style="color:#999999">@click</span><span style="color:#669900">=</span><span style="color:#669900">"showDialog(message)"</span><span style="color:#669900">></span>点击显示原生Dialog<span style="color:#669900"><</span><span style="color:#669900">/</span>button<span style="color:#669900">></span><span style="color:#669900"><</span><span style="color:#669900">/</span>view<span style="color:#669900">></span><span style="color:#669900"><</span><span style="color:#669900">/</span>view<span style="color:#669900">></span>
<span style="color:#669900"><</span><span style="color:#669900">/</span>template<span style="color:#669900">></span><span style="color:#999999"><</span>script<span style="color:#999999">></span><span style="color:#c678dd">const</span> AndroidDialogModule <span style="color:#669900">=</span> uni<span style="color:#999999">.</span><span style="color:#61aeee">requireNativePlugin</span><span style="color:#999999">(</span><span style="color:#669900">"AndroidDialog"</span><span style="color:#999999">)</span>export <span style="color:#c678dd">default</span> <span style="color:#999999">{</span><span style="color:#61aeee">data</span><span style="color:#999999">(</span><span style="color:#999999">)</span> <span style="color:#999999">{</span><span style="color:#999999">}</span><span style="color:#999999">,</span><span style="color:#61aeee">onLoad</span><span style="color:#999999">(</span><span style="color:#999999">)</span> <span style="color:#999999">{</span><span style="color:#999999">}</span><span style="color:#999999">,</span>methods<span style="color:#669900">:</span> <span style="color:#999999">{</span><span style="color:#61aeee">showDialog</span><span style="color:#999999">(</span>message<span style="color:#999999">)</span> <span style="color:#999999">{</span>AndroidDialogModule<span style="color:#999999">.</span><span style="color:#61aeee">showDialog</span><span style="color:#999999">(</span>processokdata <span style="color:#669900">=</span><span style="color:#669900">></span> <span style="color:#999999">{</span>AndroidDialogModule<span style="color:#999999">.</span><span style="color:#61aeee">showToast</span><span style="color:#999999">(</span>processokdata<span style="color:#999999">)</span><span style="color:#999999">}</span><span style="color:#999999">)</span><span style="color:#999999">}</span><span style="color:#999999">,</span><span style="color:#999999">}</span><span style="color:#999999">}</span>
<span style="color:#669900"><</span><span style="color:#669900">/</span>script<span style="color:#669900">></span><span style="color:#999999"><</span>style<span style="color:#999999">></span><span style="color:#999999">.</span>button1 <span style="color:#999999">{</span>display<span style="color:#669900">:</span> flex<span style="color:#999999">;</span>margin<span style="color:#669900">-</span>top<span style="color:#669900">:</span> <span style="color:#98c379">200</span>rpx<span style="color:#999999">;</span>margin<span style="color:#669900">-</span>left<span style="color:#669900">:</span> auto<span style="color:#999999">;</span>margin<span style="color:#669900">-</span>right<span style="color:#669900">:</span> auto<span style="color:#999999">;</span>flex<span style="color:#669900">-</span>direction<span style="color:#669900">:</span> column<span style="color:#999999">;</span>align<span style="color:#669900">-</span>items<span style="color:#669900">:</span> center<span style="color:#999999">;</span>justify<span style="color:#669900">-</span>content<span style="color:#669900">:</span> center<span style="color:#999999">;</span><span style="color:#999999">}</span>
<span style="color:#669900"><</span><span style="color:#669900">/</span>style<span style="color:#669900">></span>
</code></span></span></span>
  • 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

打包为本地资源
在这里插入图片描述
编译完成后会返回文件存放地址
在这里插入图片描述
将打包得到的文件夹名称是__UNI__24505A6(类似这样的)
在这里插入图片描述复制到android 项目中的app/src/main/assets/apps下
在这里插入图片描述
将同目录下data文件夹中的dcloud_control文件中的appid改为你复制的文件夹名称
在这里插入图片描述

在dcloud_uniplugins.json中添加插件配置
在这里插入图片描述
最后还需要配置两个文件

  1. app目录下的AndroidMainfest.xml中需要配置uniapp的key值,可以从dcloud的开发者平台配置获取,这个很简单就不在说了。
    在这里插入图片描述
  2. 在app目录下的build.gradle中依赖你写的module
    在这里插入图片描述

到这里一个简单的原生插件就开发完成了,运行到手机或者模拟器就能得到你的成果了
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

官网  简介 | uni小程序SDK

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/706702.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

springboot + easyRules 搭建规则引擎服务

依赖 <dependency><groupId>org.jeasy</groupId><artifactId>easy-rules-core</artifactId><version>4.0.0</version></dependency><dependency><groupId>org.jeasy</groupId><artifactId>easy-rules…

阿里巴巴淘口令API的安全保障措施在电商领域的应用与实践

在电商领域&#xff0c;阿里巴巴淘口令API的安全保障措施是非常重要的&#xff0c;因为它们确保了数据的机密性、完整性和可用性。以下是一些关于阿里巴巴淘口令API安全保障措施在电商领域的应用与实践&#xff0c;并附带相关代码示例&#xff1a; 1. 身份验证和授权 应用示例…

VoIP之AVPF(Audio-Visual Profile with Feedback)

在VoIP音视频通话中&#xff0c;接收者可以依赖rtcp机制向发送者报告RTP数据接收的统计情况&#xff0c;以便发送者根据接收情况&#xff08;丢包数量等&#xff09;调整传输行为&#xff08;发送速率等&#xff09;。由于基本的RTCP统计报告是定期发送的&#xff0c;通过该机制…

安全运营中心(SOC)综合指南

什么是安全运营中心&#xff08;SOC&#xff09; 安全运营中心&#xff0c;也称为信息安全运营中心 &#xff08;ISOC&#xff09;&#xff0c;是结构良好的网络安全战略的核心。安全运营中心是一个集中式枢纽&#xff0c;无论是在组织内部还是外包&#xff0c;都致力于对整个…

云计算时代的运维: 职业发展方向与岗位选择

✨✨ 欢迎大家来访Srlua的博文&#xff08;づ&#xffe3;3&#xffe3;&#xff09;づ╭❤&#xff5e;✨✨ &#x1f31f;&#x1f31f; 欢迎各位亲爱的读者&#xff0c;感谢你们抽出宝贵的时间来阅读我的文章。 我是Srlua&#xff0c;在这里我会分享我的知识和经验。&#x…

Nginx网络服务五-----rewrite和反向代理

1.rewrite 1.1rewrite指令 通过正则表达式的匹配来改变URI&#xff0c;可以同时存在一个或多个指令&#xff0c;按照顺序依次对URI进行匹配&#xff0c;rewrite主要是针对用户请求的URL或者是URI做具体处理 官方文档&#xff1a; https://nginx.org/en/docs/http/ngx_http_r…

numpy数组索引

文章目录 简介索引方法 简介 numpy是python中最常用的科学计算包&#xff0c;而数组则是是numpy的核心类型&#xff0c;也是Python称为科学计算领域首选语言的关键类型&#xff0c;可以不夸张地说&#xff0c;正是数组类型的强大与易用性&#xff0c;筑就了Python帝国。 和Py…

自动驾驶消息传输机制-LCM

需要用到LCM消息通讯&#xff0c;遂研究下。 这里写目录标题 1 LCM简介2. LCM源码分析3 LCM C教程与实例3.1 安装配置及介绍3.2 创建类型定义3.3 初始化LCM3.4 发布publish一个消息3.5 订阅和接收一个消息3.6 LCM进程间通讯3.7 注意事项&#xff1f;3.7.1 当数据结构定义的是数…

代码随想录算法训练营29期|day64 任务以及具体安排

第十章 单调栈part03 有了之前单调栈的铺垫&#xff0c;这道题目就不难了。 84.柱状图中最大的矩形class Solution {int largestRectangleArea(int[] heights) {Stack<Integer> st new Stack<Integer>();// 数组扩容&#xff0c;在头和尾各加入一个元素int [] ne…

斯元Z-ONE-China Cybersecurity Tech Landscape·中国网络安全全景图-百度网盘下载

面向全球&#xff0c;斯元Z-ONE正式发布首版「China Cybersecurity Tech Landscape中国网络安全全景图」。 为了提升海外市场对中国网络安全行业的全局认识&#xff0c;方便国际客户及合作伙伴了解中国网络安全科技的赛道分布和国内外厂商对标&#xff0c;助力中国网安厂商出海…

uni-app之android原生插件开发

官网 uni小程序SDK 一 插件简介 1.1 当HBuilderX中提供的能力无法满足App功能需求&#xff0c;需要通过使用Andorid/iOS原生开发实现时&#xff0c;可使用App离线SDK开发原生插件来扩展原生能力。 1.2 插件类型有两种&#xff0c;Module模式和Component模式 Module模式&…

【PyTorch笔记 04】F.cross_entropy的使用

torch.nn.functional.cross_entropy是PyTorch中用于计算交叉熵损失的函数&#xff0c;非常适合用于多分类问题。这个函数结合了log_softmax操作和nll_loss&#xff08;负对数似然损失&#xff09;的计算&#xff0c;因此输入得分&#xff08;即模型输出&#xff09;不需要事先经…

【架构笔记1】剃刀思维-如无必要,勿增实体

欢迎来到文思源想的架构空间&#xff0c;前段时间博主做了一个工作经历复盘&#xff0c;10年开发路&#xff0c;走了不少弯路&#xff0c;也算积累了不少软件开发、架构设计的经验和心得&#xff0c;确实有必要好好盘一盘&#xff0c;作为个人的总结&#xff0c;同时也留给有缘…

对抗生成网络

作用 手底有一堆数据&#xff0c;告诉它要生成什么东西&#xff0c;它就这么去做。 超分辨率重构 告诉模型什么样的东西是一个低分辨率图像&#xff0c;什么样的东西是高分辨率图像&#xff0c;再设计一个损失函数。让计算机学习两者之间的关系&#xff0c;怎样由一个低分辨率…

2.6基本算法之动态规划1944:吃糖果

名名的妈妈从外地出差回来&#xff0c;带了一盒好吃又精美的巧克力给名名&#xff08;盒内共有 N 块巧克力&#xff0c;20 > N >0&#xff09;。妈妈告诉名名每天可以吃一块或者两块巧克力。假设名名每天都吃巧克力&#xff0c;问名名共有多少种不同的吃完巧克力的方案。…

Nginx一网打尽:动静分离、压缩、缓存、黑白名单、跨域、高可用、防盗链、SSL、性能优化

引言 一、性能怪兽-Nginx概念深入浅出 二、Nginx环境搭建 三、Nginx反向代理-负载均衡 四、Nginx动静分离 五、Nginx资源压缩 六、Nginx缓冲区 七、Nginx缓存机制 八、Nginx实现IP黑白名单 九、Nginx跨域配置 十、Nginx防盗链设计 十一、Nginx大文件传输配置 十二、Nginx配置SL…

redis真实使用

Spring Data Redis中提供了一个高度封装的类&#xff1a;RedisTemplate&#xff0c;对相关api进行了归类封装,将同一类型操作封装为operation接口&#xff0c;具体分类如下&#xff1a; ValueOperations&#xff1a;string数据操作 SetOperations&#xff1a;set类型数据操作 …

Flink SQL 中的流式概念:状态算子

博主历时三年精心创作的《大数据平台架构与原型实现&#xff1a;数据中台建设实战》一书现已由知名IT图书品牌电子工业出版社博文视点出版发行&#xff0c;点击《重磅推荐&#xff1a;建大数据平台太难了&#xff01;给我发个工程原型吧&#xff01;》了解图书详情&#xff0c;…

动态规划-01背包问题新解(c)

动态规划-01背包问题新解 概述动态规划01背包问题传统思路算法官方递推关系算法2种算法比较 概述 本文将从一个新的角度来描述和实现01背包问题&#xff0c;以协助对01背包问题以及教材上的算法的彻底理解。 新的角度为&#xff1a;传统思路算法&#xff0c;“新”是新在与绝…

【Python】Ubuntu创建虚拟环境运行Python

虚拟环境让项目之间的依赖关系更加清晰&#xff0c;同时也可以避免全局安装的包的版本冲突问题。 在Ubuntu系统上&#xff0c;可以使用Python的内置工具venv来创建虚拟环境。以下是在Ubuntu上创建Python虚拟环境的步骤&#xff1a; 安装Python虚拟环境工具&#xff1a;首先确保…