【HarmonyOS开发】HCIA-HarmonyOS介绍

1. 【判断题】 8/8
根据设备的内存差异,OpenHarmony适配的系统类型分为三类:轻量系统、小型系统、标准系统。
正确(True)
 
2. 【判断题】 8/8
部件是指在部署视图中具有相对独立性,能完成一定功能的可独立交付,并且能独立部署的软件实体。
错误(False)

3. 【判断题】 8/8
原子化服务是鸿蒙系统提供的一种全新的应用形态,无需显式安装,由程序框架后台静默安装后即可使用,可为用户提供便捷服务。
正确(True)
 
4. 【判断题】 8/8
分布式软总线是手机、平板、智能穿戴、智慧屏、车机等分布式设备的通信基座,不仅为设备之间的互联互通提供了统一的分布式通信能力,还为设备之间的无感发现和零等待传输创造了条件。
正确(True)


5. 【判断题】 8/8
卡片常用于嵌入到其他应用(当前只支持系统应用)中作为其界面的一部分显示,并支持拉起页面,发送消息等基础的交互功能。
正确(True)


6. 【单选题】 15/15
OpenHarmonyOS适配的系统类型中支持的设备最小内存为1 MiB的是哪一个系统?
B. 小型系统
 
7. 【多选题】 15/15
HarmonyOS可以通过架构分层间的接口定义,对操作系统进行大颗粒系统解构。以下哪些选项是内核层向上提供的标准接口?
A. POSIX
C. CMSIS
D. HDI
 
8. 【多选题】 15/15
HarmonyOS从用户和开发者视角出发,开发出了一款面向万物互联时代的操作系统。以下哪两个选项是HarmonyOS基于这两个视角提出的设计理念?
A. 消费者体验最佳原则
C. 开发者最小代价原则

 
9. 【多选题】 15/15
在万物智联时代重要机遇期,鸿蒙系统结合移动生态发展的趋势,提出了哪三大技术理念?
A. 一次开发 多端部署
B. 可分可合 自由流转
D. 统一生态 原生智能

  • 3
    点赞
  • 16
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
好的,以下是一个支持 px 和 rpx 的 ScreenUtil 类,可以用于 Flutter 屏幕适配: ```dart import 'package:flutter/material.dart'; class ScreenUtil { static late double _screenWidth; static late double _screenHeight; static late double _pixelRatio; static late double _statusBarHeight; static late double _bottomBarHeight; static late double _textScaleFactor; static void init(BuildContext context) { MediaQueryData mediaQuery = MediaQuery.of(context); _screenWidth = mediaQuery.size.width; _screenHeight = mediaQuery.size.height; _pixelRatio = mediaQuery.devicePixelRatio; _statusBarHeight = mediaQuery.padding.top; _bottomBarHeight = mediaQuery.padding.bottom; _textScaleFactor = mediaQuery.textScaleFactor; } static double get screenWidth => _screenWidth; static double get screenHeight => _screenHeight; static double get pixelRatio => _pixelRatio; static double get statusBarHeight => _statusBarHeight; static double get bottomBarHeight => _bottomBarHeight; static double get textScaleFactor => _textScaleFactor; static double setWidth(double widthPx) => widthPx * _screenWidth / 750; static double setHeight(double heightPx) => heightPx * _screenHeight / 1334; static double setSp(double fontSizePx) => fontSizePx * _textScaleFactor; static double setBorderRadius(double radiusPx) => radiusPx * _pixelRatio; static double setRpx(double rpx) => rpx * _screenWidth / 750; } ``` 使用方法: 在 MaterialApp 的 build 方法中调用 ScreenUtil.init(context),初始化 ScreenUtil 类。 ```dart class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { ScreenUtil.init(context); return MaterialApp( title: 'Flutter Demo', theme: ThemeData( primarySwatch: Colors.blue, ), home: MyHomePage(), ); } } ``` 在布局中使用 ScreenUtil.setWidth、ScreenUtil.setHeight、ScreenUtil.setSp 和 ScreenUtil.setRpx 方法来适配宽度、高度、字体大小和 rpx。 ```dart Container( width: ScreenUtil.setWidth(100), height: ScreenUtil.setHeight(100), margin: EdgeInsets.only(top: ScreenUtil.setHeight(20)), padding: EdgeInsets.symmetric(horizontal: ScreenUtil.setWidth(20)), decoration: BoxDecoration( borderRadius: BorderRadius.circular(ScreenUtil.setBorderRadius(10)), color: Colors.grey[200], ), child: Text( 'Hello, World!', style: TextStyle(fontSize: ScreenUtil.setSp(32)), ), ), ``` 其中,setWidth 和 setHeight 方法用于适配宽度和高度,参数单位为 px;setSp 方法用于适配字体大小,参数单位为 px;setBorderRadius 方法用于适配边框半径,参数单位为 px;setRpx 方法用于适配 rpx,即屏幕宽度的 1/750,参数单位为 rpx。

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值