鸿蒙开发 如何获取versionName与versionCode?
在entry下的config.json中加入权限:"reqPermissions":[{"name":"ohos.permission.GETBUNDLEINFO"}],在java类中调用:try{BundleInfobundleInfogetBundleManager().getBundleInfo(getBundleName(),0);StringversionName"版本名:"+bundleInfo.getVersionName();StringversionCode"版本号:"+bundleInfo.getVersionCode();}catch(RemoteExceptione){e.printStackTrace();}
harmony有类似于android中switch的控件吗?
有switch控件,JAVAUI可以参考:https:developer.harmonyos.comcndocsdocumentationdocguidesuijavacomponentswitch0000001060806006JSUI可以参考:https:developer.harmonyos.comcndocsdocumentationdocreferencesjscomponentsbasicswitch0000000000611736
【求助】harmonyOS 纯ts如何实现通过跳转网页的方式打开固定链接?
如果是跳转到应用内部页面,可通过页面路由的方式,参考:https:developer.harmonyos.comcndocsdocumentationdocreferencesjsapisbasicfeaturesroutes0000000000611824,如果跳转到外部应用或者页面,目前没有组件支持
SignalInformation怎么获取LAC CID等信息
查询指定标识符的APN的详细参数,详细参数包括(name、apn、mcc、mnc、numeric、user、password、server、proxy、port、mmsport、mmsproxy、mmsc、authtype、current、Type)等DeviceNetworkManager.getApnInfo可参考文档:https:developer.huawei.comconsumercndocdevelopmentsystemReferencesdevicenetworkmanagerapi0000001053680684
TabList中的setIconElement 这个怎么使用?
可参考如下代码:publicvoidsetTabIcon(TabList.Tabtab){ResourceTable.Mediaicon为项目图片资源ID,通过resourceID获取PixelMap对象Optional<PixelMap>pixelMapOptionalcreatePixelMapByResId(ResourceTable.Mediaicon);创建PixelMapElement对象PixelMapElementbitmapDrawablenewPixelMapElement(pixelMapOptional.get());给tab设置IconElementtab.setIconElement(bitmapDrawable);}publicOptional<PixelMap>createPixelMapByR...
视频播放Player组件如何加速播放或者快进播放
快进播放可结合player组件的rewindTo来实现加速播放可结合player组件的setPlaybackSpeed来实现具体请参看文档:https:developer.harmonyos.comcndocsdocumentationdocreferencesplayer0000001054238943ZHCNTOPIC0000001054238943setPlaybackSpeedfloat
video player播放在线视频失败
我看你的播放路径是http,HarmonyOS访问网络默认支持https,在config.json文件里添加以下代码即可正常播放视频,希望对你有帮助!"deviceConfig":{"default":{"network":{"cleartextTraffic":true}}}
鸿蒙怎么接收广播有知道的吗?
鸿蒙里就是接受公共事件,参考链接:https:developer.harmonyos.comcndocsdocumentationdocguidesabilitynotificationfwkoverview0000000000029862
开启混淆后,卡片加载不出来
根据你的描述,请查看此文档:https:developer.harmonyos.comcndocsdocumentationdocguidesidejavaobfuscate0000001063740093如果仍有问题可以帖相关代码,以便定位问题
鸿蒙系统怎么打开定位开关页面
我理解您是想达到这样的预期IntentintentnewIntent();OperationoperationnewIntent.OperationBuilder().withAction(IntentConstants.ACTIONAPPLICATIONDETAILSSETTINGS).withUri(Uri.getUriFromParts("package",getBundleName(),null)).build();intent.setOperation(operation);startAbility(intent);
huawei watch 3 java开发滑动退出当前ability与横向滑动控件冲突的问题
在PageSlider的PageChangedListener的onPageChosen回调方法中当itemPos!0时,设置了setSwipeToDismiss(false),禁止ability滑动退出,itemPos0时,setSwipeToDismiss(true),方法都返回true,但是返回到第一页,滑动退出的设置没有生效,可能这个方法只有第一次设置生效?只能在onPageSliding中判断了下滑动距离,手动结束当前slice。