当前位置: 首页 > news >正文

Android前台服务和通知

前台服务

Android 13及以上系统需要动态获取通知权限。

//android 13及以上系统动态获取通知权限
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {checkPostNotificationPermission();
}
private void checkPostNotificationPermission() {if (ActivityCompat.checkSelfPermission(this, android.Manifest.permission.POST_NOTIFICATIONS)!= PackageManager.PERMISSION_GRANTED) {ActivityCompat.requestPermissions((Activity) this, new String[]{Manifest.permission.POST_NOTIFICATIONS}, 200);} else if (manager != null) {//通知ID设置(您可以使用任何您想要的ID,相同ID通知只会显示一个)。manager.notify(2, builder.build());}
}@Override
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {super.onRequestPermissionsResult(requestCode, permissions, grantResults);if (requestCode == 200) {if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {//允许了通知权限} else {Toast.makeText(this, "您拒绝了通知权限", Toast.LENGTH_SHORT).show();}}
}

别忘记添加通知权限

<!--发布通知权限-->
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />

开启前台服务需要添加前台服务权限

<!--前台服务权限-->
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />

通知震动需要添加震动权限

<!--振动器权限-->
<uses-permission android:name="android.permission.VIBRATE" />

前台服务代码

import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.app.Service;
import android.content.Intent;
import android.graphics.Color;
import android.net.Uri;
import android.os.Build;
import android.os.IBinder;import androidx.annotation.Nullable;
import androidx.core.app.NotificationCompat;import com.example.javatest.MainActivity;
import com.example.javatest.R;/*** created by cwj on 2023-10-19* Description: 前台服务*/
public class ForegroundService extends Service {@Overridepublic void onCreate() {super.onCreate();if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {CharSequence name = getString(R.string.app_name);int importance = NotificationManager.IMPORTANCE_DEFAULT;NotificationChannel channel = new NotificationChannel("CHANNEL_ID", name, importance);channel.setDescription("前台服务守护进程");NotificationManager notificationManager = getSystemService(NotificationManager.class);notificationManager.createNotificationChannel(channel);}//设置服务跳转Intent intent = new Intent(this, MainActivity.class);intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);PendingIntent pendingIntent = PendingIntent.getActivity(this, 1, intent, PendingIntent.FLAG_ONE_SHOT | PendingIntent.FLAG_IMMUTABLE);NotificationCompat.Builder builder = new NotificationCompat.Builder(this, "CHANNEL_ID")// 设置通知的小图标。.setSmallIcon(R.mipmap.ic_launcher)//设置通知的标题。.setContentTitle(getString(R.string.app_name))//设置通知的内容.setContentText("进程守护中")//设置通知的优先级。.setPriority(NotificationCompat.PRIORITY_DEFAULT)//震动模式的通知在Android O及以上。.setVibrate(new long[]{0, 1000, 500, 1000})//在Android O及以上的系统上使用LED光色和微信号。.setLights(Color.RED, 1000, 1000)//设置Android O及以上版本的通知声音。.setSound(Uri.parse("android.resource://" + this.getPackageName() + "/raw/notification_sound"))//如果需要,在Android O及以上版本设置较大的通知标题。// .setLargeTitle("Large Title Text")//如果需要,在Android O及以上版本设置通知的子文本。// .setSubText("Sub Text")//如果需要,在Android O及以上版本设置大字体通知。// .setStyle(new NotificationCompat.BigTextStyle().bigText("Big Text"))//如果需要,在Android O及以上版本设置通知摘要文本(当有多个具有相同优先级的通知时显示摘要文本)。// .setSummaryText("Summary Text")//如果需要,在通知中添加动作按钮(可用于启动活动或发送广播)。// .addAction(R.drawable.ic_action, "Action Title", PendingIntent)//设置可点击跳转.setContentIntent(pendingIntent);// 将通知设置为前台服务startForeground(1, builder.build());}@Overridepublic int onStartCommand(Intent intent, int flags, int startId) {// 在这里执行需要在前台运行的任务// 返回START_STICKY表示服务在被杀死后会自动重启return START_STICKY;}@Nullable@Overridepublic IBinder onBind(Intent intent) {return null;}@Overridepublic void onDestroy() {super.onDestroy();// 停止前台服务stopForeground(true);stopSelf();}
}

application中添加服务

<serviceandroid:name=".service.ForegroundService"android:enabled="true"android:exported="false" />

activity中启动服务

Intent intent = new Intent(this, ForegroundService.class);
// Android 8.0使用startForegroundService在前台启动新服务
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {startForegroundService(intent);
} else {startService(intent);

创建通知

 模拟发送通知

binding.iv.setOnClickListener(v ->showNotification(getString(R.string.app_name), dateToString(System.currentTimeMillis(), "yyyy-MM-dd HH:mm:ss") + "您收到一条消息")
);

创建通知及通知点击取消通知

private NotificationCompat.Builder builder;
private NotificationManagerCompat manager;private void showNotification(String title, String content) {// 创建通知频道,如果用户没有创建,则会自动创建。String CHANNEL_ID = "message";if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {if (getSystemService(NotificationManager.class).getNotificationChannel(CHANNEL_ID) == null) {NotificationChannel channel = new NotificationChannel(CHANNEL_ID, "消息", NotificationManager.IMPORTANCE_DEFAULT);//通知的振动模式。channel.setVibrationPattern(new long[]{0, 1000, 500, 1000});//为通知通道启用振动。channel.enableVibration(true);//设置通道的颜色。channel.setLightColor(Color.RED);//设置通道的锁屏可见性。channel.setLockscreenVisibility(NotificationCompat.VISIBILITY_PUBLIC);getSystemService(NotificationManager.class).createNotificationChannel(channel);}}//设置服务跳转Intent intent = new Intent(this, MainActivity.class);intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);PendingIntent pendingIntent = PendingIntent.getActivity(this, 2, intent, PendingIntent.FLAG_ONE_SHOT | PendingIntent.FLAG_IMMUTABLE);// 创建并分发通知。builder = new NotificationCompat.Builder(this, CHANNEL_ID)// 设置通知的小图标。.setSmallIcon(R.mipmap.ic_launcher)//设置通知的标题。.setContentTitle(title)//设置通知的内容.setContentText(content)//设置通知的优先级。.setPriority(NotificationCompat.PRIORITY_DEFAULT)//震动模式的通知在Android O及以上。.setVibrate(new long[]{0, 1000, 500, 1000})//在Android O及以上的系统上使用LED光色和微信号。.setLights(Color.RED, 1000, 1000)//设置Android O及以上版本的通知声音。.setSound(Uri.parse("android.resource://" + this.getPackageName() + "/raw/notification_sound"))//如果需要,在Android O及以上版本设置较大的通知标题。// .setLargeTitle("Large Title Text")//如果需要,在Android O及以上版本设置通知的子文本。// .setSubText("Sub Text")//如果需要,在Android O及以上版本设置大字体通知。// .setStyle(new NotificationCompat.BigTextStyle().bigText("Big Text"))//如果需要,在Android O及以上版本设置通知摘要文本(当有多个具有相同优先级的通知时显示摘要文本)。// .setSummaryText("Summary Text")//如果需要,在通知中添加动作按钮(可用于启动活动或发送广播)。// .addAction(R.drawable.ic_action, "Action Title", PendingIntent)//设置可点击跳转.setContentIntent(pendingIntent)//开启点按通知后自动移除通知.setAutoCancel(true);manager = NotificationManagerCompat.from(this);if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {checkPostNotificationPermission();} else {// 在 Android 10 或更早版本中,不需要请求此权限。//ID要和前台服务ID区分开,相同ID只能显示一条通知。manager.notify(2, builder.build());}

activity完整代码

import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.app.ActivityCompat;
import androidx.core.app.NotificationCompat;
import androidx.core.app.NotificationManagerCompat;import android.Manifest;
import android.app.Activity;
import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.graphics.Color;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.widget.Toast;import com.example.javatest.databinding.ActivityMainBinding;
import com.example.javatest.service.ForegroundService;import java.text.SimpleDateFormat;
import java.util.Date;public class MainActivity extends AppCompatActivity {private ActivityMainBinding binding;@Overrideprotected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);binding = ActivityMainBinding.inflate(getLayoutInflater());setContentView(binding.getRoot());initView();initData();}private void initView() {//android 13及以上系统动态获取通知权限if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {checkPostNotificationPermission();}Intent intent = new Intent(this, ForegroundService.class);// Android 8.0使用startForegroundService在前台启动新服务if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {startForegroundService(intent);} else {startService(intent);}}private void initData() {binding.iv.setOnClickListener(v ->showNotification(getString(R.string.app_name), dateToString(System.currentTimeMillis(), "yyyy-MM-dd HH:mm:ss") + "您收到一条消息"));}private String dateToString(long time, String format) {Date date = new Date(time);SimpleDateFormat simpleDateFormat = new SimpleDateFormat(format);return simpleDateFormat.format(date);}private NotificationCompat.Builder builder;private NotificationManagerCompat manager;private void showNotification(String title, String content) {// 创建通知频道,如果用户没有创建,则会自动创建。String CHANNEL_ID = "message";if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {if (getSystemService(NotificationManager.class).getNotificationChannel(CHANNEL_ID) == null) {NotificationChannel channel = new NotificationChannel(CHANNEL_ID, "消息", NotificationManager.IMPORTANCE_DEFAULT);//通知的振动模式。channel.setVibrationPattern(new long[]{0, 1000, 500, 1000});//为通知通道启用振动。channel.enableVibration(true);//设置通道的颜色。channel.setLightColor(Color.RED);//设置通道的锁屏可见性。channel.setLockscreenVisibility(NotificationCompat.VISIBILITY_PUBLIC);getSystemService(NotificationManager.class).createNotificationChannel(channel);}}//设置服务跳转Intent intent = new Intent(this, MainActivity.class);intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);PendingIntent pendingIntent = PendingIntent.getActivity(this, 2, intent, PendingIntent.FLAG_ONE_SHOT | PendingIntent.FLAG_IMMUTABLE);// 创建并分发通知。builder = new NotificationCompat.Builder(this, CHANNEL_ID)// 设置通知的小图标。.setSmallIcon(R.mipmap.ic_launcher)//设置通知的标题。.setContentTitle(title)//设置通知的内容.setContentText(content)//设置通知的优先级。.setPriority(NotificationCompat.PRIORITY_DEFAULT)//震动模式的通知在Android O及以上。.setVibrate(new long[]{0, 1000, 500, 1000})//在Android O及以上的系统上使用LED光色和微信号。.setLights(Color.RED, 1000, 1000)//设置Android O及以上版本的通知声音。.setSound(Uri.parse("android.resource://" + this.getPackageName() + "/raw/notification_sound"))//如果需要,在Android O及以上版本设置较大的通知标题。// .setLargeTitle("Large Title Text")//如果需要,在Android O及以上版本设置通知的子文本。// .setSubText("Sub Text")//如果需要,在Android O及以上版本设置大字体通知。// .setStyle(new NotificationCompat.BigTextStyle().bigText("Big Text"))//如果需要,在Android O及以上版本设置通知摘要文本(当有多个具有相同优先级的通知时显示摘要文本)。// .setSummaryText("Summary Text")//如果需要,在通知中添加动作按钮(可用于启动活动或发送广播)。// .addAction(R.drawable.ic_action, "Action Title", PendingIntent)//设置可点击跳转.setContentIntent(pendingIntent)//开启点按通知后自动移除通知.setAutoCancel(true);manager = NotificationManagerCompat.from(this);if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {checkPostNotificationPermission();} else {// 在 Android 10 或更早版本中,不需要请求此权限。//显示ID为1的通知(您可以使用任何您想要的ID)。manager.notify(2, builder.build());}}private void checkPostNotificationPermission() {if (ActivityCompat.checkSelfPermission(this, android.Manifest.permission.POST_NOTIFICATIONS)!= PackageManager.PERMISSION_GRANTED) {ActivityCompat.requestPermissions((Activity) this, new String[]{Manifest.permission.POST_NOTIFICATIONS}, 200);} else if (manager != null) {//显示ID为1的通知(您可以使用任何您想要的ID)。manager.notify(2, builder.build());}}@Overridepublic void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {super.onRequestPermissionsResult(requestCode, permissions, grantResults);if (requestCode == 200) {if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {//允许了通知权限} else {Toast.makeText(this, "您拒绝了通知权限", Toast.LENGTH_SHORT).show();}}}
}

完整配置文件AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"xmlns:tools="http://schemas.android.com/tools"><!--网络权限--><uses-permission android:name="android.permission.INTERNET" /><!--前台服务权限--><uses-permission android:name="android.permission.FOREGROUND_SERVICE" /><!--振动器权限--><uses-permission android:name="android.permission.VIBRATE" /><!--全屏意图权限--><uses-permission android:name="android.permission.USE_FULL_SCREEN_INTENT" /><!--发布通知权限--><uses-permission android:name="android.permission.POST_NOTIFICATIONS" /><applicationandroid:allowBackup="true"android:dataExtractionRules="@xml/data_extraction_rules"android:fullBackupContent="@xml/backup_rules"android:icon="@mipmap/ic_launcher"android:label="@string/app_name"android:roundIcon="@mipmap/ic_launcher_round"android:supportsRtl="true"android:theme="@style/Theme.JavaTest"tools:targetApi="31"><activityandroid:name=".MainActivity"android:exported="true"><intent-filter><action android:name="android.intent.action.MAIN" /><category android:name="android.intent.category.LAUNCHER" /></intent-filter></activity><serviceandroid:name=".service.ForegroundService"android:enabled="true"android:exported="false" /></application></manifest>

build.gradle.kts文件中添加viewBinding支持

buildFeatures{viewBinding = true
}

相关文章:

Android前台服务和通知

前台服务 Android 13及以上系统需要动态获取通知权限。 //android 13及以上系统动态获取通知权限 if (Build.VERSION.SDK_INT > Build.VERSION_CODES.Q) {checkPostNotificationPermission(); } private void checkPostNotificationPermission() {if (ActivityCompat.chec…...

算法进修Day-36

算法进修Day-36 71. 简化路径 难度&#xff1a;中等 题目要求&#xff1a; 给你一个字符串 path &#xff0c;表示指向某一文件或目录的 Unix 风格 绝对路径 &#xff08;以 / 开头&#xff09;&#xff0c;请你将其转化为更加简洁的规范路径。 在 Unix 风格的文件系统中&am…...

postman自动化运行接口测试用例

做过接口测试的人&#xff0c;应该都知道postman &#xff0c;我们在日常的时候都可以利用postman做接口测试&#xff0c;我们可以把接口的case保存下来在collection里面&#xff0c;那么可能会有这样的需求&#xff0c;我们怎么把collection的用例放到jenkins中定时执行呢&…...

【Linux】Linux环境搭建

Linux环境搭建 前言Linux 环境的搭建方式一、Linux环境搭载购买云服务器 二、 使用 XShell 远程登陆到 Linux关于 Linux 桌面下载安装 XShell查看 Linux 主机 ip使用 XShell 登陆主机XShell 下的复制粘贴 前言 Linux 环境的搭建方式 主要有三种 直接安装在 物理机 上. 但是由…...

k8s day07

昨日内容回顾: - 污点: 影响Pod调度&#xff0c;污点是作用在worker节点上。语法格式: KEY[VALUE]:EFFECT 有三种污点。 EFFECT: - NoSchedule&#xff1a; 已经调度到当前节点的Pod不驱逐&#xff0c;并且不在接…...

压力大,休息日都没有,更别说年休假了

我一周要工作六天&#xff0c;每天至少十小时&#xff0c;连个休息日都没有。哪来的年休假&#xff1f;...

人手一个助理,三句话让AI替我们上班

目录 前言 从大模型上长出来的 AI 原生应用&#xff0c;才是关键 而这看起来只是一个小小的办公沟通场景&#xff0c;却是大模型重构的一个非常典型的场景。背后考验的也是大模型的综合能力应用 这种从AI原生角度进行的重构&#xff0c;离不开大模型的理解、生成、逻辑、记…...

【Eclipse Maven Tycho】如何通过maven执行eclipse application

通过maven执行eclipse application 前言命令行下运行通过maven tycho运行 前言 eclipse其实不只是一个桌面&#xff08;GUI&#xff09;程序&#xff0c;他还可以是一个命令行程序。如果你的产品或软件是基于eclipse开发的&#xff0c;并且他没有UI相关的功能&#xff0c;那么…...

(一)docker:建立oracle数据库

前言&#xff0c;整个安装过程主要根据docker-images/OracleDatabase/SingleInstance /README.md &#xff0c;里边对如何制作容器讲的比较清楚&#xff0c;唯一问题就是都是英文&#xff0c;可以使用谷歌浏览器自动翻译成中文&#xff0c;自己再对照英文相互参照来制作提前准备…...

在配置文件“tsconfig.json”中找不到任何输入。指定的 “include“ 路径为“[“**/*“]”,“exclude“ 路径为[]

在vscode中项目下的tsconfig.json莫名报错 解决办法 在目录中随便创建一个后缀为.ts的文件 便不再报错...

java编译时指定classpath

说明 Java编译时可以通过选项--class-path <path>&#xff0c;或者 -classpath <path>&#xff0c;或者-cp <path>来指定查找用户类文件、注释程序处理程序、或者源文件的位置。这个设置覆盖CLASSPATH环境变量的设置。如果没有设置-sourcepath&#xff0c;那…...

分享一下抽奖活动小程序怎么做

在当今数字化时代&#xff0c;抽奖活动小程序已成为一种高效、创新的营销方式。它不仅能够吸引用户的注意力&#xff0c;提高品牌知名度&#xff0c;还能促进用户参与度&#xff0c;增强用户对品牌的忠诚度。本文将详细介绍如何制作一个成功的抽奖活动小程序&#xff0c;以及它…...

同为科技(TOWE)工业级多位USB快充桌面PDU插座

如今&#xff0c;许多便捷式、轻薄化电子设备越来越多&#xff0c;很多设备上预留的端口越来越少&#xff0c;甚至很多款笔记本电脑只预留了一个单一的Type-C接口。这样做虽然在体验感、美观度和轻薄尺寸的优势显而易见&#xff0c;然而也存在接口不足的明显弊端。USB快充插排产…...

testt

wd wwwwwwwwwwwwww qdwqdwqd...

Git Bash(一)Windows下安装及使用

目录 一、简介1.1 什么是Git&#xff1f;1.2 Git 的主要特点1.3 什么是 Git Bash&#xff1f; 二、下载三、安装3.1 同意协议3.2 选择安装位置3.3 其他配置&#xff08;【Next】 即可&#xff09;3.4 安装完毕3.5 打开 Git Bash 官网地址&#xff1a; https://www.git-scm.com/…...

软考公告 | 关于2023年下半年软考批次安排

按照《2023年下半年计算机技术与软件专业技术资格&#xff08;水平&#xff09;考试有关工作调整的通告》&#xff0c;自2023年下半年起&#xff0c;计算机软件资格考试方式均由纸笔考试改革为计算机化考试。 为进一步提升考试服务质量和水平, 便利考生考试, 减少考生参加考试…...

react 中ref 属性的三种写法

目录 1. 字符串 ref 2.dom节点上使用回调函数ref 3.React.createRef() 1. 字符串 ref 最早的ref用法。&#xff08;由于效率问题&#xff0c;现在官方不推荐使用这种写法。&#xff09; 1.dom节点上使用&#xff0c;通过this.refs.xxxx来引用真实的dom节点 <input ref&q…...

v4l2-ioctl.c的一些学习和整理

可以发现&#xff0c;这个宏用的很好&#xff0c;简洁易扩展&#xff0c;自己写代码可以学习下 #define IOCTL_INFO(_ioctl, _func, _debug, _flags) \[_IOC_NR(_ioctl)] { \.ioctl _ioctl, \.flags _flags, \.name #_ioctl, \.func _func, \.debug _…...

Python实战小项目分享

Python实战小项目包括网络爬虫、数据分析和可视化、文本处理、图像处理、聊天机器人、任务管理工具、游戏开发和网络服务器等。这些项目提供了实际应用场景和问题解决思路&#xff0c;可以选择感兴趣的项目进行实践&#xff0c;加深对Python编程的理解和掌握。在实践过程中&…...

使用Dockerfile生成docker镜像和容器的方法记录

一、相关介绍 Docker 是一个开源的容器化平台&#xff0c;其中的主要概念是容器和镜像。 容器是 Docker 的运行实例。 它是一个独立并可执行的软件包&#xff0c;包含了应用程序及其依赖的所有组件&#xff08;如代码、运行时环境、系统工具、库文件等&#xff09;。容器可以在…...

HsMod终极指南:让炉石传说游戏体验提升300%的免费插件

HsMod终极指南&#xff1a;让炉石传说游戏体验提升300%的免费插件 【免费下载链接】HsMod Hearthstone Modification Based on BepInEx 项目地址: https://gitcode.com/GitHub_Trending/hs/HsMod 还在为炉石传说冗长的动画和繁琐操作烦恼吗&#xff1f;HsMod插件正是为你…...

RTX 4090D+PyTorch 2.8实战:从零开始你的第一个AI项目

RTX 4090DPyTorch 2.8实战&#xff1a;从零开始你的第一个AI项目 1. 环境准备与快速验证 1.1 镜像优势解析 这个预装PyTorch 2.8的深度学习镜像专为RTX 4090D 24GB显卡优化&#xff0c;解决了AI开发者常见的三大痛点&#xff1a; 环境冲突&#xff1a;预装所有必要组件&…...

新手必看:PyTorch 2.7镜像快速入门,无需配置直接调用GPU加速

新手必看&#xff1a;PyTorch 2.7镜像快速入门&#xff0c;无需配置直接调用GPU加速 1. 为什么选择PyTorch 2.7镜像&#xff1f; 深度学习环境配置一直是让新手头疼的问题。传统方式需要手动安装CUDA、cuDNN、PyTorch等组件&#xff0c;版本兼容性问题频出&#xff0c;往往耗…...

Mathtype公式处理难题解决:Nanbeige 4.1-3B识别图片公式并转为LaTeX

Mathtype公式处理难题解决&#xff1a;Nanbeige 4.1-3B识别图片公式并转为LaTeX 每次看到论文或者PDF里那些复杂的数学公式&#xff0c;你是不是也头疼过&#xff1f;想把它们弄到自己的文档里&#xff0c;要么得一个字一个字地敲&#xff0c;要么用Mathtype之类的工具慢慢点&…...

基于Qwen3-ASR-1.7B的智能录音笔方案:离线语音转写实现

基于Qwen3-ASR-1.7B的智能录音笔方案&#xff1a;离线语音转写实现 语音转写技术正逐步从云端走向终端&#xff0c;Qwen3-ASR-1.7B为嵌入式设备提供了本地化语音识别的可能性 1. 方案设计思路 传统的录音笔只能记录音频&#xff0c;后期需要导入电脑并通过联网服务才能转换成文…...

Qwen3-TTS实战:VMware环境搭建、模型部署与语音生成全解析

Qwen3-TTS实战&#xff1a;VMware环境搭建、模型部署与语音生成全解析 1. 为什么选择VMware部署Qwen3-TTS&#xff1f; 在本地部署AI模型时&#xff0c;环境隔离和资源管理常常让人头疼。VMware虚拟机提供了一种优雅的解决方案&#xff0c;特别适合像Qwen3-TTS这样的语音生成…...

【2026年最新600套毕设项目分享】基于微信小程序的商品展示(30033)

有需要的同学&#xff0c;源代码和配套文档领取&#xff0c;加文章最下方的名片哦 一、项目演示 项目演示视频 二、资料介绍 完整源代码&#xff08;前后端源代码SQL脚本&#xff09;配套文档&#xff08;LWPPT开题报告/任务书&#xff09;远程调试控屏包运行一键启动项目&…...

Sixfab NB-IoT Shield 底层驱动与AT指令深度解析

1. Sixfab NB-IoT Shield 嵌入式底层驱动技术解析Sixfab NB-IoT Shield 是一款面向 Arduino 生态的窄带物联网通信扩展板&#xff0c;专为低功耗广域网&#xff08;LPWAN&#xff09;应用设计&#xff0c;支持 3GPP R13/R14 标准的 NB-IoT 协议栈。该模块基于 u-blox SARA-N2 系…...

Qwen3.5-2B效果展示:漫画分镜图识别+剧情连贯性分析真实案例

Qwen3.5-2B效果展示&#xff1a;漫画分镜图识别剧情连贯性分析真实案例 1. 模型简介 Qwen3.5-2B是一款轻量化多模态基础模型&#xff0c;属于Qwen3.5系列的小参数版本&#xff08;20亿参数&#xff09;。这款模型主打低功耗、低门槛部署&#xff0c;特别适配端侧和边缘设备&a…...

Cesium与Vue.js融合构建:智慧管网三维可视化平台的架构演进与实践

1. 从零开始的智慧管网三维可视化平台架构设计 第一次接触智慧管网项目时&#xff0c;我被地下管线数据的复杂性震惊了。传统二维GIS系统就像用平面地图导航迷宫&#xff0c;而我们需要的是能透视地下五米的"X光眼"。这就是为什么选择Cesium作为核心引擎——它不仅能…...