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

网站建设公司对父亲节宣传口号苏州高端网站建设公司

网站建设公司对父亲节宣传口号,苏州高端网站建设公司,怎么自己创建网站免费,计算机软件开发专业1、HamonyOS 样机获取成功返回Oaid为00000000-0000-0000-0000-000000000000? 请求授权时需要触发动态授权弹窗,看一下是不是没有触发授权弹窗。 可以参考以下代码以及文档: // ets import identifier from ohos.identifier.oaid; import hilog from oh…

1、HamonyOS 样机获取成功返回Oaid为00000000-0000-0000-0000-000000000000?

请求授权时需要触发动态授权弹窗,看一下是不是没有触发授权弹窗。
可以参考以下代码以及文档:

// ets
import identifier from '@ohos.identifier.oaid';
import hilog from '@ohos.hilog';
import { BusinessError } from '@ohos.base';
import abilityAccessCtrl from '@ohos.abilityAccessCtrl';
import common from '@ohos.app.ability.common';@Entry
@Component
struct deviceDemo001 {build() {Column() {Text('测试').width('100%').backgroundColor('#131313').height(50).fontColor(Color.White).onClick(()=>{const atManager: abilityAccessCtrl.AtManager = abilityAccessCtrl.createAtManager();try {let context = getContext(this) as common.UIAbilityContext;atManager.requestPermissionsFromUser(context, ["ohos.permission.APP_TRACKING_CONSENT"]).then((data) => {if (data.authResults[0] == 0) {identifier.getOAID((err: BusinessError, data: string) => {if (err.code) {hilog.error(0x0000, 'testTag', '%{public}s', `get oaid failed, error: ${err.code} ${err.message}`);} else {const oaid: string = data;}});} else {}}).catch((err: BusinessError) => {})} catch(err) {}})}}
}

参考文档:https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/oaid-service-V5

开放匿名设备标识符(Open Anonymous Device Identifier, OAID,以下简称OAID):是一种非永久性设备标识符,基于开放匿名设备标识符,可在保护用户个人数据隐私安全的前提下,向用户提供个性化广告,同时三方监测平台也可以向广告主提供转化归因分析。

媒体App、广告平台、三方监测平台等开发者,可获取设备上的OAID,您可基于OAID进行个性化广告推荐或广告转化归因分析。

OAID是基于华为自有算法生成的32位类UUID(Universally Unique Identifier)标识符,格式为xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx。
OAID的特性:

  • OAID是设备级标识符,同一台设备上不同的App获取到的OAID值一样。
  • OAID的获取受应用的“跨应用关联访问权限”开关影响:当应用的“跨应用关联访问权限”开关开启时,该应用可获取到非全0的有效OAID;当应用的“跨应用关联访问权限”开关关闭时,该应用仅能获取到全0的OAID。
  • 同一台设备上首个应用开启应用“跨应用关联访问权限”开关时,会首次生成OAID。

2、HarmonyOS 如何实现通过NFC实现手机给卡充值的功能?

需要的能力是使用NFC适配器建立连接,发送数据和接收数据,对应的业务场景就是使用NFC天线对公交进行充值,NFC读写CPU卡的部分,ISO-14443-4协议规范

标准NFC-Tag tag.TagInfo demo:

import tag from '@ohos.nfc.tag';
import UIAbility from '@ohos.app.ability.UIAbility';
import AbilityConstant from '@ohos.app.ability.AbilityConstant';
import Want from '@ohos.app.ability.Want'export default class EntryAbility extends UIAbility {onCreate(want : Want, launchParam: AbilityConstant.LaunchParam) {// add other code here...// want is initialized by nfc service, contains tag info for this found taglet tagInfo : tag.TagInfo | null = null;try {tagInfo = tag.getTagInfo(want);} catch (error) {console.error("tag.getTagInfo catched error: " + error);}if (tagInfo == null || tagInfo == undefined) {console.log("no TagInfo to be created, ignore it.");return;}// get the supported technologies for this found tag.let isNfcATag = false;let isIsoDepTag = false;for (let i = 0; i < tagInfo.technology.length; i++) {if (tagInfo.technology[i] == tag.NFC_A) {isNfcATag = true;}if (tagInfo.technology[i] == tag.ISO_DEP) {isIsoDepTag = true;}// also check for technology: tag.NFC_B/NFC_F/NFC_V/NDEF/MIFARE_CLASSIC/MIFARE_ULTRALIGHT/NDEF_FORMATABLE}// use NfcA APIs to access the found tag.if (isNfcATag) {let nfcA : tag.NfcATag | null = null;try {nfcA = tag.getNfcATag(tagInfo);} catch (error) {console.error("tag.getNfcATag catched error: " + error);}// other code to read or write this found tag.}// use getIsoDep APIs to access the found tag.if (isIsoDepTag) {let isoDep : tag.IsoDepTag | null = null;try {isoDep = tag.getIsoDep(tagInfo);} catch (error) {console.error("tag.getIsoDep catched error: " + error);}// other code to read or write this found tag.}// use the same code to handle for "NfcA/NfcB/NfcF/NfcV/Ndef/MifareClassic/MifareUL/NdefFormatable".}
}

3、HarmonyOS css 部分语法会被标红报错?

文件是web应用打包之后的css文件

因为目前IDE本身仅支持最基本的那部分CSS语法,所以在项目打开会看见报错标红,经过测试虽然会报错,但是不影响app的正常使用。

目前css支持的语法可以参考:https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/js-framework-syntax-css-V5

4、如何将pc系统剪切板里的内容粘贴到模拟器?

  1. 总体思路通过在模拟器中访问PC端web页面的方式,来实现文本的复制粘贴。
  2. PC端开启web服务器
    1. 如果有现成的web服务器,把需要复制的文本文件放到web服务器下即可。
    2. macOS自带apache服务器(推荐)
      1. 启用服务:mac命令行执行sudo apachectl start服务启动后,使用PC浏览器访问http://127.0.0.1,能访问页面看到"It works!",说明服务启动成功。
      2. 修改需要复制的文本apache服务的文件根目录位于/Library/WebServer/Documents新建test.html文件,内容为需要复制的文本,拷贝到/Library/WebServer/Documents即可,PC端访问地址http://127.0.0.1/test
    3. windows可下载、运行nginx应用
      1. nginx文件根目录位于nginx/html,默认首页为index.html,修改文本内容即可

5、HarmonyOS 关于ArkTS及so热更新问题的咨询?

在Android中很多应用会有热更的需求,一般有两种方案:
一种是差分法,可以更新java代码和so代码以及一些资源文件;
另一种是通过hook的方式运行时加载包外的so。想询问一下HarmonyOS下是否有类似的机制,特别是是否允许从包外加载so
主要是为了解决已经上架的包有部分bug不容易简单修复,需要修改arkts或者C/C++代码, 但又不希望整包更换的情景

基于HarmonyOS应用统一分发的生态规则,不提供补丁的快速热修复功能,上述相关诉求,通过高效的上架审核和应用版本更新机制进行保障。

http://www.yayakq.cn/news/211253/

相关文章:

  • 局域网建设直播网站汉服网站建设毕业设计
  • 图书网站开发背景wordpress抓取别人网站
  • 湖南seo网站开发常州外贸人才网
  • 网站流程外贸营销模板
  • 芜湖做网站多少钱龙岩正规全网品牌营销招商
  • 开发中英文切换网站如何做网站后台管理系统是用什么做的
  • 无锡品牌网站建设介绍福州网站建设招商
  • centos7删除wordpress深圳做网站可用乐云seo十年
  • 网站设计建设公司服务商wps哪个工具做网站
  • jsp淘宝客网站怀化汽车网站
  • 视频网站视频预览怎么做iis 建网站手机访问
  • 广州第一网站做100个网站
  • 做网站用python好还是PHP好现在有哪些免费推广平台
  • 万能本地视频播放器阿里云网站建设优化
  • 有关网站建设的参考书四川省住房城乡建设厅网站
  • 徐州市政建设集团公司网站营销网址
  • 七米网站建设推广优化西安建设工程信息网怎么看
  • 网站推广公司兴田德润在哪儿wordpress简体中文版下载地址
  • 校庆专题网站建设方案wordpress如何在地址栏中加网站logo
  • 公司做网站最好做微信大转盘有哪些网站
  • 延吉哪家网站建设公司好商丘网站开发
  • 沃航科技网站开发黑龙江俄语网站制作
  • 为什么建手机网站短网址生成免费
  • 做外贸网站应该关注哪些地方空间设计工作室网站
  • 二手书网站建设目标网站规划设计是什么样的
  • 公司做网站算什么费用深圳网站设计兴田德润信任高
  • 泰安的网站建设公司手机网站建设注册塔山双喜
  • 金融服务网站建设模块网站和定制网站区别
  • 幼儿网站源代码如何压缩网站
  • 爱用建站建筑设计方案网站