Fusion APP-检查软件更新-远程公告

往期相关文章:

今天更新别的远程更新以及远程公告方法

效果:

image.png

 

image.png

image.png

设置渠道:现在网数据

注册以及添加软件

image.png

image.png

image.png

image.png

 

远程更新代码:(可以将代码放到按钮或者程序启动中)

image.png

image.png

代码:

只需要更改appid为你的appid

image.png

import "android.content.Intent"
import "android.net.Uri"
import "android.provider.Settings"
import "android.app.ProgressDialog"
import "android.app.AlertDialog"
local appid =12278
--将 10001 改成你在 https://aus.nowtime.cc 获取的 APPID
--获取方法[教程可能有点旧(其实我太懒),就先将就下吧] https://nowtime.cc/lua/331.html
local packinfo = this.getPackageManager().getPackageInfo(this.getPackageName(),((32552732/2/2-8183)/10000-6-231)/9)
local appinfo = this.getPackageManager().getApplicationInfo(this.getPackageName(),0)
local versionName = tostring(packinfo.versionName)-- 版本名(cc.nowtime)
local versionCode = tonumber(packinfo.versionCode)-- 版本号(10010)
local check_update_url = "https://aus.nowtime.cc/api/query/update?appid="..appid.."&version_code="..versionCode
if(activity.getApplicationContext().getSystemService(Context.CONNECTIVITY_SERVICE).getActiveNetworkInfo() == nil) then
  AlertDialog.Builder(this)
  .setTitle("提示")
  .setMessage("你未连接至互联网 或 当前连接的网络不可用,请检查你的网络设置")
  .setNeutralButton("确定",nil)
  .setNegativeButton("打开 数据连接",{onClick=function()
      intent = Intent(Settings.ACTION_DATA_ROAMING_SETTINGS)
      this.startActivity(intent)
    end})
  .setPositiveButton("连接 Wi-Fi",{onClick=function()
      intent = Intent(Settings.ACTION_WIFI_SETTINGS)
      this.startActivity(intent)
    end})
  .show();
  return false
  -- 就此中断,不再继续执行下面代码
end
--圆形旋转样式
check_update_dialog = ProgressDialog(this)
check_update_dialog.setProgressStyle(ProgressDialog.STYLE_SPINNER)
check_update_dialog.setTitle("提示")
--设置进度条的形式为圆形转动的进度条
check_update_dialog.setMessage("正在检查更新中,请稍等片刻……\n\n小提示,如果检查更新长时间无反应,按手机「返回键」可以取消检查更新")
check_update_dialog.setCancelable(true)--设置是否可以通过点击Back键取消
check_update_dialog.setCanceledOnTouchOutside(false)--设置在点击Dialog外是否取消Dialog进度条
check_update_dialog.setOnCancelListener{
  onCancel=function(l)
    print("您取消了「检查更新」操作")
    return false
  end}
--取消对话框监听事件
check_update_dialog.show()
Http.get(check_update_url,nil,"UTF-8",nil,function(http_code,content,cookie,header)
  check_update_dialog.hide()
  if (http_code == -1) then
    AlertDialog.Builder(this)
    .setTitle("提示")
    .setMessage("检查更新时出现了些小问题。可能的原因有:\n1.API 服务器可能暂时出现故障,请稍后再试!\n2.请检查你的网络设置?")
    .setPositiveButton("确定",nil)
    .setNeutralButton("检查 Wi-Fi",{onClick=function()
        intent = Intent(Settings.ACTION_WIFI_SETTINGS)
        this.startActivity(intent)
      end})
    .setNegativeButton("检查 移动数据连接",{onClick=function()
        intent = Intent(Settings.ACTION_DATA_ROAMING_SETTINGS)
        this.startActivity(intent)
      end})
    .show()
  else
    code = tonumber(string.match(content,'"code":(.-),'))-- 状态码
    msg = string.match(content,'"msg":"(.-)"')-- 消息
    if(code == 200) then
      new_versionCode = tonumber(string.match(content,'"version_code":(.-),'))--版本号
      new_versionName = string.match(content,'"version_name":"(.-)"')--版本名
      apk_url = string.gsub(string.match(content,'"apk_url":"(.-)"'),'\\','')--下载地址
      update_log = string.gsub(string.match(content,'"update_log":"(.-)"'),'\\n',"\n")--更新日志
      update_date = string.match(content,'"update_time":"(.-)"')--发布更新时间
      if (new_versionCode > versionCode) then
        AlertDialog.Builder(this)
        .setTitle("发现新版本")
        .setMessage("当前版本:V"..versionName.."("..versionCode..")\n最新版本:V"..new_versionName.."("..new_versionCode..")\n版本发布时间:"..update_date.."\n\n更新日志:\n"..update_log)
        .setPositiveButton("立即更新",{onClick=function()
            print("请选择一个应用或浏览器打开")
            intent = Intent("android.intent.action.VIEW")
            intent .setData(Uri.parse(apk_url))
            this.startActivity(Intent.createChooser(intent, "请选择一个应用或浏览器用以下载最新版 APP"))
          end})
        .setNeutralButton("复制链接",{onClick=function()
            activity.getSystemService(Context.CLIPBOARD_SERVICE).setText(apk_url)--将下载链接复制到剪切板
            print("新版 APP 下载链接,复制成功!请粘贴到浏览器下载。")
          end})
        .setNegativeButton("以后再说",nill)
        .show()
      else
        AlertDialog.Builder(this)
        .setTitle("无可用更新")
        .setMessage("您使用的是最新版本!\n当前版本:"..versionName.."("..versionCode..")\n最新版本:"..new_versionName.."("..new_versionCode..")")
        .setPositiveButton("知道啦",nil)
        .show()
      end
    else
      AlertDialog.Builder(this)
      .setTitle("更新为空")
      .setMessage("本站未发布更新")
      .setPositiveButton("退下吧",nil)
      .show()
    end
  end
end)

 

远程公告

只需要更改appid为你的appid

image.png

import "android.content.Intent"
import "android.net.Uri"
import "android.provider.Settings"
import "android.app.ProgressDialog"
import "android.app.AlertDialog"
local appid =12278
--将 10001 改成你在 https://aus.nowtime.cc/console/app_list 获取的 APPID
--获取方法[教程可能有点旧(其实我太懒),就先将就下吧] https://nowtime.cc/lua/331.html
local packinfo = this.getPackageManager().getPackageInfo(this.getPackageName(),((32552732/2/2-8183)/10000-6-231)/9)
local appinfo = this.getPackageManager().getApplicationInfo(this.getPackageName(),0)
local versionName = tostring(packinfo.versionName)-- 版本名,不要动这里(cc.nowtime)
local versionCode = tonumber(packinfo.versionCode)-- 版本号,不要动这里(10010)
--不要动这个
local check_update_url = "https://aus.nowtime.cc/api/query/post?appid="..appid.."&version_code="..versionCode
--不要动这个
if(activity.getApplicationContext().getSystemService(Context.CONNECTIVITY_SERVICE).getActiveNetworkInfo() == nil) then
  AlertDialog.Builder(this)
  .setTitle("提示")
  .setMessage("你未连接至互联网 或 当前连接的网络不可用,请检查你的网络设置")
  .setNeutralButton("确定",nil)
  .setNegativeButton("打开 数据连接",{onClick=function()
      intent = Intent(Settings.ACTION_DATA_ROAMING_SETTINGS)
      this.startActivity(intent)
    end})
  .setPositiveButton("连接 Wi-Fi",{onClick=function()
      intent = Intent(Settings.ACTION_WIFI_SETTINGS)
      this.startActivity(intent)
    end})
  .show();
  return false
  -- 就此中断,不再继续执行下面代码
end
Toast.makeText(activity, "正在努力加载公告中……",Toast.LENGTH_SHORT).show()
Http.get(check_update_url,nil,"UTF-8",nil,function(http_code,content,cookie,header)
  if (http_code == -1) then
    Toast.makeText(activity, "很抱歉,加载公告失败,请重试或检查你的网络设置",Toast.LENGTH_SHORT).show()
  else
    code = tonumber(string.match(content,'"code":(.-),'))-- 状态码
    if(code == 200) then
      post = string.gsub(string.match(content,'"post":"(.-)"'),'\\n',"\n")--公告内容
      post_time = string.match(content,'"post_time":"(.-)"')--发布公告时间
      AlertDialog.Builder(this)
      .setTitle("公告")
      .setMessage("公告发布时间:"..post_time.."\n"..post)
      .setPositiveButton("知道啦",nil)
      .show()
    else
    --出现此错误,请软件作者加QQ群反馈:773641216
      Toast.makeText(activity, "本站暂未发布公告!",Toast.LENGTH_SHORT).show()
    end
  end
end)

本站fas源文件

麻木博客微信公众号回复:fas源文件  下载源件

image.png

点我下载本站软件查看效果

 

打赏 支付宝打赏 微信打赏
  • 4
    点赞
  • 30
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 3
    评论
DenseFusion-ROS 是一种基于机器人操作系统(ROS)的稠密融合目标检测和位姿估计系统。该系统结合了深度学习和传感器融合技术,可以在复杂环境中实现高精度的目标检测和定位。 DenseFusion-ROS 的核心是一个深度学习网络,通过训练来学习将图像中的目标信息和三维模型的几何结构相结合,从而实现目标的位置估计和位姿估计。该网络具有分割、姿态估计和点云生成等子网络,可以对目标进行多层次的特征提取和识别。在运行时,DenseFusion-ROS 可以接收来自不同传感器(如RGB-D相机)的数据,并将其传递给网络进行处理。 DenseFusion-ROS 使用传感器融合技术将来自多个传感器的数据进行融合,以提高定位的准确性和鲁棒性。通过将不同传感器的信息进行集成和融合,可以减少传感器的盲区和误差,提高目标检测和位姿估计的精度。同时,在动态环境中,DenseFusion-ROS 还能对目标进行实时跟踪和重定位,以适应场景的变化和目标的运动。 DenseFusion-ROS 还提供了一些便捷的功能和接口,方便用户使用和集成到机器人系统中。例如,它可以将检测到的目标位置和位姿发布为 ROS 消息,以供其他模块进行进一步的处理和导航。此外,DenseFusion-ROS 还支持可视化显示检测结果和生成目标的三维点云,帮助用户理解和分析环境中的目标信息。 总而言之,DenseFusion-ROS 是一种高效的目标检测和位姿估计系统,结合了机器人操作系统和深度学习技术,并利用传感器融合来提高准确性和鲁棒性。它可以广泛应用于机器人导航、物体抓取和环境感知等领域,提升机器人在实际场景中的智能和交互能力。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

麻木博客

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值