Sarah Hoffman
13 posts
ArkUI-X平台差异化
跨平台使用场景是一套ArkTS代码运行在多个终端设备上,如Android、iOS、OpenHarmony(含基于OpenHarmony发行的商业版,如HarmonyOS Next)。当不同平台业务逻辑不同,或使用了不支持跨平台的API,就需要根据平台不同进行一定代码差异化适配。当前仅支持在代码运行态进行差异化,接下来详细介绍场景及如何差异化适配。 使用场景 平台差异化适用于以下两种典型场景: 1.自身业务逻辑不同平台本来就有差异; 2.在OpenHarmony上调用了不支持跨平台的API,这就需要在OpenHarmony上仍然调用对应API,其他平台通过Bridge桥接机制进行差异化处理; 判断平台类型 可以通过let osName: string = deviceInfo.osFullName;获取对应OS名字,该接口已支持跨平台,不同平台上其返回值如下: OpenHarmony上,osName等于OpenHarmony-XXX Android上,osName等于Android XXX iOS上,osName等于iOS XXX 示例如下:…
A ilusão da escolha: como a interface guia decisões 🧠🎯
Psicologia das decisões, arquitetura da informação e dark patterns. Quando você clica em um botão, desliza um controle…
Go Concurrency: A Deep Dive to Expertise
Leapcell: The Next-Gen Serverless Platform for Golang app Hosting Analysis of goroutine Concurrency Control Methods in Go Language…
[Aug] ML Community — Highlights and Achievements
[Aug] ML Community — Highlights and Achievements Let’s explore highlights and accomplishments of the vast Google Machine Learning communities over…
Understanding Asynchronous JavaScript: Callbacks, Promises, and Async/Await
Hello and welcome to the first post of the JavaScript: From Novice to Expert Series ! My goal…
Why I think Python is a Great first Language
Introduction Learning how to code is a great venture. You end up learning a lot of things along…
Getting data from GTM teams- a guide for product managers
This article offers practical advice on what data you should gather from your Go-to-market teams, like sales and…
How I created AI-powered ORM for PostgreSQL, MySQL and SQLite and why you shouldn’t use it
tl;dr I created AI-powered ORM for Node with TypeScript or JavaScript called ormgpt. It works, it’s silly and…
How to Design a Logo [Step-by-Step Guide]
A great logo is instantly recognizable, memorable, and closely connected to your brand’s core values and ideas. Think…
Social Commerce: What It Is & How to Use It in 2023
Recently, I set an iPhone time limit on my social media use to “45 minutes.” I figured 45…