聊聊鸿蒙OS
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">导语</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">6月2日,HarmonyOS 2<span style="color: black;">颁布</span>,<span style="color: black;">颁布</span>会上演示了非常多HarmonyOS炫酷的功能,超级终端,万能卡片,多端协作,是不是非常心动呢。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">不仅新<span style="color: black;">颁布</span>的几款设备,<span style="color: black;">非常多</span>老的华为<span style="color: black;">亦</span>都<span style="color: black;">能够</span>升级鸿蒙系统了,<span style="color: black;">例如</span>华为的Mate 40系列,Mate30系列, P40系列,MatePad Pro平板,华为智慧屏系列等,你的华为设备有<span style="color: black;">无</span>升级鸿蒙呢。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">能够</span>去HarmonyOS官方<span style="color: black;">博客</span>中查看百机升级计划, <span style="color: black;">包含</span>老荣耀的<span style="color: black;">非常多</span>设备都会升级到鸿蒙系统。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">倘若</span><span style="color: black;">已然</span>有支持升级的华为手机,<span style="color: black;">剧烈</span><span style="color: black;">举荐</span>升级到HarmonyOS,不<span style="color: black;">必须</span>担心兼容性问题,他是100%完全兼容安卓的。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"><span style="color: black;">此刻</span>华为应用商店<span style="color: black;">已然</span>上线了“HarmonyOS”专区,大家<span style="color: black;">能够</span>去体验一下原生的鸿蒙App</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"><span style="color: black;">日前</span>还有<span style="color: black;">有些</span>应用虽然是Android app,<span style="color: black;">然则</span>支持HarmonyOS服务,这种<span style="color: black;">日前</span><span style="color: black;">重点</span>支持的是鸿蒙的原子化服务,这类型服务在图标下面有一条横线,上滑就会弹出一个服务卡片,<span style="color: black;">另一</span>从手机左下角<span style="color: black;">或</span>右下角上滑会<span style="color: black;">显现</span>服务中心,<span style="color: black;">这儿</span>面<span style="color: black;">能够</span>展示和<span style="color: black;">发掘</span>所有原子化服务。</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">当然,这篇文章不会给你介绍<span style="color: black;">哪些</span>炫酷的功能,我想稍微深入一点去<span style="color: black;">科研</span>一下,<span style="color: black;">例如</span>HarmonyOS和OpenHarmony的关系,<span style="color: black;">例如</span>HarmonyOS和安卓的关系。先来简单介绍下HarmonyOS</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"><strong style="color: blue;">|</strong></span><span style="color: black;"><strong style="color: blue;">HarmonyOS 简介</strong></span><strong style="color: blue;"><span style="color: black;">|</span></strong></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">官网:</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">https://www.harmonyos.com/</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">研发</span>者官网:</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">https://developer.harmonyos.com/</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">HarmonyOS 官方定义是一款“面向<span style="color: black;">将来</span>”、面向全场景的分布式操作系统;</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">HarmonyOS的特性<span style="color: black;">能够</span>从三个方面<span style="color: black;">表现</span>:</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;">#1</strong></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;"><span style="color: black;">操作系统层面</span></strong><span style="color: black;">,一套操作系统代码,<span style="color: black;">经过</span>组件化的设计<span style="color: black;">方法</span>设计;<span style="color: black;">能够</span><span style="color: black;">按照</span>设备特性和业务<span style="color: black;">必须</span>灵活定制剪裁;从而满足从耳机、穿戴、车机到智慧屏,手机等所有设备的需求。</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;">#2</strong></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;">用户体验层面,</strong><span style="color: black;">经过</span>超级终端,<span style="color: black;">区别</span>硬件协同、资源共享。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;">#3</strong></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;"><span style="color: black;"><span style="color: black;">研发</span>者层面</span></strong><span style="color: black;">,分布式应用框架,一次代码,多端<span style="color: black;">安排</span>;<span style="color: black;">能够</span><span style="color: black;">有效</span><span style="color: black;">研发</span>跨设备的应用</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">能够</span>看出,HarmonyOS抓住了<span style="color: black;">将来</span>万物互联的发展趋势,着重打造的是分布式的,面向<span style="color: black;">各样</span>类型设备的系统。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"><strong style="color: blue;">|</strong></span><strong style="color: blue;">OpenHarmony<span style="color: black;">|</span></strong></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">都说HarmonyOS是开源的,其实并不准确事实上,HarmonyOS和开源的鸿蒙(OpenHarmony)并不完全相同。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">■</span>OpenHarmony是开源版本的鸿蒙,一款捐给了开放原子基金会,任何个人和<span style="color: black;">公司</span>都<span style="color: black;">能够</span>参与,<span style="color: black;">此刻</span>仍然是孵化<span style="color: black;">周期</span>。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">■</span>而HarmonyOS是华为基于OpenHarmony的商用的不开源的操作系统,<span style="color: black;">日前</span>仅华为<span style="color: black;">运用</span>。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">■</span>OpenHarmony是不兼容安卓的,里面<span style="color: black;">无</span>任何安卓的东西。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">■</span>而HarmonyOS是完全兼容安卓的,<span style="color: black;">日前</span>兼容的是Android 10的版本。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"><span style="color: black;">日前</span>OpenHarmony 上面有232个开源仓库,</span><span style="color: black;">据我下载了openharmony-2.0-canary的源码,代码<span style="color: black;">体积</span>是4.8GB,third_party是2.91GB,鸿蒙本身的代码是1.89G,据网络上统计总代码量<span style="color: black;">根据</span>行数鸿蒙的代码占20%,这<span style="color: black;">已然</span>是很高的比例了(<span style="color: black;">据述</span>AOSP中谷歌代码占15%)</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">日前</span>OpenHarmony依旧<span style="color: black;">处在</span>孵化<span style="color: black;">周期</span>。在1.x的时候,OpenHarmony 还只能面向非常小的物联网设备, 而<span style="color: black;">近期</span>开源的2.0 Canary版本才<span style="color: black;">增多</span>了Linux内核,支持了全面的OS能力,支持大于128M的带屏设备的<span style="color: black;">研发</span>。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"><span style="color: black;">详细</span>的<span style="color: black;">能够</span>参考OpenHarmony2.0更新日志:zh-cn/release-notes/OpenHarmony-2-0-Canary.md · OpenHarmony/docs - Gitee.com</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">B站UP主东方星痕运行了纯净的OpenHarmony的系统,<span style="color: black;">能够</span>看到OpenHarmony还是是非常简单的。</p><img src="https://mmbiz.qpic.cn/mmbiz_png/d46WU3wyu6fKW34NibQiaNv0tlv8UmuCXTem5Rn7DBYJv0soQIIC1QEoHiaWDcsicXwPH78uMjd9YpMdf2Y0uiamdvA/640?wx_fmt=png&tp=webp&wxfrom=5&wx_lazy=1&wx_co=1" style="width: 50%; margin-bottom: 20px;">
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">分析OpenHarmony的源码工程<span style="color: black;">能够</span><span style="color: black;">发掘</span>,他<span style="color: black;">此刻</span>还只支持C/C++<span style="color: black;">研发</span>和js<span style="color: black;">研发</span>,并不支持java语言<span style="color: black;">研发</span>。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">例如</span>开源的系统三大组件(桌面<span style="color: black;">起步</span>器、设置、systemui)都是html+js+css<span style="color: black;">研发</span>的。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">源码中app_samples工程中虽然有<span style="color: black;">非常多</span>Java工程,<span style="color: black;">然则</span>都只支持在HarmonyOS中运行而<span style="color: black;">不可</span>在OpenHarmony中运行。<span style="color: black;">详细</span>参考他的Readme ,<span style="color: black;">仅有</span><span style="color: black;">少许</span>js工程能在OpenHarmony中运行(common/JsHelloWorld和common/Clock)OpenHarmony/app_samples - 码云 - 开源中国 (gitee.com)</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">对应DevEco Studio 中的`Import HarmonyOS Sample)</p><img src="https://mmbiz.qpic.cn/mmbiz_png/d46WU3wyu6fKW34NibQiaNv0tlv8UmuCXTQT3aFSMxkj2B9ibLej8GE440ef0XLN5e0osTZXKiacjBypNNq201vodA/640?wx_fmt=png&tp=webp&wxfrom=5&wx_lazy=1&wx_co=1" style="width: 50%; margin-bottom: 20px;">
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">从源码中得知,<span style="color: black;">日前</span>的OpenHarmony还<span style="color: black;">不足</span><span style="color: black;">作为</span>一个手机系统,他只是从2.0<span style="color: black;">起始</span>能够<span style="color: black;">研发</span>标准系统设备<span style="color: black;">罢了</span>。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">因此</span><span style="color: black;">倘若</span>其他手机厂商想要基于OpenHarmony进行OS的<span style="color: black;">研发</span>,这可能<span style="color: black;">必须</span>非常<span style="color: black;">海量</span>的工作。单不兼容Android这一点,其他厂商就不可能在自己的手机设备中<span style="color: black;">选取</span>OpenHarmony,<span style="color: black;">最少</span><span style="color: black;">日前</span>是不可能的。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">另一</span>,<span style="color: black;">选取</span>HarmonyOS的可能性<span style="color: black;">亦</span>不是<span style="color: black;">尤其</span>大,<span style="color: black;">由于</span>HarmanyOS并不是开源的,<span style="color: black;">因此</span>各个厂商就很难<span style="color: black;">供给</span>个性化的服务,并且严重依赖华为。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"><strong style="color: blue;">分析</strong></span><strong style="color: blue;">HarmonyOS 和Android</strong></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">鸿蒙OS的<span style="color: black;">研发</span>IDE是DevEco Studio(<span style="color: black;">一样</span>是基于Intellij IDEA Community<span style="color: black;">研发</span>,是标准的Gradle工程,支持Java和JS两种语言进行<span style="color: black;">研发</span>), 浏览一下API,做安卓的<span style="color: black;">朋友</span>应该非常容易上手,<span style="color: black;">由于</span>基本组件和UI这块的API和Android非常类似。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">下载好IDE以后,还<span style="color: black;">必须</span>登陆华为<span style="color: black;">研发</span>者账号<span style="color: black;">才可</span>正常<span style="color: black;">运用</span>。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">这儿</span><span style="color: black;">咱们</span>从IDE <span style="color: black;">供给</span>的Template中<span style="color: black;">选取</span>Shopping Ability(Java) 创建工程(仅支持HarmonyOS手机),创建好以后,要配置签名<span style="color: black;">才可</span>在真机上运行。<span style="color: black;">这儿</span><span style="color: black;">咱们</span>直接分析编译包即可。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">鸿蒙OS的安装包有两种,一种是hap,一种是app, app<span style="color: black;">能够</span><span style="color: black;">包括</span>多个hap,<span style="color: black;">然则</span>只会有一个entry hap(主应用),其他的都是feature hap。这是一种模块化的思想。后面分发的时候,用户<span style="color: black;">能够</span>先只下载主hap,等待<span style="color: black;">必须</span>用到某些功能的时候再动态下载feature hap。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">这个同Android 后面搞的 Android App Bundle类似。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">将编译后的"entry-debug-rich-unsigned.hap" 后缀名改成zip包解压得到如下结果:</p><img src="https://mmbiz.qpic.cn/mmbiz_png/d46WU3wyu6fKW34NibQiaNv0tlv8UmuCXTIiatqqmUATE4u8ra58CulsDhs02kKnUGsg81gUticdLxF5Zia2OX1sb9Q/640?wx_fmt=png&tp=webp&wxfrom=5&wx_lazy=1&wx_co=1" style="width: 50%; margin-bottom: 20px;">
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">■</span>classes.dex,<span style="color: black;">运用</span>的是android 的dex格式</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">■</span><span style="color: black;">assets下面是所有的资源, HarmonyOS<span style="color: black;">运用</span>的是自己的一套资源二进制格式</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">■</span>config.json是配置文件(类似Android的AndroidManifest.xml文件)</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">1) AndroidManifest.xml是Android app中的配置文件,用来声明app<span style="color: black;">运用</span>的版本,权限、四大组件等</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">2) classes.dex 是安卓apk中java 代码编译后的产物,类似java 的class文件(<span style="color: black;">或</span>理解成jar包<span style="color: black;">亦</span>行)</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">不外</span>比较奇怪的是他里面有一个"entry_debug_signed_entry.apk"(apk是Android 安装包格式),<span style="color: black;">一样</span>分析一下他的源码:直接解压如下:</p><img src="https://mmbiz.qpic.cn/mmbiz_png/d46WU3wyu6fKW34NibQiaNv0tlv8UmuCXTMqGSRPSiaBCvxSdUFkDqjMpibR0GsLJaZibL6s1Wno9dBEIjKnfd09LMg/640?wx_fmt=png&tp=webp&wxfrom=5&wx_lazy=1&wx_co=1" style="width: 50%; margin-bottom: 20px;">
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">确实是一个标准的apk文件。</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">分析一下他的classes.dex和AndroidManifest.xml</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">先<span style="color: black;">瞧瞧</span><span style="color: black;">名单</span>文件:</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">Application类的实现是ShellMyApplication</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">有一个Activity是MainAbilityShellActivity</p>
<img src="https://mmbiz.qpic.cn/mmbiz_png/d46WU3wyu6fKW34NibQiaNv0tlv8UmuCXTAXn7RNtpVmkyiaBefxzibkWibPYPgbUG1sEiaXngAft0Pic6jWjAWfYVuzA/640?wx_fmt=png&tp=webp&wxfrom=5&wx_lazy=1&wx_co=1" style="width: 50%; margin-bottom: 20px;">
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">当前版本是api 29(<span style="color: black;">亦</span><span style="color: black;">便是</span>Android 10)</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">运用</span>jadx-gui查看classes.dex文件:</p><img src="https://mmbiz.qpic.cn/mmbiz_png/d46WU3wyu6fKW34NibQiaNv0tlv8UmuCXTTrjvwhTmxicqHCwYAu3HNsDial5AqEibN2ibiclQI05zHiaFTqy6k8AVicUqQ/640?wx_fmt=png&tp=webp&wxfrom=5&wx_lazy=1&wx_co=1" style="width: 50%; margin-bottom: 20px;">
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">里面的内容非常简单,<span style="color: black;">仅有</span><span style="color: black;">以上</span>两个类和一个R类,并且里面的实现非常简单:</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">ShellMyApplication继承自HarmonyApplication</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">MainAbilityShellActivity继承自AbilityShellActivity</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">咱们</span><span style="color: black;">能够</span>从HarmonyOS SDK 中看到看到HarmonyApplication和AbilityShellActivity对应的反编译以后的代码。</p><img src="https://mmbiz.qpic.cn/mmbiz_png/d46WU3wyu6fKW34NibQiaNv0tlv8UmuCXTLAIn0cq6TqNUyLibRxLLGf40eyKJav8CRqp14qd8J1sIzKn0BDsluUQ/640?wx_fmt=png&tp=webp&wxfrom=5&wx_lazy=1&wx_co=1" style="width: 50%; margin-bottom: 20px;">
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">从这个abilityshell_ide_java.jar中<span style="color: black;">能够</span>看到,鸿蒙会把Android的三个组件(Activity,ContentProvider、Service)还有Application都套一层,<span style="color: black;">而后</span>转发给鸿蒙应用框架,最后由鸿蒙应用框架去执行。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">那HarmonyOS定义的一整套全新的API是怎么运行的呢?<span style="color: black;">这儿</span>简单分析一下比较感兴趣的UI界面的运<span style="color: black;">行径</span>例。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">运用</span>Android Studio的Layout Inspector查看布局,如下:</p><img src="https://mmbiz.qpic.cn/mmbiz_png/d46WU3wyu6fKW34NibQiaNv0tlv8UmuCXTEl8j03TX0ocv1fp8KiacMYia1ibS1ELLjbEfGfIOHpdpLgs13OMuWrPDQ/640?wx_fmt=png&tp=webp&wxfrom=5&wx_lazy=1&wx_co=1" style="width: 50%; margin-bottom: 20px;">
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">全部</span>核心界面只是一个AGPContainerView. <span style="color: black;">亦</span><span style="color: black;">便是</span>说HarmonyOS定义的整套UI都是绘制在一个View里面的,应该是类似Flutter的自绘制的方式。而不是类似RN那样,<span style="color: black;">每一个</span>界面元素映射到原生系统的一个View。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">日前</span>看来,HarmonyOS在手机中,不论是Android app还是鸿蒙app,都是以一个Android app的方式来运行的。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">整体的原理是<span style="color: black;">经过</span>Android框架获取到所有底层<span style="color: black;">必须</span>的信息(<span style="color: black;">亦</span><span style="color: black;">便是</span>兼容Android底层),<span style="color: black;">而后</span>转发给鸿蒙框架去运行。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">全部</span>鸿蒙App<span style="color: black;">能够</span>看成是一个插件化的Android app,区别是插件是一套完全不依赖Android 框架的模块。<span style="color: black;">亦</span><span style="color: black;">便是</span><span style="color: black;">倘若</span><span style="color: black;">咱们</span>基于HarmonyOS框架<span style="color: black;">研发</span>的app,后续是完全<span style="color: black;">能够</span>脱离Android 环境的。Android 运行时只是<span style="color: black;">日前</span>鸿蒙app运行的宿主。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">因此</span>,我个人理解,其实在手机系统中,是Android app兼容鸿蒙app而不是鸿蒙app兼容Android app。<span style="color: black;">咱们</span><span style="color: black;">乃至</span><span style="color: black;">能够</span>直接把一个鸿蒙app导出为一个apk,<span style="color: black;">然则</span>这个apk在其他手机上是运行失败的,<span style="color: black;">由于</span><span style="color: black;">无</span>鸿蒙运行库。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">因此</span>,HarmonyOS 在手机上的<span style="color: black;">方法</span>是基于OpenHarmony(<span style="color: black;">亦</span>不是<span style="color: black;">此刻</span>开源的这个版本)再融合AOSP(Android 10版本)中的大部分组件加上华为的一系列服务的系统。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">大众</span>其实<span style="color: black;">能够</span>去设置->关于手机->法律信息里面查看开放源代码许可,里面有非常多的Android 开源。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">不外</span>华为<span style="color: black;">这般</span>做<span style="color: black;">亦</span>是<span style="color: black;">日前</span>最好的<span style="color: black;">方法</span>了。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">首要</span>有一套完全的应用框架和API出来,<span style="color: black;">大众</span>基于这套框架进行鸿蒙<span style="color: black;">研发</span>是完全不依赖Android api的,等到原生的鸿蒙应用越来越多,<span style="color: black;">这般</span>,后续就<span style="color: black;">能够</span>慢慢替换掉Android的部分。(<span style="color: black;">不外</span>这种的兼容<span style="color: black;">方法</span>,各个app厂商有多大的动力去<span style="color: black;">研发</span>鸿蒙原生app呢,毕竟鸿蒙原生app他<span style="color: black;">亦</span>不支持安卓呀。)</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">此刻</span>Java的这套API<span style="color: black;">日前</span>还不支持OpenHarmony,<span style="color: black;">因此</span>OpenHarmony后面肯定还会开源3.0来支持这套API的,<span style="color: black;">能够</span>耐心等待,多给鸿蒙<span style="color: black;">有些</span>时间。其实<span style="color: black;">不必</span>讨论HarmonyOS是不是安卓套壳, 路要一步步走,操作系统是一个非常大的工程<span style="color: black;">况且</span>牵涉甚广, OpenHarmony还在孵化器, 只要基于OpenHarmony上下游的合作伙伴越来越多,HarmonyOS<span style="color: black;">将来</span>就会完全替换掉Android<span style="color: black;">乃至</span>手机系统<span style="color: black;">亦</span>替换掉Linux,这个<span style="color: black;">亦</span>是HarmonyOS<span style="color: black;">必定</span>会去做的。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;">参考<span style="color: black;">文案</span></strong></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">OpenHarmony 2.0和HarmonyOS<span style="color: black;">颁布</span>会快评</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">鸿蒙OS到底是不是Android套皮?(少bb,看源码!)</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">鸿蒙Harmony谈了这么久,和Android到底啥区别?</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">鸿蒙对标的是安卓吗?No</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">怎样</span>给女<span style="color: black;">伴侣</span>解释什么是鸿蒙?</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">鸿蒙版APP已上线,比安卓小太多了!</p>
<img src="data:image/svg+xml,%3C%3Fxml version=1.0 encoding=UTF-8%3F%3E%3Csvg width=1px height=1px viewBox=0 0 1 1 version=1.1 xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink%3E%3Ctitle%3E%3C/title%3E%3Cg stroke=none stroke-width=1 fill=none fill-rule=evenodd fill-opacity=0%3E%3Cg transform=translate(-249.000000, -126.000000) fill=%23FFFFFF%3E%3Crect x=249 y=126 width=1 height=1%3E%3C/rect%3E%3C/g%3E%3C/g%3E%3C/svg%3E" style="width: 50%; margin-bottom: 20px;">
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">作者简介</p><img src="data:image/svg+xml,%3C%3Fxml version=1.0 encoding=UTF-8%3F%3E%3Csvg width=1px height=1px viewBox=0 0 1 1 version=1.1 xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink%3E%3Ctitle%3E%3C/title%3E%3Cg stroke=none stroke-width=1 fill=none fill-rule=evenodd fill-opacity=0%3E%3Cg transform=translate(-249.000000, -126.000000) fill=%23FFFFFF%3E%3Crect x=249 y=126 width=1 height=1%3E%3C/rect%3E%3C/g%3E%3C/g%3E%3C/svg%3E" style="width: 50%; margin-bottom: 20px;">
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;"><span style="color: black;">leoraylei(雷声伟)</span></strong></p><img src="data:image/svg+xml,%3C%3Fxml version=1.0 encoding=UTF-8%3F%3E%3Csvg width=1px height=1px viewBox=0 0 1 1 version=1.1 xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink%3E%3Ctitle%3E%3C/title%3E%3Cg stroke=none stroke-width=1 fill=none fill-rule=evenodd fill-opacity=0%3E%3Cg transform=translate(-249.000000, -126.000000) fill=%23FFFFFF%3E%3Crect x=249 y=126 width=1 height=1%3E%3C/rect%3E%3C/g%3E%3C/g%3E%3C/svg%3E" style="width: 50%; margin-bottom: 20px;">
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">基本</span>科技<span style="color: black;">制品</span>部/终端<span style="color: black;">研发</span>室</p>
哈哈、笑死我了、太搞笑了吧等。 我深感你的理解与共鸣,愿对话长流。 你的留言真是温暖如春,让我感受到了无尽的支持与鼓励。 论坛的成功是建立在我们诚恳、务实、高效、创新和团结合作基础上,我们要把这种精神传递下去。 外链发布论坛学习网络优化SEO。 软文发布平台 http://www.fok120.com/ 你的见解真是独到,让我受益匪浅。
页:
[1]