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

400套商业网站的静态模板巩义做网站哪家好

400套商业网站的静态模板,巩义做网站哪家好,做网站优化价格,钟点工最近搞了个uni小项目#xff0c;一个定制的小平板#xff0c;带一个nfc设备#xff0c;厂家只给了一套安卓原生demo#xff0c;头一次玩原生安卓#xff0c;废了好半天劲打出来arr包#xff0c;想镶进uniapp里#xff0c;网上查了好久#xff0c;都是错的#xff0c;要…最近搞了个uni小项目一个定制的小平板带一个nfc设备厂家只给了一套安卓原生demo头一次玩原生安卓废了好半天劲打出来arr包想镶进uniapp里网上查了好久都是错的要么无法运行要么运行了没反应要么编译都过不去。。。官网给的示例更是没有示例主打一个用法全靠猜。。。 服务 厂家给了个NfcService 里面是继承自标准android.app.Service另一部分是个androidx.appcompat.app.AppCompatActivity页面里面启动调用的NfcService java部分NfcService核心代码 private val connection object : ServiceConnection {override fun onServiceConnected(p0: ComponentName?, p1: IBinder?) {Log.e(TAG, onServiceConnected: )nfcBinder p1 as NfcService.MyBindernfcBinder?.openPort(model)}override fun onServiceDisconnected(p0: ComponentName?) {Log.e(TAG, onServiceDisconnected: )nfcBinder null} }override fun onCreate(savedInstanceState: Bundle?) {//无关代码太多就不粘了//绑定服务bindService(Intent(this, NfcService::class.java), connection, Context.BIND_AUTO_CREATE)//一定条件后解绑服务unbindService(connection) }从没接触过安卓原生一下子就麻了不知道在uni那边怎么用找了半天找到了这个 uniapp的一个页面 //开启服务无回值启动二选一 startAppService(){const mainActivity plus.android.runtimeMainActivity();const Context plus.android.importClass(android.content.Context);const Intent plus.android.importClass(android.content.Intent);const intent new Intent();intent.setClassName(mainActivity, com.rt.lib_nfc.NfcService);const Bundle plus.android.importClass(android.os.Bundle);var bundle new Bundle();intent.putExtras(bundle);mainActivity.startForegroundService(intent) }, //绑定服务有回值启动二选一 bindAppService(){const that this;const main plus.android.runtimeMainActivity();const Context plus.android.importClass(android.content.Context);const Service plus.android.importClass(android.app.Service);const Intent plus.android.importClass(android.content.Intent);let serviceConnectionFunc {onServiceConnected: function(name, service) {console.log(服务已连接, name, service);//service.openPort(READ);that.nfcService service;},onServiceDisconnected: function(name) {console.log(服务已断开, name);that.nfcService null;}};let serviceConnection plus.android.implements(android.content.ServiceConnection, serviceConnectionFunc);const intent new Intent();intent.setClassName(main, com.rt.lib_nfc.NfcService);main.bindService(intent, serviceConnection, Service.BIND_AUTO_CREATE); }, //最终使用 testService(){let res this.nfcService?.openPort(get);console.log(res -, res); }安装到uniapp里 在uniapp根目录新建nativeplugins-lib_nfc_plugin-android文件夹在里面放入arr文件 在lib_nfc_plugin文件夹下创建package.json文件ps记得删除注释 {name: 定制设备Android-NFC读卡,//显示名id: lib_nfc_plugin,//与文件夹名字保持一致version: 0.0.2,description: uni-app android原生插件 用来使用nfc读取m1卡,//描述_dp_type: nativeplugin,_dp_nativeplugin: {android: {plugins: [{type: module,name: lib_nfc_plugin,//与文件夹名字保持一致class: com.rt.lib_nfc}],hooksClass: ,integrateType: aar,//这个别改dependencies: [],compileOptions: {sourceCompatibility: 1.8,targetCompatibility: 1.8},abis: [armeabi-v7a,arm64-v8a,x86],minSdkVersion: 21,useAndroidX: false,permissions: [android.permission.FOREGROUND_SERVICE//权限],parameters: {插件需要配置的参数名称, 如appid: {des: 参数描述,key: AndroidManifest.xml中添加meta-data节点对应android:name属性值, 如GETUI_APPID,placeholder: build.gradle中添加到manifestPlaceholders中的字段名}}}} }打开项目根目录manifest.json文件后点击安卓/ios用原生插件配置-选择本地插件勾选上点确定 制作自定义调试基座 因为咱加了自定义插件需要将其打入基座内部点击你的项目名-运行-运行到手机或模拟器-制作自定义调试基座 等有一阵后点击你的项目名-运行-运行到手机或模拟器-运行到Android App基座-使用自定义基座运行再选择调试的机器 点击按钮调用startAppService或bindAppService即可启动服务
http://www.hkea.cn/news/14561887/

相关文章:

  • html5餐饮美食订餐微官网wap手机网站模板整站下载模板做的网站不好优化
  • 如何免费搭建自己的网站阿里网站建设
  • 怎么制作网站域名网站备案需要什么东西
  • 做网站每年需要多少维护费Sql 发wordpress
  • 链家二手房官网关键字排名优化公司
  • 如何推广自己的个人网站呢装修案例实景图
  • 中国农业工程建设协会网站图片设计用什么软件
  • 做本地化的返利网站怎么样泰州网站制作网站
  • 做网站要买什么空间php网站开发第三章
  • 网站建设公司有哪些方面如何发布网站教程
  • 清爽网站模板网站上传 文件夹结构
  • 网站设计欣赏国外网站名称创意大全
  • 烟台开发区网站免费做app的网站哪个好
  • 湖南畅想网站建设网站建设分销协议
  • 河南省建设厅信息网站2016网站谷歌权重
  • 莲湖微网站建设双鸭山网络推广
  • 服装网站建设需求分析域名抢注网站
  • 斯塔德迈尔球衣烟台seo外包
  • 建设网站改版可以用自己的电脑做网站吗
  • 多个端口网站如何做域名重定向dw简单的网页制作
  • ar做网站店铺设计费用怎么收费
  • 保定做网站设计做网站的为什么那么多骗子
  • 西宁网站设计制作加强政务门户网站建设
  • 网站后台管理系统素材怎样用自己的服务器做网站
  • 网站管理员怎样管理员权限wordpress邮件样式
  • 国内外设计网站佛山新网站建设渠道
  • 内蒙古网站建设云聚电子简历表格手机版
  • 桥东企业做网站俄罗斯国际空间站
  • 建设部网站官网 下载规范哪些网站可以用gif做头像
  • 国外虚拟主机wordpress杭州seo建站