<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:googleplay="http://www.google.com/schemas/play-podcasts/1.0"><channel><title><![CDATA[Harmony Developers: Development]]></title><description><![CDATA[Articles and tips for developers working on Harmony OS, OpenHarmony or Oniro.]]></description><link>https://www.harmony-developers.com/s/development</link><image><url>https://substackcdn.com/image/fetch/$s_!levV!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F962ee86e-9877-46f5-856a-d609206a53e9_608x608.png</url><title>Harmony Developers: Development</title><link>https://www.harmony-developers.com/s/development</link></image><generator>Substack</generator><lastBuildDate>Fri, 01 May 2026 02:34:54 GMT</lastBuildDate><atom:link href="https://www.harmony-developers.com/feed" rel="self" type="application/rss+xml"/><copyright><![CDATA[Harmony OS Developers]]></copyright><language><![CDATA[en]]></language><webMaster><![CDATA[hosdevs@substack.com]]></webMaster><itunes:owner><itunes:email><![CDATA[hosdevs@substack.com]]></itunes:email><itunes:name><![CDATA[Harmony OS Developers]]></itunes:name></itunes:owner><itunes:author><![CDATA[Harmony OS Developers]]></itunes:author><googleplay:owner><![CDATA[hosdevs@substack.com]]></googleplay:owner><googleplay:email><![CDATA[hosdevs@substack.com]]></googleplay:email><googleplay:author><![CDATA[Harmony OS Developers]]></googleplay:author><itunes:block><![CDATA[Yes]]></itunes:block><item><title><![CDATA[Building a Note App With ArkUI and ArkTS on HarmonyOS]]></title><description><![CDATA[In this article, we&#8217;ll walk through the creation of a simple Note App using ArkUI and ArkTS on HarmonyOS.]]></description><link>https://www.harmony-developers.com/p/building-a-note-app-with-arkui-and</link><guid isPermaLink="false">https://www.harmony-developers.com/p/building-a-note-app-with-arkui-and</guid><dc:creator><![CDATA[Harmony OS Developers]]></dc:creator><pubDate>Mon, 12 May 2025 19:00:18 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!b-Ij!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F23979a42-20d2-41c6-9ced-5b3c7133a820_875x657.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!b-Ij!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F23979a42-20d2-41c6-9ced-5b3c7133a820_875x657.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!b-Ij!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F23979a42-20d2-41c6-9ced-5b3c7133a820_875x657.jpeg 424w, https://substackcdn.com/image/fetch/$s_!b-Ij!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F23979a42-20d2-41c6-9ced-5b3c7133a820_875x657.jpeg 848w, https://substackcdn.com/image/fetch/$s_!b-Ij!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F23979a42-20d2-41c6-9ced-5b3c7133a820_875x657.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!b-Ij!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F23979a42-20d2-41c6-9ced-5b3c7133a820_875x657.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!b-Ij!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F23979a42-20d2-41c6-9ced-5b3c7133a820_875x657.jpeg" width="875" height="657" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/23979a42-20d2-41c6-9ced-5b3c7133a820_875x657.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:657,&quot;width&quot;:875,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!b-Ij!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F23979a42-20d2-41c6-9ced-5b3c7133a820_875x657.jpeg 424w, https://substackcdn.com/image/fetch/$s_!b-Ij!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F23979a42-20d2-41c6-9ced-5b3c7133a820_875x657.jpeg 848w, https://substackcdn.com/image/fetch/$s_!b-Ij!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F23979a42-20d2-41c6-9ced-5b3c7133a820_875x657.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!b-Ij!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F23979a42-20d2-41c6-9ced-5b3c7133a820_875x657.jpeg 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Photo by <a href="https://unsplash.com/@aaronburden?utm_source=medium&amp;utm_medium=referral">Aaron Burden</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure></div><h1><strong>Introduction</strong></h1><p>In this article, we&#8217;ll walk through the creation of a simple Note App using <strong>ArkUI</strong> and <strong>ArkTS</strong> on <strong>HarmonyOS</strong>. We&#8217;ll demonstrate how ArkUI&#8217;s modern UI capabilities integrate seamlessly with a relational database for efficient data management. By the end of this guide, you&#8217;ll have a foundational understanding of how to develop a functional app that allows users to add, update, delete, and view notes in a local database.</p><h1><strong>Understanding HarmonyOS and its Development Tools</strong></h1><p>HarmonyOS, developed by Huawei, is designed to provide a seamless experience across a wide range of devices, from smartphones to wearables and smart home products. For developers, HarmonyOS offers a robust set of tools and APIs optimized for creating apps within this ecosystem.</p><p>Key tools for HarmonyOS app development include:</p><ul><li><p><strong>ArkUI</strong>: A UI framework for building modern, dynamic user interfaces that allow for easy navigation and interaction.</p></li><li><p><strong>ArkTS</strong>: A TypeScript-based programming language specifically tailored for HarmonyOS, providing syntax to work with ArkUI and integrate seamlessly with the system&#8217;s APIs.</p></li></ul><p>In this tutorial, we&#8217;ll focus on using <strong>ArkUI</strong> and <strong>ArkTS</strong> to build our Note App, creating a responsive and smooth experience for users on HarmonyOS.</p><h1><strong>What You Need to Get Started with HarmonyOS App Development</strong></h1><p>To start developing apps for HarmonyOS, you will need the HarmonyOS SDK and DevEco Studio, which is the recommended IDE. DevEco Studio simplifies the app creation process, from building and debugging to testing.</p><p>The SDK provides tools in the following key areas:</p><ul><li><p><strong>Application Framework</strong>: Includes ArkUI for UI development and Ability Kit for program services.</p></li><li><p><strong>System Services</strong>: Key management and networking libraries.</p></li><li><p><strong>Media Services</strong>: Tools for managing audio and media files.</p></li><li><p><strong>Graphics Services</strong>: ArkGraphics for 2D graphics and acceleration.</p></li><li><p><strong>Application Services</strong>: Libraries for game and location services.</p></li><li><p><strong>AI Capabilities</strong>: AI tools like the HiAI Foundation Kit.</p></li></ul><p>These tools allow developers to create powerful, cross-platform apps that provide a consistent experience across HarmonyOS devices.</p><h1><strong>App Overview</strong></h1><p>Now that we&#8217;ve covered the basics of HarmonyOS development, let&#8217;s dive into building our Note App using ArkUI and ArkTS. This Note App provides an intuitive, minimalist user interface with a tabbed layout. Users can easily navigate through different sections to add, view, update, and delete notes.</p><p>The app&#8217;s core features are organized under various tabs, offering a streamlined and straightforward experience. Users can quickly manage their notes, making the app ideal for everyday use.</p><p><strong>Note</strong>: To build this app, you should use SDK 5.0.0 (12) as the framework and DevEco Studio NEXT Developer Beta1 as the development environment.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!PByG!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1faad8e7-2585-4445-8d8c-bd16e91d0731_795x713.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!PByG!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1faad8e7-2585-4445-8d8c-bd16e91d0731_795x713.png 424w, https://substackcdn.com/image/fetch/$s_!PByG!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1faad8e7-2585-4445-8d8c-bd16e91d0731_795x713.png 848w, https://substackcdn.com/image/fetch/$s_!PByG!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1faad8e7-2585-4445-8d8c-bd16e91d0731_795x713.png 1272w, https://substackcdn.com/image/fetch/$s_!PByG!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1faad8e7-2585-4445-8d8c-bd16e91d0731_795x713.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!PByG!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1faad8e7-2585-4445-8d8c-bd16e91d0731_795x713.png" width="795" height="713" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1faad8e7-2585-4445-8d8c-bd16e91d0731_795x713.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:713,&quot;width&quot;:795,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!PByG!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1faad8e7-2585-4445-8d8c-bd16e91d0731_795x713.png 424w, https://substackcdn.com/image/fetch/$s_!PByG!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1faad8e7-2585-4445-8d8c-bd16e91d0731_795x713.png 848w, https://substackcdn.com/image/fetch/$s_!PByG!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1faad8e7-2585-4445-8d8c-bd16e91d0731_795x713.png 1272w, https://substackcdn.com/image/fetch/$s_!PByG!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1faad8e7-2585-4445-8d8c-bd16e91d0731_795x713.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">App Overview</figcaption></figure></div><h1><strong>Preparing Database Operations</strong></h1><p>Before diving into the UI, let&#8217;s set up the database operations that our Note app will rely on for data management. In this section, we&#8217;ll create functions to create, insert, update, delete, and retrieve notes from a local database.</p><h2><strong>Step 1: Create the Database</strong></h2><p>Start by creating a new file named <strong>DBUtils</strong> to encapsulate all database operations. We&#8217;ll use ArkData relational database (RDB) APIs in DBUtils.</p><p>In <strong>DBUtils</strong>, we&#8217;ll define functions for each key operation in our Note app.</p><p>The<strong> createDb() </strong>function defines the database configuration (<code>STORE_CONFIG</code>) and creates a table named <code>NOTE_TABLE</code> if it doesn&#8217;t already exist. This ensures our database is ready for subsequent operations.</p><h2><strong>Step 2: Insert a New Note</strong></h2><p>The <strong>insertNote()</strong> function inserts a new note into the <code>NOTE_TABLE</code> by creating a <code>noteData</code> object, where <strong>"NOTE"</strong> is the column name, and its value is the note content.</p><h2><strong>Step 3: Update an Existing Note</strong></h2><p>The <strong>updateNote()</strong> function updates an existing note in the <code>NOTE_TABLE</code>. It creates an <code>updatedNoteData</code> object with the new content and applies a condition to match the old content.</p><h2><strong>Step 4: Delete a Note</strong></h2><p>The <strong>deleteNote()</strong> function deletes a note from the <code>NOTE_TABLE</code>. It creates a delete condition based on the note content and executes the delete operation.</p><h2><strong>Step 5: Get All Notes</strong></h2><p>The <strong>getAllNotes()</strong> function retrieves all notes from the <code>NOTE_TABLE</code>. It queries the database and extracts the note content into a list of notes, which is then returned.</p><h1><strong>Integrating Database Operations in UI Component</strong></h1><p>Now that our database is set up, we can focus on the UI component, where users will interact with the app, view their notes, and manage them through a tabbed interface.</p><h2><strong>Step 1: Initial Setup in Index.ets</strong></h2><p>In the <strong>Index.ets</strong> file, we initialize core UI elements, tabs, and set up initial states.</p><p><strong>State Variables</strong>:</p><ul><li><p><strong>currentIndex</strong>: Keeps track of the current tab.</p></li><li><p><strong>notes</strong>: Stores the list of notes fetched from the database.</p></li><li><p><strong>content</strong>, <strong>buttonText</strong>, <strong>oldNote</strong>: Used for managing note input, button labels, and previous note content for updates.</p></li></ul><h2><strong>Step 2: Initializing the Database</strong></h2><p>The <strong>aboutToAppear()</strong> method initializes the database when the component first loads. This lifecycle method ensures that the database setup happens just before the app appears on the screen.</p><h2><strong>Step 3: Loading Notes with loadNotes</strong></h2><p>The <strong>loadNotes()</strong> function uses the <strong>getAllNotes()</strong> method from <strong>DBUtils</strong> to fetch all notes from the database. It then updates the <code>notes</code> state with the list of notes.</p><h2><strong>Step 4: Handling Tabs with </strong><code>changeTab</code></h2><p>The <code>changeTab</code> function is responsible for switching between different tabs (e.g., &#8220;Add Note&#8221; and &#8220;My Notes&#8221;).</p><h2><strong>Step 5: Building the Tab Bar with tabBarBuilder</strong></h2><p>The <strong>tabBarBuilder()</strong> function creates a tab bar with icons and titles for each tab. It allows users to navigate between tabs and highlights the active tab.</p><h2><strong>Step 6: Saving or Updating Notes with saveOrUpdateNote</strong></h2><p>The <strong>saveOrUpdateNote()</strong> function checks whether to save a new note or update an existing one based on the input and button state (&#8220;Save&#8221; or &#8220;Update&#8221;).</p><p>The function:</p><ul><li><p>Ensures the content isn&#8217;t empty.</p></li><li><p>In the update flow, calls <strong>updateNote()</strong> to modify the note in the database and refresh the list.</p></li><li><p>In the save flow, calls <strong>insertNote()</strong> to add the note to the database.</p></li><li><p>Calls <strong>resetNoteState()</strong> to clear input fields after saving or updating.</p></li></ul><p>Now that all steps have been covered, we hope this guide has provided a clear and complete path to building your own Note App on HarmonyOS.</p><h1><strong>Conclusion</strong></h1><p>This Note App demonstrates how to build a functional, user-friendly app using <strong>ArkUI</strong> and <strong>ArkTS</strong> on HarmonyOS. By combining ArkUI&#8217;s component-based UI design with ArkTS&#8217;s powerful data management capabilities, developers can efficiently create apps that deliver smooth and responsive user experiences. With this foundational structure, you are now ready to extend your app with more advanced features or customizations that meet your users&#8217; needs.</p><p>Happy coding!</p><p></p><p>Original Source: <a href="https://medium.com/huawei-developers/building-a-note-app-with-arkui-and-arkts-on-harmonyos-67fd7c4c1086">Building a Note App With ArkUI and ArkTS on HarmonyOS | by Emine &#304;NAN | Huawei Developers | Medium</a></p><h1></h1>]]></content:encoded></item><item><title><![CDATA[The Road to Globalization of HarmonyOS Next Applications: Internationalization and Localization ]]></title><description><![CDATA[This article aims to deeply explore the technical details of the Huawei HarmonyOS Next system (up to API 12 as of now) in terms of application internationalization and localization, and is summarized]]></description><link>https://www.harmony-developers.com/p/the-road-to-globalization-of-harmonyos</link><guid isPermaLink="false">https://www.harmony-developers.com/p/the-road-to-globalization-of-harmonyos</guid><dc:creator><![CDATA[Harmony OS Developers]]></dc:creator><pubDate>Sun, 11 May 2025 08:42:00 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/2ab6a346-c588-44ae-8a57-0f42532ddfb5_971x593.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<blockquote><p>This article aims to deeply explore the technical details of the Huawei HarmonyOS Next system (up to API 12 as of now) in terms of application internationalization and localization, and is summarized based on actual development practices. It mainly serves as a carrier for technical sharing and communication. Mistakes and omissions are inevitable. Colleagues are welcome to put forward valuable opinions and questions so that we can make progress together. This article is original content, and any form of reprint must indicate the source and the original author.<br>In today's era of globalization, application internationalization and localization have become key factors in enhancing user experience and expanding market share. The Huawei HarmonyOS Next system provides powerful tools and functions for developers to help create cross-language and cross-cultural applications. This article will introduce in detail the concepts, advantages, processes, and key steps of internationalization and localization of HarmonyOS Next applications, helping developers embark on the road to application globalization.</p><h2><strong>I. Concepts and Differences between Internationalization and Localization</strong></h2><h3><strong>(I) Internationalization (Internationalization, I18n)</strong></h3><p>Internationalization refers to the process of designing and developing an application so that it can adapt to different languages, regions, and cultures. It involves not only simple language translation but also the adaptation of various formats such as dates, times, numbers, currencies, weights and measures, as well as the universal design of interface layouts, icons, colors, and other elements. The goal of internationalization is to create an application that can be used globally without extensive code modifications. For example, in an internationalized application, the date format may be displayed in different styles depending on the user's region, such as "YYYY-MM-DD" (China) or "MM/DD/YYYY" (United States).</p><h3><strong>(II) Localization (Localization, L10n)</strong></h3><p>Localization is the process of customizing and optimizing an application for a specific target language and region on the basis of internationalization. This includes translating the interface text of the application into the local language, adjusting the interface layout to adapt to different text lengths and reading habits, and using local cultural elements and symbols. Localization ensures that the application can provide a natural, smooth, and user-expected experience in each target market. For example, when localizing an English application to Japan, not only should the text be translated into Japanese, but the interface layout may also need to be adjusted to adapt to the display of Japanese characters, and Japanese cultural elements may be used to enhance user affinity.</p><h3><strong>(III) Differences between the Two</strong></h3><p>Internationalization focuses on building the general framework and infrastructure of an application to enable it to support multiple languages and cultures; while localization is the personalized adaptation and optimization of an application for specific languages and regions. Internationalization is a global and forward-looking design concept, while localization is the actual implementation for specific markets on the basis of internationalization.</p><h2><strong>II. Advantages of Internationalization and Localization of HarmonyOS Next Applications</strong></h2><h3><strong>(I) Expanding the Global Market</strong></h3><p>Through internationalization and localization, applications can break through language and cultural barriers, attract users from different countries and regions, greatly expand market coverage, and increase the potential user base.</p><h3><strong>(II) Enhancing User Experience</strong></h3><p>Providing users with interfaces and functions that conform to their language habits and cultural backgrounds enables them to use the application more naturally and conveniently, thereby increasing user satisfaction and loyalty.</p><h3><strong>(II) Strengthening Competitiveness</strong></h3><p>In the global market competition, applications with internationalization and localization capabilities have an advantage, can better meet user needs, compete with local competitors, and enhance brand image and market share.</p><h3><strong>(IV) Reducing Development Costs</strong></h3><p>Adopting internationalization and localization design methods and following certain norms and standards during the development process can reduce the costs of separate development and maintenance for different languages and regions in the later stage.</p><h2><strong>III. Processes of Internationalization and Localization of HarmonyOS Next Applications</strong></h2><h3><strong>(I) Requirement Analysis</strong></h3><ol><li><p><strong>Target Market Research</strong>: Understand the potential markets of the application, including factors such as languages, cultures, user habits, and laws and regulations in different regions. For example, certain regions may have different cultural meanings for specific colors or icons, which need to be considered in the design.</p></li><li><p><strong>Function Requirement Evaluation</strong>: Determine the functions that the application needs to support in different language and cultural environments, such as multi-language input, payment methods in different regions, and localized push notifications. ### (II) Design Stage</p></li><li><p><strong>Interface Layout Design</strong>: Adopt a flexible layout method and reserve sufficient space to adapt to the length changes of different language texts. At the same time, consider functions such as interface mirroring to support the display requirements of right-to-left (RTL) languages such as Arabic.</p></li><li><p><strong>Resource Separation</strong>: Separate interface texts, pictures, audio, and other resources from the code logic to facilitate subsequent translation and replacement. For example, store all string resources in independent files instead of hard-coding them in the code. ### (III) Development Stage</p></li><li><p><strong>Using the Internationalization Framework</strong>: Utilize the internationalization and localization development services provided by HarmonyOS Next, such as the <code>Localization Kit</code>, to perform language and region-related settings, resource loading, and format conversions.</p></li><li><p><strong>Function Implementation and Adaptation</strong>: According to the requirement analysis, implement functions that support multiple languages, such as displaying the corresponding interface according to the user's language setting and handling date and time formats in different regions. ### (IV) Testing Stage</p></li><li><p><strong>Language Testing</strong>: Have local language experts or users test the translation accuracy, language fluency, and interface display of the application to ensure the quality of the application in different language environments.</p></li><li><p><strong>Localization Testing</strong>: Include interface layout testing, function compatibility testing, and cultural adaptability testing to check whether the application can operate normally in each target region and meet the expectations of local users.</p></li><li><p><strong>Pseudo-Localization Testing</strong>: Before formal localization, simulate the localization process by using pseudo-translated texts and special test regions (such as <code>en-XA</code>) to discover potential localization problems such as interface truncation and incorrect text direction. ### (V) Release and Maintenance Stage</p></li><li><p><strong>Multi-Language Version Release</strong>: Release the application in corresponding language versions according to different target markets.</p></li><li><p><strong>Continuous Optimization</strong>: Collect user feedback, promptly fix localization-related problems, and continuously update and optimize the internationalization and localization content of the application according to market changes and user needs. ## IV. Key Steps of Internationalization and Localization of HarmonyOS Next Applications ### (I) Setting the System Language and Region</p></li><li><p><strong>Obtaining the System Language and Region</strong>: Use the methods <code>i18n.System.getSystemLanguage()</code> and <code>i18n.System.getSystemRegion()</code> to obtain the language and region information of the current system.</p></li><li><p><strong>Setting the Application Preferred Language</strong>: The method <code>i18n.System.setAppPreferredLanguage()</code> can be used to set a specific preferred language for the application, so that the application loads the corresponding resources according to the user's setting or the default language when it starts. For example:</p></li></ol></blockquote><pre><code><code>import { i18n } from '@kit.LocalizationKit';
import {BusinessError } from '@kit.BasicServicesKit';
try {
    i18n.System.setAppPreferredLanguage("zh-Hans"); // Set the application preferred language to Simplified Chinese
} catch(error) {
    let err: BusinessError = error as BusinessError;
    console.error(`Failed to set the application preferred language, error code: ${err.code}, message: ${err.message}.`);
}
</code></code></pre><h3><strong>(II) Resource File Configuration and Management</strong></h3><ol><li><p><strong>Determining the Target Region</strong>: Clearly define the languages and regions that the application needs to support, referring to the region identifier (consisting of language, script, country/region, and extension parameters).</p></li><li><p><strong>Creating Resource Directories and Files</strong>: - Resource directories include the default (<code>base</code>) directory and qualifier directories (such as <code>resources/en_GB-vertical-car-mdpi</code>). The default directory stores general resources, and the qualifier directories are customized according to languages, scripts, etc., and are used to store resources for specific regions. - Create resource files (such as <code>.json</code> files) in the corresponding directories and classify and store resources such as strings, pictures, and audio. For example, store string resources in different languages in the <code>strings.json</code> file in the corresponding language directory.</p></li><li><p><strong>Resource Matching Rules</strong>: The application matches the user's language preference list with the resource directories and displays the most matching resources first. If no matching resources are found, the content in the default directory is used. ### (III) Interface Text Processing</p></li><li><p><strong>Avoiding Hard Coding</strong>: Extract all the text displayed on the interface to resource files and load them using relevant interfaces, avoiding directly hard-coding strings in the code. For example, define in the <code>strings.json</code> file:</p></li></ol><pre><code><code>{
    "name": "welcome_message",
    "value": "&#27426;&#36814;&#20351;&#29992;&#24212;&#29992;"
}
</code></code></pre><p>Then obtain and display this string in the code through the resource loading mechanism.</p><ol><li><p><strong>Supporting Singular and Plural Forms</strong>: According to the singular and plural rules of different languages, use methods such as <code>getPluralStringValueSync</code> to correctly handle the singular and plural forms of nouns or unit expressions. For example, in English, for the word "apple", display "apple" (singular) or "apples" (plural) depending on the quantity. ### (IV) Internationalization of Dates, Times, Numbers, and Weights and Measures</p></li><li><p><strong>Date and Time Formatting</strong>: - Use the <code>format</code> interface of the <code>DateTimeFormat</code> class to format date and time objects into appropriate strings according to the language and cultural habits of the user's region. For example:</p></li></ol><pre><code><code>import { intl } from '@kit.LocalizationKit';
let date = new Date(2021, 8, 17, 13, 4, 0);
let dateFormat1 = new intl.DateTimeFormat('zh-CN', {dateStyle: 'full', timeStyle: 'full'});
let formattedDate1 = dateFormat1.format(date); // Friday, September 17, 2021 China Standard Time 13:04:00
</code></code></pre><p>- At the same time, pay attention to handling daylight saving time transitions to ensure that the application displays the correct time during daylight saving time. The <code>Calendar</code> class can be used to obtain and set time zones, calculate time offsets related to daylight saving time, etc.</p><ol><li><p><strong>Number and Weights and Measures Formatting</strong>: - Through the <code>format</code> interface of the <code>NumberFormat</code> class, format numbers according to the user's region settings, including decimal separators, grouped displays, and currency symbols. For example:</p></li></ol><pre><code><code>import { intl } from '@kit.LocalizationKit';
let numberFormat1 = new intl.NumberFormat('zh-CN', {notation:'scientific', maximumSignificantDigits: 3});
let formattedNumber1 = numberFormat1.format(123400); // 1.23E5
</code></code></pre><p>- For weights and measures conversion, use the <code>unitConvert</code> interface of the <code>I18NUtil</code> class to perform unit conversion and formatting according to different weights and measures systems.</p><h3><strong>(V) Localization Testing and Optimization</strong></h3><ol><li><p><strong>Comprehensive Testing</strong>: Conduct language testing, localization testing, and pseudo-localization testing to cover all functions and interface elements of the application. During the testing process, check issues such as translation accuracy, interface layout rationality, and cultural adaptability.</p></li><li><p><strong>Problem Fixing and Optimization</strong>: According to the testing results, promptly fix the discovered problems and optimize the application. This may include adjusting the interface layout, modifying the translation text, optimizing resource loading, etc. At the same time, continuously monitor user feedback and continuously improve the internationalization and localization quality of the application. ### (VI) Continuous Update and Maintenance</p></li><li><p><strong>Language and Resource Updates</strong>: With the changes in the market and the evolution of user needs, promptly update the language resources of the application, including the update of translation texts and the support of new languages.</p></li><li><p><strong>Function Adaptation and Optimization</strong>: According to the user feedback and market needs in different regions, adapt and optimize the functions of the application to ensure that the application always maintains a good user experience globally. Through the above steps, we can gradually realize the internationalization and localization of HarmonyOS Next applications and create high-quality applications that adapt to the global market. In the actual development process, various language and cultural differences need to be fully considered, attention should be paid to details, and continuous optimization should be carried out to meet the diverse needs of users in different regions.</p></li></ol><p>Original source: <a href="https://dev.to/xun_wang_6384a403f9817c2/the-road-to-globalization-of-harmonyos-next-applications-internationalization-and-localization-21om#:~:text=This%20article%20will%20introduce%20in%20detail%20the%20concepts%2C,developers%20embark%20on%20the%20road%20to%20application%20globalization.">The Road to Globalization of HarmonyOS Next Applications: Internationalization and Localization - DEV Community</a></p>]]></content:encoded></item><item><title><![CDATA[HarmonyOS Next: Building Applications with Different Package Names Using Multi-Target Products in One Project ]]></title><description><![CDATA[In daily development, manually switching signature files and package names when dealing with multi-signature and multi-product build outputs is error-prone and time-consuming.]]></description><link>https://www.harmony-developers.com/p/harmonyos-next-building-applications</link><guid isPermaLink="false">https://www.harmony-developers.com/p/harmonyos-next-building-applications</guid><dc:creator><![CDATA[Harmony OS Developers]]></dc:creator><pubDate>Thu, 08 May 2025 09:04:42 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!cIbH!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F48e3a9fc-a22b-420d-8cf3-5eefc07ff37a_1077x592.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2><strong>Introduction</strong></h2><p>In daily development, manually switching signature files and package names when dealing with <strong>multi-signature</strong> and multi-product build outputs is error-prone and time-consuming. HarmonyOS provides custom hvigor plugins and multi-target product building capabilities. We can use hvigor plugins to dynamically modify project configurations, ensuring that a single codebase can switch between different package names while maintaining core functionality. This allows us to generate customized build products through multi-target product building.</p><h2><strong>I. Understanding Multi-Target Product Building</strong></h2><h3><strong>1. What is Multi-Target Product Building?</strong></h3><p>Simply put, multi-target products refer to highly customized output modules. Developers can build different HAP, HAR, HSP, APP, etc., by defining different build configurations to achieve differentiation between products. For detailed customization options, see: <a href="https://developer.huawei.com/consumer/cn/doc/best-practices/bpta-multi-target#section19846433183815">https://developer.huawei.com/consumer/cn/doc/best-practices/bpta-multi-target#section19846433183815</a></p><h3><strong>2. Build Schematic Diagram</strong></h3><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!cIbH!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F48e3a9fc-a22b-420d-8cf3-5eefc07ff37a_1077x592.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!cIbH!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F48e3a9fc-a22b-420d-8cf3-5eefc07ff37a_1077x592.png 424w, https://substackcdn.com/image/fetch/$s_!cIbH!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F48e3a9fc-a22b-420d-8cf3-5eefc07ff37a_1077x592.png 848w, https://substackcdn.com/image/fetch/$s_!cIbH!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F48e3a9fc-a22b-420d-8cf3-5eefc07ff37a_1077x592.png 1272w, https://substackcdn.com/image/fetch/$s_!cIbH!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F48e3a9fc-a22b-420d-8cf3-5eefc07ff37a_1077x592.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!cIbH!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F48e3a9fc-a22b-420d-8cf3-5eefc07ff37a_1077x592.png" width="1077" height="592" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/48e3a9fc-a22b-420d-8cf3-5eefc07ff37a_1077x592.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:592,&quot;width&quot;:1077,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;image.png&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="image.png" title="image.png" srcset="https://substackcdn.com/image/fetch/$s_!cIbH!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F48e3a9fc-a22b-420d-8cf3-5eefc07ff37a_1077x592.png 424w, https://substackcdn.com/image/fetch/$s_!cIbH!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F48e3a9fc-a22b-420d-8cf3-5eefc07ff37a_1077x592.png 848w, https://substackcdn.com/image/fetch/$s_!cIbH!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F48e3a9fc-a22b-420d-8cf3-5eefc07ff37a_1077x592.png 1272w, https://substackcdn.com/image/fetch/$s_!cIbH!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F48e3a9fc-a22b-420d-8cf3-5eefc07ff37a_1077x592.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h2><strong>II. Implementing Multi-Target Product Building in a Project</strong></h2><p><em>(Source code reference branch: feature/multiTargetProduct)</em></p><h3><strong>1. Configuring Multi-Target Product Building</strong></h3><p>Multi-target product building requires modifying configuration files like <code>build-profile.json5</code> and <code>module.json5</code> to define different <code>product</code> and <code>target</code> entries. Developers can specify device types, source sets, resources, and assign different targets to products. The build tool generates targets based on these configurations and combines them into customized products.</p><h4><strong>Configure Signing Configs for Different Projects:</strong></h4><p>Define <code>default</code>, <code>demo_debug</code>, and <code>demo_release</code> signing configurations for debugging and release builds:</p><pre><code><code>"signingConfigs": [
  {
    "name": "default", // Default certificate
    "type": "HarmonyOS",
    "material": { /* ... default certificate details ... */ }
  },
  {
    "name": "demo_debug", // Debugging certificate
    "type": "HarmonyOS",
    "material": { /* ... debug certificate details ... */ }
  },
  {
    "name": "demo_release", // Release certificate
    "type": "HarmonyOS",
    "material": { /* ... release certificate details ... */ }
  }
]</code></code></pre><h4><strong>Define Products with Different Signing Configs:</strong></h4><p>Each product uses a specific signing configuration to generate differentiation outputs:</p><pre><code><code>"products": [
  {
    "name": "default",
    "signingConfig": "default", // Default product uses default certificate
    "compatibleSdkVersion": "5.0.1(13)",
    "runtimeOS": "HarmonyOS",
    "buildOption": { /* ... build options ... */ }
  },
  {
    "name": "products_debug",
    "signingConfig": "demo_debug", // Debug product uses debug certificate
    "compatibleSdkVersion": "5.0.1(13)",
    "runtimeOS": "HarmonyOS",
    "buildOption": { /* ... build options ... */ }
  },
  {
    "name": "products_release",
    "signingConfig": "demo_release", // Release product uses release certificate
    "compatibleSdkVersion": "5.0.1(13)",
    "runtimeOS": "HarmonyOS",
    "buildOption": { /* ... build options ... */ }
  }
]</code></code></pre><h4><strong>Link Products to Targets in HAP/HSP Modules:</strong></h4><p>Configure targets in <code>modules</code> to associate products with build outputs:</p><pre><code><code>"modules": [
  {
    "name": "entry",
    "srcPath": "./entry",
    "targets": [
      {
        "name": "default",
        "applyToProducts": [
          "default",
          "products_debug",
          "products_release"
        ]
      }
    ]
  }
]</code></code></pre><h3><strong>2. Switching Product Configurations and Output Packages</strong></h3><h4><strong>Manual Switching Interface:</strong></h4><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!d6xg!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fecde517e-1886-4325-8c5b-ab4de0a7b79e_1846x1000.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!d6xg!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fecde517e-1886-4325-8c5b-ab4de0a7b79e_1846x1000.png 424w, https://substackcdn.com/image/fetch/$s_!d6xg!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fecde517e-1886-4325-8c5b-ab4de0a7b79e_1846x1000.png 848w, https://substackcdn.com/image/fetch/$s_!d6xg!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fecde517e-1886-4325-8c5b-ab4de0a7b79e_1846x1000.png 1272w, https://substackcdn.com/image/fetch/$s_!d6xg!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fecde517e-1886-4325-8c5b-ab4de0a7b79e_1846x1000.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!d6xg!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fecde517e-1886-4325-8c5b-ab4de0a7b79e_1846x1000.png" width="1456" height="789" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ecde517e-1886-4325-8c5b-ab4de0a7b79e_1846x1000.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:789,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;image-20250422101824117.png&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="image-20250422101824117.png" title="image-20250422101824117.png" srcset="https://substackcdn.com/image/fetch/$s_!d6xg!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fecde517e-1886-4325-8c5b-ab4de0a7b79e_1846x1000.png 424w, https://substackcdn.com/image/fetch/$s_!d6xg!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fecde517e-1886-4325-8c5b-ab4de0a7b79e_1846x1000.png 848w, https://substackcdn.com/image/fetch/$s_!d6xg!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fecde517e-1886-4325-8c5b-ab4de0a7b79e_1846x1000.png 1272w, https://substackcdn.com/image/fetch/$s_!d6xg!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fecde517e-1886-4325-8c5b-ab4de0a7b79e_1846x1000.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h2><strong>III. Building Different Package Names and Configurations on Multi-Target Products</strong></h2><p><em>(Source code reference branch: feature/differentPackageConfigurations)</em></p><h3><strong>1. Adding Signing and Product Configs for a Second App</strong></h3><h4><strong>New Signing Configuration for Second App:</strong></h4><pre><code><code>"signingConfigs": [
  // ... existing configs ...
  {
    "name": "demo_debug_test2", // Signing for the second app
    "type": "HarmonyOS",
    "material": { /* ... testDemo2 certificate details ... */ }
  }
]</code></code></pre><h4><strong>Define a New Product with Unique Identifiers:</strong></h4><p>Configure <code>label</code>, <code>icon</code>, <code>bundleName</code>, and <code>output</code> for differentiation. Use <code>buildProfileFields</code> for custom parameters:</p><pre><code><code>"products": [
  // ... existing products ...
  {
    "name": "products_debug_test2",
    "signingConfig": "demo_debug_test2",
    "compatibleSdkVersion": "5.0.1(13)",
    "runtimeOS": "HarmonyOS",
    "label": "$string:app_name_test2", // Second app's name
    "icon": "$media:app_icon_test2", // Second app's icon
    "bundleName": "com.atomicservice.6917571239128090930", // Second app's package name
    "buildOption": { /* ... build options ... */ },
    "output": { "artifactName": "products_debug_test2" } // Unique output directory
  }
]</code></code></pre><h3><strong>2. Implementation Results After Configuration</strong></h3><h4><strong>Output Product Information:</strong></h4><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!xMTY!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb1fe14fd-90ff-4305-9c8f-4d94ae0cbd07_1846x1000.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!xMTY!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb1fe14fd-90ff-4305-9c8f-4d94ae0cbd07_1846x1000.png 424w, https://substackcdn.com/image/fetch/$s_!xMTY!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb1fe14fd-90ff-4305-9c8f-4d94ae0cbd07_1846x1000.png 848w, https://substackcdn.com/image/fetch/$s_!xMTY!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb1fe14fd-90ff-4305-9c8f-4d94ae0cbd07_1846x1000.png 1272w, https://substackcdn.com/image/fetch/$s_!xMTY!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb1fe14fd-90ff-4305-9c8f-4d94ae0cbd07_1846x1000.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!xMTY!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb1fe14fd-90ff-4305-9c8f-4d94ae0cbd07_1846x1000.png" width="1456" height="789" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b1fe14fd-90ff-4305-9c8f-4d94ae0cbd07_1846x1000.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:789,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;image-20250422101824117.png&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="image-20250422101824117.png" title="image-20250422101824117.png" srcset="https://substackcdn.com/image/fetch/$s_!xMTY!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb1fe14fd-90ff-4305-9c8f-4d94ae0cbd07_1846x1000.png 424w, https://substackcdn.com/image/fetch/$s_!xMTY!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb1fe14fd-90ff-4305-9c8f-4d94ae0cbd07_1846x1000.png 848w, https://substackcdn.com/image/fetch/$s_!xMTY!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb1fe14fd-90ff-4305-9c8f-4d94ae0cbd07_1846x1000.png 1272w, https://substackcdn.com/image/fetch/$s_!xMTY!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb1fe14fd-90ff-4305-9c8f-4d94ae0cbd07_1846x1000.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Desktop icon and application name after it takes effect:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!TIyi!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb6950b23-8055-4cae-8e32-b413a880f44f_1536x910.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!TIyi!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb6950b23-8055-4cae-8e32-b413a880f44f_1536x910.png 424w, https://substackcdn.com/image/fetch/$s_!TIyi!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb6950b23-8055-4cae-8e32-b413a880f44f_1536x910.png 848w, https://substackcdn.com/image/fetch/$s_!TIyi!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb6950b23-8055-4cae-8e32-b413a880f44f_1536x910.png 1272w, https://substackcdn.com/image/fetch/$s_!TIyi!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb6950b23-8055-4cae-8e32-b413a880f44f_1536x910.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!TIyi!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb6950b23-8055-4cae-8e32-b413a880f44f_1536x910.png" width="1456" height="863" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b6950b23-8055-4cae-8e32-b413a880f44f_1536x910.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:863,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;image-20250422111847105.png&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="image-20250422111847105.png" title="image-20250422111847105.png" srcset="https://substackcdn.com/image/fetch/$s_!TIyi!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb6950b23-8055-4cae-8e32-b413a880f44f_1536x910.png 424w, https://substackcdn.com/image/fetch/$s_!TIyi!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb6950b23-8055-4cae-8e32-b413a880f44f_1536x910.png 848w, https://substackcdn.com/image/fetch/$s_!TIyi!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb6950b23-8055-4cae-8e32-b413a880f44f_1536x910.png 1272w, https://substackcdn.com/image/fetch/$s_!TIyi!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb6950b23-8055-4cae-8e32-b413a880f44f_1536x910.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h3><strong>3. Querying and Using Custom Constants</strong></h3><p>Use <code>buildProfileFields</code> to define product-specific parameters for code differentiation.</p><h4><strong>Configure Custom Constants in Products:</strong></h4><pre><code><code>"products": [
  {
    "name": "default",
    "buildOption": {
      "arkOptions": {
        "buildProfileFields": {
          "isStartNet": false,
          "isDebug": true,
          "productsName": "default"
          // ... other custom parameters ...
        }
      }
    }
  },
  // ... repeat for other products with unique values ...
]</code></code></pre><h4><strong>Access Custom Configs in Code:</strong></h4><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!RlqL!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F03e6af69-e270-4af0-80b1-42b736a60549_1536x910.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!RlqL!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F03e6af69-e270-4af0-80b1-42b736a60549_1536x910.png 424w, https://substackcdn.com/image/fetch/$s_!RlqL!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F03e6af69-e270-4af0-80b1-42b736a60549_1536x910.png 848w, https://substackcdn.com/image/fetch/$s_!RlqL!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F03e6af69-e270-4af0-80b1-42b736a60549_1536x910.png 1272w, https://substackcdn.com/image/fetch/$s_!RlqL!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F03e6af69-e270-4af0-80b1-42b736a60549_1536x910.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!RlqL!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F03e6af69-e270-4af0-80b1-42b736a60549_1536x910.png" width="1456" height="863" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/03e6af69-e270-4af0-80b1-42b736a60549_1536x910.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:863,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;image-20250422111847105.png&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="image-20250422111847105.png" title="image-20250422111847105.png" srcset="https://substackcdn.com/image/fetch/$s_!RlqL!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F03e6af69-e270-4af0-80b1-42b736a60549_1536x910.png 424w, https://substackcdn.com/image/fetch/$s_!RlqL!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F03e6af69-e270-4af0-80b1-42b736a60549_1536x910.png 848w, https://substackcdn.com/image/fetch/$s_!RlqL!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F03e6af69-e270-4af0-80b1-42b736a60549_1536x910.png 1272w, https://substackcdn.com/image/fetch/$s_!RlqL!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F03e6af69-e270-4af0-80b1-42b736a60549_1536x910.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Import <code>BuildProfile</code> and use parameters in UI:</p><pre><code><code>import BuildProfile from 'BuildProfile';  
Column() {  
  Text(`productsName:${BuildProfile.productsName}`)  
  // ... other Text components for custom fields ...  
}  </code></code></pre><h4><strong>UI Display of Custom Parameters:</strong></h4><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!OkPk!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7292d563-6847-4c3c-a035-b3d3c1429f48_358x753.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!OkPk!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7292d563-6847-4c3c-a035-b3d3c1429f48_358x753.png 424w, https://substackcdn.com/image/fetch/$s_!OkPk!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7292d563-6847-4c3c-a035-b3d3c1429f48_358x753.png 848w, https://substackcdn.com/image/fetch/$s_!OkPk!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7292d563-6847-4c3c-a035-b3d3c1429f48_358x753.png 1272w, https://substackcdn.com/image/fetch/$s_!OkPk!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7292d563-6847-4c3c-a035-b3d3c1429f48_358x753.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!OkPk!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7292d563-6847-4c3c-a035-b3d3c1429f48_358x753.png" width="358" height="753" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7292d563-6847-4c3c-a035-b3d3c1429f48_358x753.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:753,&quot;width&quot;:358,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;image-20250422114531440.png&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="image-20250422114531440.png" title="image-20250422114531440.png" srcset="https://substackcdn.com/image/fetch/$s_!OkPk!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7292d563-6847-4c3c-a035-b3d3c1429f48_358x753.png 424w, https://substackcdn.com/image/fetch/$s_!OkPk!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7292d563-6847-4c3c-a035-b3d3c1429f48_358x753.png 848w, https://substackcdn.com/image/fetch/$s_!OkPk!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7292d563-6847-4c3c-a035-b3d3c1429f48_358x753.png 1272w, https://substackcdn.com/image/fetch/$s_!OkPk!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7292d563-6847-4c3c-a035-b3d3c1429f48_358x753.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h2><strong>IV. Conclusion</strong></h2><p>Multi-target product building allows rapid switching between different build configurations and solves package name differentiation for scenarios like multi-entity app submissions (e.g., domestic vs. foreign entities on AG). While this covers basic customization, advanced needs (e.g., dynamic <code>client_id</code>/<code>app_id</code> in <code>module.json5</code>) require integration with <strong>hvigor plugins</strong>. Future articles will explore using custom scripts to modify hard-coded configurations during builds.</p><h2><strong>VI. Source Code Repository</strong></h2><p><a href="https://gitee.com/qq1963861722/MultiBuildDemo.git">Repository Address</a></p><h2><strong>VII. Reference Materials</strong></h2><p><a href="https://developer.huawei.com/consumer/cn/doc/best-practices/bpta-multi-target">Multi-Target Product Building Practice - Huawei HarmonyOS Developers</a><br><a href="https://juejin.cn/post/7427050728719368202">HarmonyOS Multi-Environment Building Guide - Juejin</a></p><p></p><p>Original source links: <a href="https://leetcode.com/discuss/post/6725085/harmonyos-next-build-application-with-di-xjdd/https:/leetcode.com/discuss/post/6725085/harmonyos-next-build-application-with-di-xjdd/">HarmonyOS Next&#65306; Build Application with Different Package Names - Discuss - LeetCode</a> redirected from <a href="https://news.ycombinator.com/item?id=43924349">HarmonyOS Next&#65306; Build Application with Different Package Names | Hacker News</a></p>]]></content:encoded></item><item><title><![CDATA[HarmonyOS Next Private Repository Construction in Practice ]]></title><description><![CDATA[This article builds its own private repository based on the tools provided by the official.]]></description><link>https://www.harmony-developers.com/p/harmonyos-next-private-repository</link><guid isPermaLink="false">https://www.harmony-developers.com/p/harmonyos-next-private-repository</guid><dc:creator><![CDATA[Harmony OS Developers]]></dc:creator><pubDate>Tue, 06 May 2025 22:49:24 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/b8793509-20bb-4859-8ca3-cd036fddd9ec_825x417.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2><strong>Background</strong></h2><p>In Android and iOS development, dependencies and collaborations are often carried out in the form of binary products. Android uses Maven as the repository, and iOS has Pod as the repository. We can use open libraries provided by others on the officially provided platforms, which greatly improves everyone's development efficiency. However, some libraries related to a company's business do not want to be used by external personnel. Uploading them to external common repositories is not very safe. Many companies have built private repositories internally. On the one hand, it is more secure, and on the other hand, pushing and pulling products is usually faster.</p><p>HarmonyOS has the same issue. We can conveniently use open products from third parties on the official repository platform, but for a company's internal business, it still needs to rely on private repositories. This article builds its own private repository based on the tools provided by the official.</p><h2><strong>Introduction to HarmonyOS Shared Packages</strong></h2><p>HarmonyOS shared packages are divided into static shared packages and dynamic shared packages:</p><ul><li><p>HAR (Harmony Archive) is a static shared package that can contain code, C++ libraries, resources, and configuration files. Through HAR, multiple modules or multiple projects can share relevant codes such as ArkUI components and resources. HAR is different from HAP and cannot be independently installed and run on devices. It can only be referenced as a dependency of application modules.</p></li><li><p>HSP (Harmony Shared Package) is a dynamic shared package. Static shared packages will be packaged into each dependent HAP, resulting in a large package size and repeated packaging of multiple copies of public resources and codes into the application. Dynamic shared packages allow multiple HAPs to share the same public resource code. HSP only supports sharing within an application and does not support cross-application sharing.</p></li></ul><h2><strong>Building a Private Repository with the ohpm-repo Private Repository Tool</strong></h2><p>The official provides the ohpm-repo tool to help developers quickly build lightweight ohpm private repositories. It is compatible with the ohpm package manager and caches all dependencies on demand to accelerate installation in a private network.</p><p>ohpm-repo supports single-point deployment and multi-instance deployment:</p><ul><li><p>Single-point deployment: ohpm-repo is only deployed and used on one machine.</p></li><li><p>Multi-instance deployment: ohpm-repo will be deployed on multiple machines with the same configuration content and shared data storage space.</p></li></ul><h3><strong>Installation of the Dependent Environment</strong></h3><ol><li><p>ohpm-repo depends on node to run and supports node.js 16.x and above versions. Nodejs needs to be installed first, and the environment needs to be configured. NodeJs can be downloaded from the official website (<a href="https://nodejs.org/download/release/latest/">https://nodejs.org/download/release/latest/</a>).</p></li></ol><h3><strong>Downloading the ohpm-repo Tool</strong></h3><ol><li><p>Download the ohpm-repo tool. The download address is: <a href="https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/ide-software-download-0000001507075446">https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/ide-software-download-0000001507075446</a></p></li><li><p>Unzip the ohpm-repo tool.</p></li></ol><h3><strong>Configuring the ohpm-repo Environment Variables</strong></h3><ol><li><p>Configure the path of the bin directory in the unzipped directory of the ohpm-repo tool package to the system environment variable path: <code>export PATH=$OHPM-REPO-PATH/bin:$PATH</code></p></li><li><p>Execute the command <code>ohpm-repo -v</code> to view the version number and verify that the unzipped package is intact.</p></li></ol><h3><strong>Configuration of the ohpm-repo Service Configuration File</strong></h3><p>Enter the conf directory in the unzipped directory, open the config.yaml file. The default configuration is as follows:</p><pre><code><code>##### server configuration section #####
listen: 0.0.0.0:8088
# listen:
# - localhost:8088            # Listen to the local loopback address
# - http://localhost:8088     # Listen to the local loopback address
# - 0.0.0.0:8088              # Listen to all local addresses (INADDR_ANY)
# Protocol Configurable http or https&#65292;default http
# port: 1-65535(Windowssystems)/ 1024-65535(LinuxmaybeMacsystems&#65289;

# selectable (listen because of https You must configure the)
https_key: ''                 # https service-usable key pathways  (No configuration defaults to'')
https_cert: ''                # https service-usable crt pathways  (No configuration defaults to'')

##### server deploy root section #####
deploy_root: ''                # Installation root directory (No configuration defaults to `&lt;existing userhomedirectory (on computer hard drive)&gt;/ohpm-repo`)&#65292;Only absolute paths are supported&#65292;and the path directory must exist

##### server numeric limit section #####
max_package_size: 100          # Upload packet size limit inMB (0, 100]&#65292;&#19981;&#37197;&#32622;&#40664;&#35748;&#20026; 100
max_extract_size: 500          # Unpacked zip size limit&#65292;The unit isMB [max_package_size, 500]&#65292;No configuration defaults to 500
max_extract_file_num: 10240    # Limit the number of files in a zip archive after decompression (0, 102400]&#65292;No configuration defaults to 10240
user_rate_limit: 100           # User access frequency control in times/s (0, 10000]&#65292;No configuration defaults to 100
fetch_timeout: 60              # Request/response timeout in seconds (0, 3600]&#65292;No configuration defaults to 60
keep_alive_timeout: 60         # TCP Hold connection timeout&#65292;In seconds. (0, 3600]&#65292;&#19981;&#37197;&#32622;&#40664;&#35748;&#20026; 60
api_timeout: 60                # apitimeout&#65292;In seconds.(0, 3600]&#65292;No configuration defaults to 60
upload_lock_hour: 24           # After taking down all versions of a package, a time-limited ban on uploads of packages with the same name will be imposed.&#65292;&#21333;Bit is the hour. (0, 168]&#65292;non-configuration&#65292;default 24
upload_max_times: 100          # Limit on the number of uploads in a 24-hour period for a single user (0, 10000]&#65292;No configuration defaults to 100

##### metadata storage section #####
## Data storage type filedb respond in singing mysql Either/or, not both
db:                         # must yaml Writing in array form
  type: filedb
  config:                   # If you want to change the storage path and keep the old data, you need to change the number under the old path to the new path. Migration of documents to new paths
    path:./db              # Local data storage path, not configured defaults to &lt;deploy_root&gt;/db;

#db:                        # Must be written in yaml array form
#  type: mysql
#  config:
#    host: "localhost"      # Database host address
#    port: 3306             # database port (0,65535]
#    username: root         # User name of the database
#    password: "password"   # User password for the database (please configure it in plaintext, it will eventually be converted to ciphertext in the deployment directory)
#    database: "repo"       # database name

##### storage section #####
## File storage typefs,sftp &#21644; custom Three choices, not more.

store:                               # Must be written in yaml array form
  type: fs
  config:                            # If you want to change the storage path after uploading a resource, you need to migrate the data under the old path to the new path.
    path:./storage                  # The path to the triple repository store that has been shelved, without configuration the default is  &lt;deploy_root&gt;/storage;
    #server: http://localhost:8088   # Tripartite library download link, no default value configured

# The file storage type is sftp &#26102;&#65292;Configure up to three sftp services
#store:                               # Must be written in yaml array form
#  type: sftp                         # if and only if db The type of the mysql hour&#65292;store It is only when the type of the sftp
#  config:
#    location:
#      -
#        name: test_one_sftp          # Host name, name cannot be duplicated with other sftp configurations
#        host: "localhost"            # host address
#        port: 22                     # host port (0,65535]
#        read_username: "read"        # Name of the user with read access to the host
#        read_password: "password"    # Passwords for users with read access to the host (please configure plaintext, it will be converted to ciphertext in the deployment directory)
#        write_username: "write"      # Name of the user with write access to the host
#        write_password: "password"   # Passwords for users with write access to the host (please configure plaintext, it will be converted to ciphertext in the deployment directory)
#        path: /source22              # Path to a file relative to the sftp root directory, starts with / only, and the path folder must exist.
#      -
#        name: test_two_sftp
#        host: "localhost"
#        port: 24
#        read_username: "read"
#        read_password: "password"
#        write_username: "write"
#        write_password: "password"
#        path: /source24
#    #server: http://localhost:8088   # The address of the local repository download link, without configuring the default value of listen,
#store:
#  type: custom                                            # is a custom storage plugin type, the custom storage plugin development process is described in the guidance document
#  config:
#    export_name: CustomStorage                            # Class name of the plugin export
#    plugin_path:../plugins/CustomStorage.js              # The absolute path of the plugin or the path relative to the ohpm-repo package, it is recommended to place the plugin in the plugins directory of the package
#    custom_field: "test"                                  # Custom fields, get the value of a custom field by introducing the getStorageConfigInfo method of libs/common/getStorageConfigInfo.js
#    #server: http://localhost:8088                        # Local repository download link address, not configured to take the default value of listen
##### uplink section #####
uplink_cache_path:./uplink      # Cache path, no configuration defaults to &lt;deploy_root&gt;/uplink
uplink_cache_time: 168           # Remote packet metadata cache time, in hours, default 168 hours, range (0, 8760]

##### log section #####
logs_path:./logs                # log path, no configuration defaults to &lt;deploy_root&gt;/logs

##### log level section #####
# Log Levels: In descending order, the levels are all&#12289;trace&#12289;debug&#12289;info&#12289;warn&#12289;error&#12289;fatal&#12289;mark&#12289;off
# run&#65292;operate respond in singing access Not configured or misconfigured, defaults to info
loglevel_run: info
loglevel_operate: info
loglevel_access: info
</code></code></pre><p>It includes listening ports, https configuration, the private repository deployment directory deploy_root, service-related configurations, storage configurations, logs, etc. Just configure it according to the actual situation.</p><p>Regarding the storage module:<br>The db is the configuration item for metadata storage. The db supports local storage of fileDB and storage in the mysql database.<br>The store is the configuration item for file storage. The store supports local storage, sftp storage, and custom plugin storage.</p><p><strong>Methods for Modifying the Configuration File After the Private Repository is Successfully Started</strong>:</p><ul><li><p>When starting the private repository for the first time, execute the <strong>install</strong> command to specify the configuration file: Find the specified configuration file to modify its content, then re-execute install to specify the modified configuration file, and then execute start to start the private repository.</p></li><li><p>When starting the private repository for the first time, execute the <strong>install</strong> command without specifying the configuration file: The configuration file in the conf directory under the unzipped path of the private repository compression package is used by default. Modify the content of this file, and then re-execute the install and start operations.</p></li></ul><h3><strong>Installation and Startup</strong></h3><p>Execute <code>ohpm-repo install</code> to install. After the installation is completed, set the environment variables according to the configuration. After the setting is completed, execute <code>ohpm-repo start</code> to start the service.</p><h2><strong>Using Private Repository Shared Packages</strong></h2><p>By default, the client ohpm tool only pulls dependency packages from the official public repository. To pull from a private repository, additional configuration is required. There are two configuration methods:</p><ol><li><p>Configure this private repository for all projects: <code>ohpm config set registry &lt;Configured Private Warehouse Service Address&gt;/repos/ohpm</code></p></li><li><p>Configure for a certain dependency installation: <code>ohpm install @ohos/lottie --registry &lt;Configured Private Warehouse Service Address&gt;/repos/ohpm</code></p></li></ol><p>The <strong>configured private repository service address</strong> above refers to the address information of store.config.server in the configuration file. For example, if store.config.server is </p><p>http://127.0.0.1:8088</p><p>, then the registry is: <code>http://127.0.0.1:8088/repos/ohpm</code>. If store.config.server is not configured, the default value will be taken.</p><h2><strong>Publishing Shared Packages</strong></h2><p>Locally developed shared packages, whether static shared packages or dynamic shared packages, can be published through the ohpm command tool or using the Web page. For convenience and efficiency in general development work, we usually use the command line to publish.</p><ol><li><p>Generate an ssh key locally: <code>ssh-keygen -m PEM -t RSA -b 4096 -f &lt;your_key_path&gt;</code></p></li><li><p>Log in to the ohpm-repo private repository management address, click on the personal center in the upper right corner of the home page, and add a new public key. Paste the content of the public key file (<code>&lt;your_key_path&gt;.pub</code>) into the public key input box.</p></li><li><p>Set the private key path: <code>ohpm config set key_path &lt;your_key_path&gt;</code></p></li><li><p>Log in to the ohpm-repo private repository management address, click on the personal center in the upper right corner of the home page, and copy the publishing code.</p></li><li><p>Configure the publishing code to the.ohpmrc file: <code>ohpm config set publish_id &lt;your_publish_id&gt;</code></p></li><li><p>Publish the static shared library: <code>ohpm publish demo.har</code></p></li><li><p>Publish the dynamic shared package: <code>ohpm publish demo.tgz</code></p><ol><li><p>The HSP package of the dynamic shared package cannot be directly published in the private repository and needs to be converted into a.tgz package first.</p></li><li><p>Switching the compilation mode to the release mode will package out a.taz package.</p></li></ol></li></ol><h3><strong>Module Configuration</strong></h3><p>In the library module (at the same level as the src folder), add the following files:</p><ul><li><p>Newly create a README.md file: In the README.md file, it must include the introduction and reference method of the package, and more detailed introductions can also be added according to the content of the package.</p></li><li><p>Newly create a CHANGELOG.md file: Fill in the version update record of HAR.</p></li><li><p>Add a LICENSE file: The LICENSE license file.</p></li></ul><p>The README.md file will eventually be displayed on the private repository web platform, and the dependent users can use it directly according to the description in README.md, so it is best to describe it clearly.</p><p>Explanation of the oh_package.json5 configuration file:</p><pre><code><code>{  
    "parameterFile": "../dependencies.json5",  
    "keywords": [  
        "asr"  
    ],  
    "name": "@xx/base-asr",  
    "version": "1.0.0-rc.9",  
    "repository": "http://gerrit.google.com/mobile_harmony/base_asr",  
    "description": "asr sdk",  
    "main": "Index.ets",  
    "author": "qingkouwei",  
    "license": "Apache-2.0",  
    "dependencies": {  

    }  
}
</code></code></pre><p>The module name, version number, and description must meet the requirements. Otherwise, the upload to the private repository will fail. The version number can only increase sequentially and cannot be overwritten infinitely like a SNAPSHOT in Android.</p><h2><strong>Best Practices</strong></h2><p>In the actual development process, an engineering project may have multiple SDKs. After the SDKs are developed, they need to be integrated into other engineering projects. Sometimes, when locating problems and debugging, they may need to be frequently uploaded to the private repository, and other engineering projects rely on the packaged ones for debugging. In this way, it is particularly cumbersome and inefficient to compile the SDK each time and then execute commands to upload it, especially when an engineering project has multiple SDKs and these SDKs also have dependencies.</p><p>The best way is to be able to compile and upload to the private repository with one click through scripts, and upload them one by one according to the dependency relationship. It is also possible to package and upload a certain module separately.</p><p>First, create a version.json5 to store the SDK version:</p><pre><code><code>{  
  "project": {  
    "sdk_version": "1.1.0-rc.1",  
  }  
}
</code></code></pre><p>Automatic packaging:</p><pre><code><code>def run_commands(modulename, productname):  
    hvigor_home = '/Applications/DevEco-Studio.app/Contents/tools/hvigor'  

    # Packing Command
    command1 = 'node %s/bin/hvigorw.js --mode module -p product=default -p module=%s@default -p buildMode=debug assembleHar --analyze --parallel --incremental --daemon' %(hvigor_home,modulename)  

    # Wait for the first command to complete    
    process1.wait()  

    # Upload command   
    ohpm publish productname
    process2.wait()
</code></code></pre><p>Automatically modify the version number:</p><pre><code><code>
python
def changeVersionAModule():  
    with open('version.json5', 'r') as f:  
        data = json5.load(f)  
        versionName = data['project']['sdk_version']  

        with open('AModule/oh-package.json5', 'r') as f:  
            aData = json5.load(f)  
            aData['version'] = versionName  
            with open('AModule/oh-package.json5', 'w') as f:  
                json.dump(aData, f, indent=4)  

        with open('dependencies.json5', 'r') as depf:  
            depData = json5.load(depf)  
            depData</code></code></pre><div><hr></div><p>Original source: <a href="https://dev.to/qingkouwei/harmonyos-private-repository-construction-in-practice-4p35">HarmonyOS Next Private Repository Construction in Practice - DEV Community</a></p>]]></content:encoded></item><item><title><![CDATA[HarmonyOS Next API 16 for HarmonyOS Flutter 3.22.0 is released]]></title><description><![CDATA[Welcome everyone to join the nut pie and build the HarmonyOS ecosystem, What&#8217;s new in Flutter 3.22 May 2024: WebAssembly, Graphics rendering enhancements, and more options for AI integration.]]></description><link>https://www.harmony-developers.com/p/harmonyos-next-api-16-for-harmonyos</link><guid isPermaLink="false">https://www.harmony-developers.com/p/harmonyos-next-api-16-for-harmonyos</guid><dc:creator><![CDATA[Harmony OS Developers]]></dc:creator><pubDate>Sun, 27 Apr 2025 12:40:23 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!rLtK!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2932d326-d32c-4014-84e6-f0e73449b3a6_952x720.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="native-video-embed" data-component-name="VideoPlaceholder" data-attrs="{&quot;mediaUploadId&quot;:&quot;dc632249-127c-4811-9ffb-7c2edb7bcf02&quot;,&quot;duration&quot;:null}"></div><p></p><p>Welcome everyone to join the nut pie and build the HarmonyOS ecosystem: https://gitcode.com/nutpi</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!rLtK!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2932d326-d32c-4014-84e6-f0e73449b3a6_952x720.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!rLtK!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2932d326-d32c-4014-84e6-f0e73449b3a6_952x720.png 424w, https://substackcdn.com/image/fetch/$s_!rLtK!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2932d326-d32c-4014-84e6-f0e73449b3a6_952x720.png 848w, https://substackcdn.com/image/fetch/$s_!rLtK!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2932d326-d32c-4014-84e6-f0e73449b3a6_952x720.png 1272w, https://substackcdn.com/image/fetch/$s_!rLtK!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2932d326-d32c-4014-84e6-f0e73449b3a6_952x720.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!rLtK!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2932d326-d32c-4014-84e6-f0e73449b3a6_952x720.png" width="952" height="720" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/2932d326-d32c-4014-84e6-f0e73449b3a6_952x720.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:720,&quot;width&quot;:952,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:235666,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://www.harmony-developers.com/i/162255686?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F226373dd-7607-47c1-ad63-4e66796614bf_1280x720.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!rLtK!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2932d326-d32c-4014-84e6-f0e73449b3a6_952x720.png 424w, https://substackcdn.com/image/fetch/$s_!rLtK!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2932d326-d32c-4014-84e6-f0e73449b3a6_952x720.png 848w, https://substackcdn.com/image/fetch/$s_!rLtK!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2932d326-d32c-4014-84e6-f0e73449b3a6_952x720.png 1272w, https://substackcdn.com/image/fetch/$s_!rLtK!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2932d326-d32c-4014-84e6-f0e73449b3a6_952x720.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Flutter 3.22. We&#8217;re bringing WebAssembly to the stable channel, a fully featured Vulkan backend for Impeller on Android, promising smoother graphics and a major performance boost. We&#8217;re also introducing streamlined workflows with new widget state properties, dynamic view sizing, and improved form validation. But that&#8217;s not all &#8212; you&#8217;ll find flavor-conditional asset bundling, a preview of Vertex AI for Firebase in Dart, and updated DevTools to make your life easier.</p><p>In just a few months since our last update, we&#8217;ve merged an impressive 1595 pull requests from the Flutter community, with 37 new community members contributing to Flutter for the first time!</p><p>So, dive in and discover all the new features and enhancements that the Flutter community has brought to this latest release!</p><h1><strong>WebAssembly</strong></h1><p>With the release of Flutter 3.22, Wasm is now available on the stable channel, offering significant performance improvements. In our internal benchmarks using Chrome on an M1 MacBook, the Wonderous app&#8217;s frame rendering time improved by 2x on average and 3x in worst-case scenarios.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!xkug!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F34ba975d-df93-42be-a7c8-22270295eb98_719x371.bin" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!xkug!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F34ba975d-df93-42be-a7c8-22270295eb98_719x371.bin 424w, https://substackcdn.com/image/fetch/$s_!xkug!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F34ba975d-df93-42be-a7c8-22270295eb98_719x371.bin 848w, https://substackcdn.com/image/fetch/$s_!xkug!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F34ba975d-df93-42be-a7c8-22270295eb98_719x371.bin 1272w, https://substackcdn.com/image/fetch/$s_!xkug!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F34ba975d-df93-42be-a7c8-22270295eb98_719x371.bin 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!xkug!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F34ba975d-df93-42be-a7c8-22270295eb98_719x371.bin" width="719" height="371" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/34ba975d-df93-42be-a7c8-22270295eb98_719x371.bin&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:371,&quot;width&quot;:719,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!xkug!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F34ba975d-df93-42be-a7c8-22270295eb98_719x371.bin 424w, https://substackcdn.com/image/fetch/$s_!xkug!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F34ba975d-df93-42be-a7c8-22270295eb98_719x371.bin 848w, https://substackcdn.com/image/fetch/$s_!xkug!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F34ba975d-df93-42be-a7c8-22270295eb98_719x371.bin 1272w, https://substackcdn.com/image/fetch/$s_!xkug!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F34ba975d-df93-42be-a7c8-22270295eb98_719x371.bin 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>These enhancements are vital for apps with animations and rich transitions, where maintaining a smooth frame rate is essential. Wasm helps achieve this by reducing performance bottlenecks, resulting in smoother animations and transitions. To start using Wasm with your Flutter web apps, check out our <a href="https://dart.dev/web/wasm">Dart Wasm documentation</a> and <a href="https://docs.flutter.dev/platform-integration/web/wasm">Flutter Wasm documentation</a>. For the full announcement, visit the <a href="https://medium.com/flutter/io24-5e211f708a37">Flutter at Google I/O blog post</a>.</p><h1><strong>Engine</strong></h1><p>Flutter 3.22 introduces significant updates to Impeller, the rendering engine that powers your Flutter applications. Key highlights include the completion of the Vulkan backend on Android for smoother graphics and improved performance, ongoing optimizations for blur effects and complex path rendering, and a new experimental API for testing with Impeller. In line with our <a href="https://github.com/flutter/flutter/wiki/Roadmap#core-framework--engine">roadmap</a>, we&#8217;re committed to enhancing Impeller&#8217;s quality and performance, including completing the iOS migration to Impeller and expanding Android support.</p><h2><strong>Impeller</strong></h2><h2><strong>Vulkan backend feature complete on Android</strong></h2><p>In this release, Impeller&#8217;s Vulkan backend for Android is feature complete. In particular, in the past few months, the team has been hard at work completing the implementation of <a href="https://github.com/flutter/engine/pull/50154">fast advanced blends</a>, support for custom fragment shaders with the <a href="https://github.com/flutter/engine/pull/49543">FragmentProgram API</a>, <a href="https://github.com/flutter/engine/pull/50730">PlatformView</a> support (though it requires a <a href="https://docs.flutter.dev/release/breaking-changes/android-surface-plugins">small API migration</a>), and fully implementing <a href="https://github.com/flutter/flutter/issues/134178">all blur styles</a>.</p><h2><strong>Android preview</strong></h2><p>In the 3.19 stable release, after releasing improvements in Impeller&#8217;s OpenGL backend, we invited users to try out Impeller on Android devices both with and without Vulkan support. Over the past few months, after evaluating the performance of the OpenGL backend and estimating the remaining work on the Vulkan backend, we have decided to focus our efforts on making the Vulkan backend production ready first.</p><p>Impeller solves the issue of shader compilation jank. Additionally, in our benchmarks it outperforms the legacy renderer on average, 90th, and 99th percentile frame times. We therefore believe that the performance of the Vulkan backend on Android is acceptable. In this release (3.22), an app that opts-in to Impeller will use the Vulkan backend where available. In a future release, this will become the default. When an app that opts-in to Impeller runs on a device that doesn&#8217;t support Vulkan, Flutter will gracefully fall back automatically to using OpenGL ES with Skia. No action is necessary on your part. In the future, when we believe the OpenGL ES Impeller backend is production ready, this fallback will also use Impeller.</p><p>As the Impeller preview on Android continues through the 3.22 stable cycle, we request that Flutter developers upgrade to the latest stable version, and file issues about any shortcomings noticed when <a href="https://docs.flutter.dev/perf/impeller#android">Impeller is enabled</a>. Feedback at this stage is invaluable to ensuring that Impeller is successful on Android and that we will be able to confidently make it the default renderer in a release later this year. The Android hardware ecosystem is very diverse. For that reason, the most helpful feedback about Impeller should include detailed information about the specific device and Android version where issues occurred.</p><h2><strong>Blur performance improvements</strong></h2><p>Blur has been <a href="https://github.com/flutter/engine/pull/47576">reimplemented</a> in Impeller for both iOS and Android. In particular, the new approach, which is similar to Skia&#8217;s, reduces the CPU and GPU time of blurs by nearly half in <a href="https://flutter-flutter-perf.skia.org/e/?begin=1699468487&amp;end=1710262311&amp;keys=X01fc3d52ebd6fbf38afef91d82ab8d2b&amp;requestType=0&amp;selected=commit%3D38815%26name%3D%252Carch%253Dintel%252Cbranch%253Dmaster%252Cconfig%253Ddefault%252Cdevice_type%253DiPhone_11%252Cdevice_version%253Dnone%252Chost_type%253Dmac%252Csub_result%253Daverage_frame_rasterizer_time_millis%252Ctest%253Dbackdrop_filter_perf_ios__timeline_summary%252C&amp;xbaroffset=38815">benchmarks</a>.</p><p>The chart below shows worst-case, 99%-ile, 90%-ile, and average frame rasterization times and GPU frame times in ms on an iPhone 11 device in a pathological benchmark intended to highlight blur performance. After rewriting Impeller&#8217;s blur, both the CPU and GPU cost of backdrop filter blurs has been nearly halved. This scale of this improvement translates to non-pathological cases as well, as would appear in typical apps.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!R8Ru!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe21ac66d-72c4-4fa7-ab7a-76d7a2e244bb_875x515.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!R8Ru!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe21ac66d-72c4-4fa7-ab7a-76d7a2e244bb_875x515.png 424w, https://substackcdn.com/image/fetch/$s_!R8Ru!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe21ac66d-72c4-4fa7-ab7a-76d7a2e244bb_875x515.png 848w, https://substackcdn.com/image/fetch/$s_!R8Ru!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe21ac66d-72c4-4fa7-ab7a-76d7a2e244bb_875x515.png 1272w, https://substackcdn.com/image/fetch/$s_!R8Ru!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe21ac66d-72c4-4fa7-ab7a-76d7a2e244bb_875x515.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!R8Ru!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe21ac66d-72c4-4fa7-ab7a-76d7a2e244bb_875x515.png" width="875" height="515" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e21ac66d-72c4-4fa7-ab7a-76d7a2e244bb_875x515.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:515,&quot;width&quot;:875,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!R8Ru!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe21ac66d-72c4-4fa7-ab7a-76d7a2e244bb_875x515.png 424w, https://substackcdn.com/image/fetch/$s_!R8Ru!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe21ac66d-72c4-4fa7-ab7a-76d7a2e244bb_875x515.png 848w, https://substackcdn.com/image/fetch/$s_!R8Ru!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe21ac66d-72c4-4fa7-ab7a-76d7a2e244bb_875x515.png 1272w, https://substackcdn.com/image/fetch/$s_!R8Ru!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe21ac66d-72c4-4fa7-ab7a-76d7a2e244bb_875x515.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">99%-ile, 90%-ile and average frame rasterization times and GPU frame times in ms on an iPhone 11 device in a pathological benchmark intended to highlight blur performance</figcaption></figure></div><h2><strong>Stencil-then-Cover</strong></h2><p>Impeller on both iOS and Android has <a href="https://github.com/flutter/engine/pull/51219">moved to a new rendering strategy</a> based on the Stencil-then-Cover approach described in the chapter &#8220;Drawing Filled, Concave Polygons Using the Stencil Buffer&#8221; in the <a href="http://www.opengl-redbook.com/">OpenGL Redbook</a>. Team members discussed more on this technique as it applies to Flutter in GitHub issue <a href="https://github.com/flutter/flutter/issues/123671">#123671</a>.</p><p>This approach solves the issue where the raster thread was spending too much time calculating tessellations for complex paths on the CPU for example, SVGs and <a href="https://github.com/flutter/flutter/issues/141961">Lottie animations</a>. After the change, the total frame time (UI thread on the CPU + raster thread on the CPU + GPU work) is much lower for frames that contain complex paths. Users will notice that Lottie animations and other complex paths render more smoothly, with lower CPU utilization, and slightly higher GPU utilization.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!nvZ7!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feb67184b-1cbb-49bc-ae77-e72d137d15ae_1280x1280.gif" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!nvZ7!,w_424,c_limit,f_webp,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feb67184b-1cbb-49bc-ae77-e72d137d15ae_1280x1280.gif 424w, https://substackcdn.com/image/fetch/$s_!nvZ7!,w_848,c_limit,f_webp,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feb67184b-1cbb-49bc-ae77-e72d137d15ae_1280x1280.gif 848w, https://substackcdn.com/image/fetch/$s_!nvZ7!,w_1272,c_limit,f_webp,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feb67184b-1cbb-49bc-ae77-e72d137d15ae_1280x1280.gif 1272w, https://substackcdn.com/image/fetch/$s_!nvZ7!,w_1456,c_limit,f_webp,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feb67184b-1cbb-49bc-ae77-e72d137d15ae_1280x1280.gif 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!nvZ7!,w_1456,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feb67184b-1cbb-49bc-ae77-e72d137d15ae_1280x1280.gif" width="1280" height="1280" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/eb67184b-1cbb-49bc-ae77-e72d137d15ae_1280x1280.gif&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1280,&quot;width&quot;:1280,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!nvZ7!,w_424,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feb67184b-1cbb-49bc-ae77-e72d137d15ae_1280x1280.gif 424w, https://substackcdn.com/image/fetch/$s_!nvZ7!,w_848,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feb67184b-1cbb-49bc-ae77-e72d137d15ae_1280x1280.gif 848w, https://substackcdn.com/image/fetch/$s_!nvZ7!,w_1272,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feb67184b-1cbb-49bc-ae77-e72d137d15ae_1280x1280.gif 1272w, https://substackcdn.com/image/fetch/$s_!nvZ7!,w_1456,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feb67184b-1cbb-49bc-ae77-e72d137d15ae_1280x1280.gif 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">(Left) A Lottie animation. Previously, Impeller on a recent iPhone took 64ms / frame of raster thread CPU time to render it. (Right) The same animation on the same device after we landed the Stencil-then-Cover optimization. Raster times are nearly 10x faster.</figcaption></figure></div><p>While pleased with these improvements, there is still more work to do. Among other opportunities, we are aware that polyline generation remains prominent in CPU profiles, and we intend to investigate shifting this work to the GPU, as well.</p><h2><strong>New API</strong></h2><p>While still experimental, flutter test now accepts the <code>--enable-impeller </code>flag, which exercises Impeller using the Vulkan backend.</p><h1><strong>Framework</strong></h1><h2><strong>Widget state properties</strong></h2><p><code>MaterialState</code> has been moved outside of the Material library and renamed <code>WidgetState</code>, in order to make it available to Cupertino, the base Flutter framework, and package authors. For more information on migrating to the new WidgetState, see the <a href="https://docs.flutter.dev/release/breaking-changes/material-state">migration guide</a>.</p><h2><strong>Dynamic view sizing</strong></h2><p><a href="https://github.com/flutter/flutter/pull/140918">Enhancements</a> to dynamic view sizing benefits developers building responsive layouts, ensuring better UI adaptability across various device screens.</p><h2><strong>Improved form validation</strong></h2><p>Thanks to the <a href="https://github.com/flutter/flutter/pull/135578">contributions</a> of Flutter community member <a href="https://github.com/SharbelOkzan">SharbelOkzan</a>, Flutter 3.22 comes with more flexible form validation methods allowing developers to create more robust user input handling, enhancing both usability and security.</p><h2><strong>Covariants in 2D APIs</strong></h2><p>Reducing the need for type casts in 2D graphics APIs simplifies development workflows and enhances performance, important for games and complex animations.</p><h2><strong>Flavor-conditional asset bundling</strong></h2><p>Developers using the <a href="https://docs.flutter.dev/deployment/flavors">flavors</a> feature can now configure individual assets to be bundled only when building for a specific flavor. For more information, check out <a href="https://docs.flutter.dev/deployment/flavors#conditionally-bundling-assets-based-on-flavor">Conditionally bundling assets based on flavor</a>.</p><h2><strong>Transformation of assets using Dart packages</strong></h2><p>Users can now configure Dart packages to transform their app&#8217;s assets as they are bundled. For more information, check out <a href="http://docs.flutter.dev/ui/assets/asset-transformation">Transforming assets at built time</a>.</p><h1><strong>Android</strong></h1><h2><strong>Deep linking</strong></h2><p>Deep links can significantly improve the user experience in your Flutter app, acting as shortcuts that seamlessly guide users to specific content within your app, boosting engagement, and driving sales. While Universal Links for iOS and App Links for Android are highly recommended for their security and user-friendly nature, setting them up can be a bit tricky.</p><p>In the last Flutter stable release, we introduced a deep link validator tool within DevTools that supports checking web configuration for Android apps. In this version, we added a new set of features to help verify setups within your Android manifest files.</p><p>For more information on using this tool, check out <a href="https://docs.flutter.dev/tools/devtools/deep-links">Validate deep links</a>.</p><h2><strong>Predictive back gesture</strong></h2><p>Flutter now adds more support for Android&#8217;s upcoming predictive back feature, where users can peek at the previous route or even the previous app during a back gesture. This is still behind a feature flag on Android devices, but you can find details on how to try it out yourself <a href="https://github.com/flutter/flutter/issues/132504#issuecomment-2025776552">on GitHub</a>.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!gHl6!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F161c5a90-37c0-4e82-b518-42a593d81ab3_400x888.bin" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!gHl6!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F161c5a90-37c0-4e82-b518-42a593d81ab3_400x888.bin 424w, https://substackcdn.com/image/fetch/$s_!gHl6!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F161c5a90-37c0-4e82-b518-42a593d81ab3_400x888.bin 848w, https://substackcdn.com/image/fetch/$s_!gHl6!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F161c5a90-37c0-4e82-b518-42a593d81ab3_400x888.bin 1272w, https://substackcdn.com/image/fetch/$s_!gHl6!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F161c5a90-37c0-4e82-b518-42a593d81ab3_400x888.bin 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!gHl6!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F161c5a90-37c0-4e82-b518-42a593d81ab3_400x888.bin" width="400" height="888" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/161c5a90-37c0-4e82-b518-42a593d81ab3_400x888.bin&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:888,&quot;width&quot;:400,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!gHl6!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F161c5a90-37c0-4e82-b518-42a593d81ab3_400x888.bin 424w, https://substackcdn.com/image/fetch/$s_!gHl6!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F161c5a90-37c0-4e82-b518-42a593d81ab3_400x888.bin 848w, https://substackcdn.com/image/fetch/$s_!gHl6!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F161c5a90-37c0-4e82-b518-42a593d81ab3_400x888.bin 1272w, https://substackcdn.com/image/fetch/$s_!gHl6!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F161c5a90-37c0-4e82-b518-42a593d81ab3_400x888.bin 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!B-oH!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdb08822d-9cf1-4979-a7c0-38e37114f22e_400x894.bin" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!B-oH!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdb08822d-9cf1-4979-a7c0-38e37114f22e_400x894.bin 424w, https://substackcdn.com/image/fetch/$s_!B-oH!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdb08822d-9cf1-4979-a7c0-38e37114f22e_400x894.bin 848w, https://substackcdn.com/image/fetch/$s_!B-oH!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdb08822d-9cf1-4979-a7c0-38e37114f22e_400x894.bin 1272w, https://substackcdn.com/image/fetch/$s_!B-oH!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdb08822d-9cf1-4979-a7c0-38e37114f22e_400x894.bin 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!B-oH!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdb08822d-9cf1-4979-a7c0-38e37114f22e_400x894.bin" width="400" height="894" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/db08822d-9cf1-4979-a7c0-38e37114f22e_400x894.bin&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:894,&quot;width&quot;:400,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!B-oH!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdb08822d-9cf1-4979-a7c0-38e37114f22e_400x894.bin 424w, https://substackcdn.com/image/fetch/$s_!B-oH!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdb08822d-9cf1-4979-a7c0-38e37114f22e_400x894.bin 848w, https://substackcdn.com/image/fetch/$s_!B-oH!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdb08822d-9cf1-4979-a7c0-38e37114f22e_400x894.bin 1272w, https://substackcdn.com/image/fetch/$s_!B-oH!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdb08822d-9cf1-4979-a7c0-38e37114f22e_400x894.bin 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h2><strong>Flutter tool enforces version requirements on Gradle, AGP, Java, and Kotlin</strong></h2><p>In this release, the Flutter tool enforces a policy regarding the versions that it supports for Gradle, the Android Gradle Plugin (AGP), Java, and Kotlin. Initially, the tool only provides warnings.</p><p>Currently, the supported version ranges are as follows:</p><ul><li><p>Gradle &#8212; Fully supported 7.0.2 to current, warn otherwise</p></li><li><p>AGP &#8212; Fully supported 7.0.0 to current, warn otherwise</p></li><li><p>Java &#8212; Fully supported Java 11 to current, warn otherwise</p></li><li><p>Kotlin &#8212; Fully supported 1.5.0 to current, warn otherwise</p></li></ul><p>In the next major release these warnings will become errors, which can be overridden with the flag <code>--android-skip-build-dependency-validation</code>. More generally speaking, the tool provides a warning for at least one release before fully dropping support (generating an error) for a given version of these dependencies.</p><p>This policy was discussed in an <a href="https://docs.google.com/document/d/1qeeM5QG-jiafttSgvc7yvC19IDRggFFZQTktBVxL6sI/edit?resourcekey=0-HLEAiBOMxAlQxDs-mEeffw">associated design spec</a>. Comments and feedback are always welcome.</p><h2><strong>Support for using Gradle Kotlin DSL in Gradle build scripts on Android</strong></h2><p>Gradle Kotlin DSL is now supported in Flutter, providing an alternative to the traditional Gradle Groovy DSL. This support allows for a better code editing experience, featuring auto-completion, quick access to documentation, source navigation, and context-aware refactoring.</p><p>This initial support was contributed by GitHub user <a href="https://github.com/bartekpacia">bartekpacia</a>. Developers can now choose to rewrite their Gradle build scripts in Kotlin to take advantage of these benefits, although the Flutter tool doesn&#8217;t yet allow for selecting Kotlin over Groovy when using <code>flutter create</code>.</p><p>For more details, check out the <a href="https://github.com/flutter/flutter/pull/140744">PR 140744</a> by <a href="https://github.com/bartekpacia">bartekpacia</a>.</p><h2><strong>Platform views improvements</strong></h2><p><strong>Heads up for all Flutter app developers</strong>! If you&#8217;re using Flutter to build apps that rely on native Android components (like maps, web views, or certain UI elements), we have some important news.</p><p>Due to a bug in Android 14, apps built with older versions of Flutter might not work properly on devices running this new Android version.</p><p>Flutter 3.22 fixes this issue and improves the overall performance of these native components in your Android apps. So, to ensure your app runs smoothly on all Android devices, make sure to rebuild and release your app with Flutter 3.22.</p><p>This update also includes behind-the-scenes improvements to make platform views on Android more reliable and performant overall.</p><h2><strong>End of support for KitKat</strong></h2><p>Flutter&#8217;s minimum supported Android version is now Lollipop (API 21). Beginning with Flutter&#8217;s 3.22 stable release, Flutter will no longer work on devices running Android KitKat (API 19). For more details, see our <a href="https://docs.flutter.dev/release/breaking-changes/android-kitkat-deprecation">deprecation guide</a>.</p><h1><strong>iOS</strong></h1><h2><strong>Platform view performance</strong></h2><p>We understand that platform view performance on iOS has been a pain point for many Flutter developers. This has been especially noticeable within scroll views when using platform views.</p><p>Recent updates directly address these concerns, with significant improvements in scenarios like embedding multiple inline ads within an article. Here are some key improvements <a href="https://github.com/flutter/flutter/pull/144745">in our benchmark</a>:</p><ul><li><p><strong>Reduced GPU usage:</strong> GPU usage has been reduced by 50%, leading to less power consumption and a potentially smoother user experience.</p></li><li><p><strong>Improved frame rendering: </strong>Average frame render times have decreased by 1.66ms (33%).</p></li><li><p><strong>Minimized jank: </strong>Worst-case frame render times have been reduced by 3.8ms (21%).</p></li></ul><p>If you&#8217;ve previously experienced performance challenges when using multiple platform views (like ads, maps, etc) within scrolling views, these optimizations offer the potential for a more fluid and responsive scrolling experience. Please give it a try and let us know what you think.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!20mq!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F06504736-de3d-45cd-b540-1529d153d8cb_875x361.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!20mq!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F06504736-de3d-45cd-b540-1529d153d8cb_875x361.png 424w, https://substackcdn.com/image/fetch/$s_!20mq!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F06504736-de3d-45cd-b540-1529d153d8cb_875x361.png 848w, https://substackcdn.com/image/fetch/$s_!20mq!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F06504736-de3d-45cd-b540-1529d153d8cb_875x361.png 1272w, https://substackcdn.com/image/fetch/$s_!20mq!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F06504736-de3d-45cd-b540-1529d153d8cb_875x361.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!20mq!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F06504736-de3d-45cd-b540-1529d153d8cb_875x361.png" width="875" height="361" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/06504736-de3d-45cd-b540-1529d153d8cb_875x361.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:361,&quot;width&quot;:875,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!20mq!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F06504736-de3d-45cd-b540-1529d153d8cb_875x361.png 424w, https://substackcdn.com/image/fetch/$s_!20mq!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F06504736-de3d-45cd-b540-1529d153d8cb_875x361.png 848w, https://substackcdn.com/image/fetch/$s_!20mq!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F06504736-de3d-45cd-b540-1529d153d8cb_875x361.png 1272w, https://substackcdn.com/image/fetch/$s_!20mq!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F06504736-de3d-45cd-b540-1529d153d8cb_875x361.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!I8ED!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa107b732-a651-4820-bcd8-8b72113f8471_875x539.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!I8ED!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa107b732-a651-4820-bcd8-8b72113f8471_875x539.png 424w, https://substackcdn.com/image/fetch/$s_!I8ED!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa107b732-a651-4820-bcd8-8b72113f8471_875x539.png 848w, https://substackcdn.com/image/fetch/$s_!I8ED!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa107b732-a651-4820-bcd8-8b72113f8471_875x539.png 1272w, https://substackcdn.com/image/fetch/$s_!I8ED!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa107b732-a651-4820-bcd8-8b72113f8471_875x539.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!I8ED!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa107b732-a651-4820-bcd8-8b72113f8471_875x539.png" width="875" height="539" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a107b732-a651-4820-bcd8-8b72113f8471_875x539.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:539,&quot;width&quot;:875,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!I8ED!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa107b732-a651-4820-bcd8-8b72113f8471_875x539.png 424w, https://substackcdn.com/image/fetch/$s_!I8ED!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa107b732-a651-4820-bcd8-8b72113f8471_875x539.png 848w, https://substackcdn.com/image/fetch/$s_!I8ED!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa107b732-a651-4820-bcd8-8b72113f8471_875x539.png 1272w, https://substackcdn.com/image/fetch/$s_!I8ED!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa107b732-a651-4820-bcd8-8b72113f8471_875x539.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h1><strong>Ecosystem</strong></h1><h2><strong>Vertex AI for Firebase Dart SDK preview release</strong></h2><p>The Vertex AI for Firebase product has been released to public preview and includes the Dart SDK. This enables you to use the Gemini API to build generative AI features for your Dart or Flutter app, with production, performance and enterprise scale in mind. The SDK is integrated with <a href="https://firebase.google.com/docs/app-check">Firebase App Check</a>, which protects your API calls, and safeguards your backend infrastructure from serious threats like billing fraud, phishing, and app impersonation. Jump into the <a href="https://firebase.google.com/docs/vertex-ai/get-started?platform=flutter">Getting Started for Dart</a> and start using it with no cost with a promo code</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!nON0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fff91254a-a86f-467c-8eb1-021ea1d627ac_875x236.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!nON0!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fff91254a-a86f-467c-8eb1-021ea1d627ac_875x236.png 424w, https://substackcdn.com/image/fetch/$s_!nON0!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fff91254a-a86f-467c-8eb1-021ea1d627ac_875x236.png 848w, https://substackcdn.com/image/fetch/$s_!nON0!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fff91254a-a86f-467c-8eb1-021ea1d627ac_875x236.png 1272w, https://substackcdn.com/image/fetch/$s_!nON0!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fff91254a-a86f-467c-8eb1-021ea1d627ac_875x236.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!nON0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fff91254a-a86f-467c-8eb1-021ea1d627ac_875x236.png" width="875" height="236" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ff91254a-a86f-467c-8eb1-021ea1d627ac_875x236.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:236,&quot;width&quot;:875,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!nON0!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fff91254a-a86f-467c-8eb1-021ea1d627ac_875x236.png 424w, https://substackcdn.com/image/fetch/$s_!nON0!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fff91254a-a86f-467c-8eb1-021ea1d627ac_875x236.png 848w, https://substackcdn.com/image/fetch/$s_!nON0!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fff91254a-a86f-467c-8eb1-021ea1d627ac_875x236.png 1272w, https://substackcdn.com/image/fetch/$s_!nON0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fff91254a-a86f-467c-8eb1-021ea1d627ac_875x236.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>The <a href="https://ai.google.dev/gemini-api/docs/get-started/dart">Google AI Dart SDK</a> remains available, and is recommended for prototyping only. Google AI has free-of-charge access (within limits and where available) and pay-as-you-go pricing. If you have been prototyping with the Google AI Dart SDK, and are ready to migrate to Vertex AI for Firebase, check out the <a href="https://firebase.google.com/docs/vertex-ai/migrate-to-vertex-ai?platform=flutter">migration guide</a>.</p><h2><strong>DevTools updates</strong></h2><p>We continue to improve DevTools, the suite of performance and debugging tools for Dart and Flutter. This release includes performance improvements, general polish, and new features like including CPU samples in the timeline, advanced filtering, and support for importing and exporting memory snapshots.</p><p>Other notable improvements were shipped with the <code>devtools_extensions</code> and <code>devtools_app_shared</code> packages that support DevTools extension authors. We added support for connecting an extension to the new Dart Tooling Daemon (DTD), which allows DevTools extensions to access public methods registered by other DTD clients, such as an IDE, as well as allowing access to a minimal file system API for interacting with the development project.</p><p>To learn more about all the updates included in Flutter 3.22 check out the release notes for DevTools <a href="https://docs.flutter.dev/tools/devtools/release-notes/release-notes-2.32.0">2.32.0</a>, <a href="https://docs.flutter.dev/tools/devtools/release-notes/release-notes-2.33.0">2.33.0</a>, and <a href="https://docs.flutter.dev/tools/devtools/release-notes/release-notes-2.34.1">2.34.1</a>.</p><h2><strong>Google Mobile Ads SDK for Flutter</strong></h2><p>For those of you monetizing your Flutter apps with Ads, we&#8217;ve got some exciting news: Google Mobile Ads for Flutter has just released a major update to version 5.0.1!</p><p><strong>Enhanced support for User Messaging Platform (UMP) SDK: </strong>The update adds support for the latest APIs from the Android UMP SDK version 2.2.0 and iOS UMP SDK version 2.4.0. The UMP SDK is crucial for complying with privacy regulations, making it easier for you to obtain user consent for personalized ads. This new version introduces several new APIs to simplify the consent gathering process.</p><p><strong>Expanded mediation partners:</strong> We&#8217;ve broadened your ad monetization horizons by offering integrations with popular ad partners, including <a href="https://pub.dev/packages/gma_mediation_unity">Unity</a>, <a href="https://pub.dev/packages/gma_mediation_meta">Meta</a>, <a href="https://pub.dev/packages/gma_mediation_applovin">AppLovin</a>, <a href="https://pub.dev/packages/gma_mediation_ironsource">Iron Source</a>, <a href="https://pub.dev/packages/gma_mediation_mintegral">Mintegral</a>, <a href="https://pub.dev/packages/gma_mediation_pangle">Pangle</a>, <a href="https://pub.dev/packages/gma_mediation_dtexchange">DT Exchange</a>, <a href="https://pub.dev/packages/gma_mediation_inmobi">InMobi</a>, and<a href="https://pub.dev/packages/gma_mediation_liftoffmonetize"> Liftoff.</a> You can now maximize your app revenue with expanded mediation options and simplified implementation.</p><p>We encourage you to try out these new features in your Flutter apps and let us know which other mediation partners you&#8217;d like to see us support. Your feedback is invaluable as we continue to enhance the Google Mobile Ads SDK for Flutter.</p><h1><strong>Breaking Changes and Deprecations</strong></h1><h2><strong>Removal of v1 Android embedding</strong></h2><p>Deletion of version one of the Android embedding is under way. This will likely have no effect on most apps, as</p><ol><li><p>Version two has been the default for many years</p></li><li><p>The Flutter tool would already block building version one apps, unless specifically overridden with the flag<code> -- ignore-deprecation</code>.</p></li></ol><p>This release breaks Flutter tool support for v1 apps completely. <strong>It is no longer possible to override.</strong></p><p><strong>Plugin authors, please note</strong>: when the v1 android embedding was initially deprecated a migration doc was written for plugin authors at <a href="https://docs.flutter.dev/release/breaking-changes/plugin-api-migration">https://docs.flutter.dev/release/breaking-changes/plugin-api-migration</a>. As part of this migration, it was recommended that plugin authors keep support for apps using the v1 embedding, by including in their <code>*Plugin.java</code> a method with the signature</p><p><code>public static void registerWith(@NonNull io.flutter.plugin.common.PluginRegistry.Registrar registrar)</code></p><p>We plan to fully delete the v1 Android embedding in the next release, <strong>at which point plugins that include a method with this signature will no longer compile</strong> (as it makes reference to a type from the v1 android embedding).</p><p>It currently serves no purpose, as this release has broken apps using the v1 embedding. We recommend that plugin authors release updated versions of their plugins with the v1 code removed as soon as possible, to avoid breakage in future versions of Flutter. For an example, check out <a href="https://github.com/flutter/packages/pull/6494">PR 6494</a>, which removed the plugins maintained by the Flutter team.</p><h2><strong>Deprecations removed in 3.22</strong></h2><p><a href="https://docs.flutter.dev/release/breaking-changes">Breaking changes</a> in this release include deprecated APIs that expired after the release of v3.19. To see all affected APIs, along with additional context and migration guidance, see the <a href="https://docs.flutter.dev/release/breaking-changes/3-19-deprecations">deprecation guide for this release</a>. Many of these are supported by <a href="https://docs.flutter.dev/development/tools/flutter-fix">Flutter fix</a>, including quick fixes in the IDE. Bulk fixes can be evaluated and applied with the <code>dart fix</code> command-line tool.</p><p>As always, many thanks to the community for <a href="https://github.com/flutter/tests/blob/master/README.md">contributing tests</a> &#8212; these help us identify these breaking changes. To learn more, check out <a href="https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes">Flutter&#8217;s breaking change policy</a>.</p><h1><strong>Conclusion</strong></h1><p>At the heart of Flutter&#8217;s success is you &#8212; our amazing community. This release wouldn&#8217;t be possible without your countless contributions and unwavering passion. From the bottom of our hearts, thank you.</p><p>Ready to explore Flutter 3.22? Dive into the full release notes and changelog, fire up your terminal, and run <code>flutter upgrade</code>. We can&#8217;t wait to see what you build!</p><p>HarmonyOS Next API 16 for HarmonyOS Flutter 3.22.0 is released</p><p>Welcome everyone to join the nut pie and build the HarmonyOS ecosystem: https://gitcode.com/nutpi</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://groups.google.com/g/flutter-announce/c/Bfo_SgCKTKw?pli=1" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!J0am!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8441bb07-1c4f-4157-a38c-6c143f8aa94c_1280x281.png 424w, https://substackcdn.com/image/fetch/$s_!J0am!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8441bb07-1c4f-4157-a38c-6c143f8aa94c_1280x281.png 848w, https://substackcdn.com/image/fetch/$s_!J0am!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8441bb07-1c4f-4157-a38c-6c143f8aa94c_1280x281.png 1272w, https://substackcdn.com/image/fetch/$s_!J0am!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8441bb07-1c4f-4157-a38c-6c143f8aa94c_1280x281.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!J0am!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8441bb07-1c4f-4157-a38c-6c143f8aa94c_1280x281.png" width="1280" height="281" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/8441bb07-1c4f-4157-a38c-6c143f8aa94c_1280x281.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:281,&quot;width&quot;:1280,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:149643,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:&quot;https://groups.google.com/g/flutter-announce/c/Bfo_SgCKTKw?pli=1&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.harmony-developers.com/i/162255686?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8441bb07-1c4f-4157-a38c-6c143f8aa94c_1280x281.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!J0am!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8441bb07-1c4f-4157-a38c-6c143f8aa94c_1280x281.png 424w, https://substackcdn.com/image/fetch/$s_!J0am!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8441bb07-1c4f-4157-a38c-6c143f8aa94c_1280x281.png 848w, https://substackcdn.com/image/fetch/$s_!J0am!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8441bb07-1c4f-4157-a38c-6c143f8aa94c_1280x281.png 1272w, https://substackcdn.com/image/fetch/$s_!J0am!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8441bb07-1c4f-4157-a38c-6c143f8aa94c_1280x281.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p></p><p>Flutter 3.22.1 to the stable channel; This hotfix release addresses the following issues:</p><p>dart/55714 - Fixes a bug in the CFE which could manifest as compilation errors of Flutter web apps when compiled with dart2wasm.</p><p>dart/55758 - Fixes a bug in the pub client, such that dart run will not interfere with Flutter l10n (at least for most cases).</p><p>What&#8217;s new in Flutter 3.22</p><p>WebAssembly, Graphics rendering enhancements, and more options for AI integration - Flutter app framework development up to May 2024 <a href="https://medium.com/flutter/whats-new-in-flutter-3-22-fbde6c164fe3">https://medium.com/flutter/whats-new-in-flutter-3-22-fbde6c164fe3 </a></p><p>3.29.2[2] Edit this on Wikidata / 13 March 2025; 40 days ago current version <a href="https://en.wikipedia.org/wiki/Flutter_(software)">https://en.wikipedia.org/wiki/Flutter_(software)</a></p>]]></content:encoded></item><item><title><![CDATA[A beginner's guide to HarmonyOS for Android developers ]]></title><description><![CDATA[This article is for Android developers]]></description><link>https://www.harmony-developers.com/p/a-beginners-guide-to-harmonyos-for</link><guid isPermaLink="false">https://www.harmony-developers.com/p/a-beginners-guide-to-harmonyos-for</guid><dc:creator><![CDATA[Benjamin Akhigbe]]></dc:creator><pubDate>Mon, 14 Apr 2025 21:04:37 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!FPG-!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F41b5caee-0b06-4da6-93c2-d5fd5423e80d_1094x693.webp" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h1>Be prepared and careful</h1><p>This article is for <strong>Android developers</strong>, so I won't go into the basics, and you can check out the documentation.<code>&#21326;&#20026;&#24320;&#21457;&#32773;&#32852;&#30431;</code></p><blockquote><p>The following content is based on the <strong>HarmonyOS</strong> development environment (DevEco Studio, HarmonyOS SDK).</p><p>The DevEco Studio application signature is bound to a HUAWEI ID, so you need to register a HUAWEI ID before you start (a prompt will be displayed if it fails to run for the first time).</p><p>To run <strong>a HarmonyOS</strong> project, you need a HarmonyOS phone; (At present, only Mate 50 and 60 series mobile phones can be used normally, other models need to use the screen projection tool to operate, and it will be stuck when operated directly on the mobile phone);</p></blockquote><h1>Let's start with Hello World</h1><h2>DevEco Studio</h2><p><strong>Android</strong> development is developed using <strong>Android Studio</strong>, and <strong>HarmonyOS</strong> also provides a <strong>DevEco Studio</strong> development tool, which is also developed based on <strong>IDEA</strong>, so the functional interface and <strong>Android Studio</strong> are available It's pretty much the same, it's easy to get started, and you can select the official template library from the menu and download it to run locally.<code>Import Sample</code></p><p>Download the tool: <a href="https://link.juejin.cn?target=https%3A%2F%2Flinks.jianshu.com%2Fgo%3Fto%3Dhttps%253A%252F%252Fdeveloper.huawei.com%252Fconsumer%252Fcn%252Fdeveco-studio%252F">Download and upgrade the HUAWEI DevEco Studio and SDK | Huawei Developer Alliance</a></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!FPG-!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F41b5caee-0b06-4da6-93c2-d5fd5423e80d_1094x693.webp" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!FPG-!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F41b5caee-0b06-4da6-93c2-d5fd5423e80d_1094x693.webp 424w, https://substackcdn.com/image/fetch/$s_!FPG-!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F41b5caee-0b06-4da6-93c2-d5fd5423e80d_1094x693.webp 848w, https://substackcdn.com/image/fetch/$s_!FPG-!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F41b5caee-0b06-4da6-93c2-d5fd5423e80d_1094x693.webp 1272w, https://substackcdn.com/image/fetch/$s_!FPG-!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F41b5caee-0b06-4da6-93c2-d5fd5423e80d_1094x693.webp 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!FPG-!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F41b5caee-0b06-4da6-93c2-d5fd5423e80d_1094x693.webp" width="1094" height="693" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/41b5caee-0b06-4da6-93c2-d5fd5423e80d_1094x693.webp&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:693,&quot;width&quot;:1094,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;img&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="img" title="img" srcset="https://substackcdn.com/image/fetch/$s_!FPG-!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F41b5caee-0b06-4da6-93c2-d5fd5423e80d_1094x693.webp 424w, https://substackcdn.com/image/fetch/$s_!FPG-!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F41b5caee-0b06-4da6-93c2-d5fd5423e80d_1094x693.webp 848w, https://substackcdn.com/image/fetch/$s_!FPG-!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F41b5caee-0b06-4da6-93c2-d5fd5423e80d_1094x693.webp 1272w, https://substackcdn.com/image/fetch/$s_!FPG-!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F41b5caee-0b06-4da6-93c2-d5fd5423e80d_1094x693.webp 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h2>Create a project</h2><p>Click on the welcome screen, the process of creating a new project is also similar to <strong>Android Studio</strong>, the UI component here is similar <strong>to Android ,</strong> which is used to provide UI display and life cycle callbacks, here we simply use the default template to create a <strong>Demo</strong> project;<code>Create ProjectAbilityActivity</code></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!STzk!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1ad5dbf2-67c6-410e-9aa8-19b86a47b30b_980x655.webp" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!STzk!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1ad5dbf2-67c6-410e-9aa8-19b86a47b30b_980x655.webp 424w, https://substackcdn.com/image/fetch/$s_!STzk!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1ad5dbf2-67c6-410e-9aa8-19b86a47b30b_980x655.webp 848w, https://substackcdn.com/image/fetch/$s_!STzk!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1ad5dbf2-67c6-410e-9aa8-19b86a47b30b_980x655.webp 1272w, https://substackcdn.com/image/fetch/$s_!STzk!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1ad5dbf2-67c6-410e-9aa8-19b86a47b30b_980x655.webp 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!STzk!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1ad5dbf2-67c6-410e-9aa8-19b86a47b30b_980x655.webp" width="980" height="655" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1ad5dbf2-67c6-410e-9aa8-19b86a47b30b_980x655.webp&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:655,&quot;width&quot;:980,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;img&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="img" title="img" srcset="https://substackcdn.com/image/fetch/$s_!STzk!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1ad5dbf2-67c6-410e-9aa8-19b86a47b30b_980x655.webp 424w, https://substackcdn.com/image/fetch/$s_!STzk!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1ad5dbf2-67c6-410e-9aa8-19b86a47b30b_980x655.webp 848w, https://substackcdn.com/image/fetch/$s_!STzk!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1ad5dbf2-67c6-410e-9aa8-19b86a47b30b_980x655.webp 1272w, https://substackcdn.com/image/fetch/$s_!STzk!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1ad5dbf2-67c6-410e-9aa8-19b86a47b30b_980x655.webp 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><code>Bundle name</code> Equivalent <strong>to Android ,</strong> the project name and save location can be selected, and other configurations can be left default to complete the project creation.<code>package name</code></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!WXLE!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa32be451-2867-4d9d-80ed-58543eca2676_980x655.webp" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!WXLE!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa32be451-2867-4d9d-80ed-58543eca2676_980x655.webp 424w, https://substackcdn.com/image/fetch/$s_!WXLE!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa32be451-2867-4d9d-80ed-58543eca2676_980x655.webp 848w, https://substackcdn.com/image/fetch/$s_!WXLE!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa32be451-2867-4d9d-80ed-58543eca2676_980x655.webp 1272w, https://substackcdn.com/image/fetch/$s_!WXLE!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa32be451-2867-4d9d-80ed-58543eca2676_980x655.webp 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!WXLE!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa32be451-2867-4d9d-80ed-58543eca2676_980x655.webp" width="980" height="655" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a32be451-2867-4d9d-80ed-58543eca2676_980x655.webp&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:655,&quot;width&quot;:980,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;img&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="img" title="img" srcset="https://substackcdn.com/image/fetch/$s_!WXLE!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa32be451-2867-4d9d-80ed-58543eca2676_980x655.webp 424w, https://substackcdn.com/image/fetch/$s_!WXLE!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa32be451-2867-4d9d-80ed-58543eca2676_980x655.webp 848w, https://substackcdn.com/image/fetch/$s_!WXLE!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa32be451-2867-4d9d-80ed-58543eca2676_980x655.webp 1272w, https://substackcdn.com/image/fetch/$s_!WXLE!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa32be451-2867-4d9d-80ed-58543eca2676_980x655.webp 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h2>Project structure</h2><p>Once the project is created, you will see the following project directory structure, which looks like a lot of files, but we only need to focus on the important parts;</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!RCRA!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa83361f2-3d9a-42b6-9d26-d9dace8af614_473x654.webp" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!RCRA!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa83361f2-3d9a-42b6-9d26-d9dace8af614_473x654.webp 424w, https://substackcdn.com/image/fetch/$s_!RCRA!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa83361f2-3d9a-42b6-9d26-d9dace8af614_473x654.webp 848w, https://substackcdn.com/image/fetch/$s_!RCRA!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa83361f2-3d9a-42b6-9d26-d9dace8af614_473x654.webp 1272w, https://substackcdn.com/image/fetch/$s_!RCRA!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa83361f2-3d9a-42b6-9d26-d9dace8af614_473x654.webp 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!RCRA!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa83361f2-3d9a-42b6-9d26-d9dace8af614_473x654.webp" width="473" height="654" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a83361f2-3d9a-42b6-9d26-d9dace8af614_473x654.webp&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:654,&quot;width&quot;:473,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;img&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="img" title="img" srcset="https://substackcdn.com/image/fetch/$s_!RCRA!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa83361f2-3d9a-42b6-9d26-d9dace8af614_473x654.webp 424w, https://substackcdn.com/image/fetch/$s_!RCRA!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa83361f2-3d9a-42b6-9d26-d9dace8af614_473x654.webp 848w, https://substackcdn.com/image/fetch/$s_!RCRA!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa83361f2-3d9a-42b6-9d26-d9dace8af614_473x654.webp 1272w, https://substackcdn.com/image/fetch/$s_!RCRA!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa83361f2-3d9a-42b6-9d26-d9dace8af614_473x654.webp 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>PROJECT_FILE_TREE</p><ul><li><p><code>Demo/build-profile.json5</code> The project configuration file, which is equivalent to the one in <strong>the Android</strong> project:<code>settings.gradle.kts</code></p></li></ul><pre><code>json</code></pre><p>Code interpretation</p><p>Copy the code</p><p><code>{ "app": { "signingConfigs": [], // &#31614;&#21517;&#37197;&#32622; "compileSdkVersion": 9, // SDK &#29256;&#26412;&#37197;&#32622; "compatibleSdkVersion": 9, // SDK &#29256;&#26412;&#37197;&#32622; "products": [ { "name": "default", "signingConfig": "default", } ] }, "modules": [ // &#27169;&#22359;&#37197;&#32622; { "name": "entry", // &#27169;&#22359;&#21517; "srcPath": "./entry", // &#27169;&#22359;&#36335;&#24452; "targets": [ { "name": "default", "applyToProducts": [ "default" ] } ] } ] }</code></p><ul><li><p><code>Demo/AppScope</code> The path where the global resources and configurations are stored;</p></li><li><p><code>Demo/AppScope/resources</code> apply global resource paths;</p></li><li><p><code>Demo/AppScope/app.json5</code> Application configuration, define the package name, version, application icon, name, etc.:</p></li></ul><pre><code>json</code></pre><p>Code interpretation</p><p>Copy the code</p><p><code>{ "app": { "bundleName": "com.sample.demo", // &#21253;&#21517; "vendor": "example", // &#20379;&#24212;&#21830; "versionCode": 1000000, // &#29256;&#26412;&#21495; "versionName": "1.0.0", // &#29256;&#26412;&#21517; "icon": "$media:app_icon", // &#24212;&#29992;&#22270;&#26631;&#65292;&#27492;&#22788;&#37197;&#32622;&#24433;&#21709;&#24212;&#29992;&#31649;&#29702;&#20013;&#26174;&#31034; "label": "$string:app_name" // &#24212;&#29992;&#21517;&#65292;&#27492;&#22788;&#37197;&#32622;&#24433;&#21709;&#24212;&#29992;&#31649;&#29702;&#20013;&#26174;&#31034; } }</code></p><p>Icons used:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!0iHu!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff67d0322-bfdd-4799-941d-4fdbe2c81e4c_114x114.webp" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!0iHu!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff67d0322-bfdd-4799-941d-4fdbe2c81e4c_114x114.webp 424w, https://substackcdn.com/image/fetch/$s_!0iHu!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff67d0322-bfdd-4799-941d-4fdbe2c81e4c_114x114.webp 848w, https://substackcdn.com/image/fetch/$s_!0iHu!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff67d0322-bfdd-4799-941d-4fdbe2c81e4c_114x114.webp 1272w, https://substackcdn.com/image/fetch/$s_!0iHu!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff67d0322-bfdd-4799-941d-4fdbe2c81e4c_114x114.webp 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!0iHu!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff67d0322-bfdd-4799-941d-4fdbe2c81e4c_114x114.webp" width="114" height="114" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f67d0322-bfdd-4799-941d-4fdbe2c81e4c_114x114.webp&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:114,&quot;width&quot;:114,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;img&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="img" title="img" srcset="https://substackcdn.com/image/fetch/$s_!0iHu!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff67d0322-bfdd-4799-941d-4fdbe2c81e4c_114x114.webp 424w, https://substackcdn.com/image/fetch/$s_!0iHu!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff67d0322-bfdd-4799-941d-4fdbe2c81e4c_114x114.webp 848w, https://substackcdn.com/image/fetch/$s_!0iHu!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff67d0322-bfdd-4799-941d-4fdbe2c81e4c_114x114.webp 1272w, https://substackcdn.com/image/fetch/$s_!0iHu!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff67d0322-bfdd-4799-941d-4fdbe2c81e4c_114x114.webp 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>Name Resources:</p><pre><code>json</code></pre><p>Code interpretation</p><p>Copy the code</p><p><code>{ "string": [ { "name": "app_name", "value": "Demo" } ] }</code></p><p>In App Management:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!uSqa!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb89fd945-ac05-4558-9de5-b251f1866146_458x936.webp" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!uSqa!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb89fd945-ac05-4558-9de5-b251f1866146_458x936.webp 424w, https://substackcdn.com/image/fetch/$s_!uSqa!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb89fd945-ac05-4558-9de5-b251f1866146_458x936.webp 848w, https://substackcdn.com/image/fetch/$s_!uSqa!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb89fd945-ac05-4558-9de5-b251f1866146_458x936.webp 1272w, https://substackcdn.com/image/fetch/$s_!uSqa!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb89fd945-ac05-4558-9de5-b251f1866146_458x936.webp 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!uSqa!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb89fd945-ac05-4558-9de5-b251f1866146_458x936.webp" width="458" height="936" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b89fd945-ac05-4558-9de5-b251f1866146_458x936.webp&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:936,&quot;width&quot;:458,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;img&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="img" title="img" srcset="https://substackcdn.com/image/fetch/$s_!uSqa!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb89fd945-ac05-4558-9de5-b251f1866146_458x936.webp 424w, https://substackcdn.com/image/fetch/$s_!uSqa!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb89fd945-ac05-4558-9de5-b251f1866146_458x936.webp 848w, https://substackcdn.com/image/fetch/$s_!uSqa!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb89fd945-ac05-4558-9de5-b251f1866146_458x936.webp 1272w, https://substackcdn.com/image/fetch/$s_!uSqa!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb89fd945-ac05-4558-9de5-b251f1866146_458x936.webp 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><ul><li><p><code>Demo/entry</code> The main module of the application, the application entrance, and the path to store the code and resources;</p></li><li><p><code>Demo/entry/src/main/module.json5</code> Module configuration files, similar to those in <strong>Android</strong> projects:<code>AndroidManifest.xml</code></p></li></ul><pre><code>json</code></pre><p>Code interpretation</p><p>Copy the code</p><p><code>{ "module": { "name": "entry", // &#24403;&#21069;module&#30340;&#21517;&#23383;&#65292;module&#25171;&#21253;&#25104;hap&#21518;&#65292;&#34920;&#31034;hap&#30340;&#21517;&#31216;&#65292;&#26631;&#31614;&#20540;&#37319;&#29992;&#23383;&#31526;&#20018;&#34920;&#31034;&#65288;&#26368;&#22823;&#38271;&#24230;31&#20010;&#23383;&#33410;&#65289;&#65292;&#35813;&#21517;&#31216;&#22312;&#25972;&#20010;&#24212;&#29992;&#35201;&#21807;&#19968; "type": "entry", // &#34920;&#31034;&#27169;&#22359;&#30340;&#31867;&#22411;&#65292;&#31867;&#22411;&#26377;&#19977;&#31181;&#65292;&#20998;&#21035;&#26159;entry&#12289;feature&#21644;har "srcEntry": "./ets/DemoAbilityStage.ts", // &#27169;&#22359;&#30340;&#20837;&#21475;&#25991;&#20214;&#36335;&#24452;&#65292;&#40664;&#35748;&#27809;&#26377;&#65292;&#38656;&#35201;&#25163;&#21160;&#21019;&#24314;&#65292;&#31867;&#20284; Android &#20013;&#30340; Application "description": "$string:module_desc", // &#24403;&#21069;&#27169;&#22359;&#30340;&#25551;&#36848;&#20449;&#24687; "mainElement": "EntryAbility", // &#35813;&#26631;&#31614;&#26631;&#35782;hap&#30340;&#20837;&#21475;ability&#21517;&#31216;&#25110;&#32773;extension&#21517;&#31216;&#12290;&#21482;&#26377;&#37197;&#32622;&#20026;mainElement&#30340;ability&#25110;&#32773;extension&#25165;&#20801;&#35768;&#22312;&#26381;&#21153;&#20013;&#24515;&#38706;&#20986; "deviceTypes": [ // &#35813;&#26631;&#31614;&#26631;&#35782;hap&#21487;&#20197;&#36816;&#34892;&#22312;&#21738;&#31867;&#35774;&#22791;&#19978; "phone", "tablet" ], "deliveryWithInstall": true, // &#35813;&#27169;&#22359;&#26159;&#21542;&#38543;&#24212;&#29992;&#19968;&#36215;&#23433;&#35013; "installationFree": false, // &#37322;&#25918;&#25903;&#25345;&#20813;&#23433;&#35013; "pages": "$profile:main_pages", // ability &#20013;&#20351;&#29992;&#30340; page &#20449;&#24687;&#37197;&#32622; "abilities": [ // ability &#37197;&#32622;&#21015;&#34920;&#65292;&#31867;&#20284; Android &#20013;&#30340; Activity &#21015;&#34920; { "name": "EntryAbility", // &#36923;&#36753;&#21517;&#65292;&#25972;&#20010;&#24212;&#29992;&#35201;&#21807;&#19968; "srcEntry": "./ets/entryability/EntryAbility.ts", // &#20837;&#21475;&#20195;&#30721;&#36335;&#24452; "description": "$string:EntryAbility_desc", // &#25551;&#36848;&#20449;&#24687; "icon": "$media:icon", // &#22270;&#26631;&#65292;&#22914;&#26524;&#20026; MainElement&#65292;&#24517;&#22635;&#65292;&#27492;&#22788;&#37197;&#32622;&#24433;&#21709;&#24212;&#29992;&#21015;&#34920;&#26174;&#31034;&#21450;&#20219;&#21153;&#26632;&#26174;&#31034; "label": "$string:EntryAbility_label", // &#26631;&#31614;&#21517;&#65292;&#27492;&#22788;&#37197;&#32622;&#24433;&#21709;&#24212;&#29992;&#21015;&#34920;&#26174;&#31034;&#21450;&#20219;&#21153;&#26632;&#26174;&#31034; "startWindowIcon": "$media:icon", // &#21551;&#21160;&#39029;&#22270;&#26631; "startWindowBackground": "$color:start_window_background", // &#21551;&#21160;&#39029;&#32972;&#26223;&#39068;&#33394; "exported": true, "skills": [ { "entities": [ "entity.system.home" ], "actions": [ "action.system.home" ] } ] } ] } }</code></p><p>Icons used:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!yfa3!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb783365b-8ca6-4efd-9d6b-6b01c09a67ac_114x114.webp" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!yfa3!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb783365b-8ca6-4efd-9d6b-6b01c09a67ac_114x114.webp 424w, https://substackcdn.com/image/fetch/$s_!yfa3!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb783365b-8ca6-4efd-9d6b-6b01c09a67ac_114x114.webp 848w, https://substackcdn.com/image/fetch/$s_!yfa3!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb783365b-8ca6-4efd-9d6b-6b01c09a67ac_114x114.webp 1272w, https://substackcdn.com/image/fetch/$s_!yfa3!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb783365b-8ca6-4efd-9d6b-6b01c09a67ac_114x114.webp 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!yfa3!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb783365b-8ca6-4efd-9d6b-6b01c09a67ac_114x114.webp" width="114" height="114" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b783365b-8ca6-4efd-9d6b-6b01c09a67ac_114x114.webp&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:114,&quot;width&quot;:114,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;img&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="img" title="img" srcset="https://substackcdn.com/image/fetch/$s_!yfa3!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb783365b-8ca6-4efd-9d6b-6b01c09a67ac_114x114.webp 424w, https://substackcdn.com/image/fetch/$s_!yfa3!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb783365b-8ca6-4efd-9d6b-6b01c09a67ac_114x114.webp 848w, https://substackcdn.com/image/fetch/$s_!yfa3!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb783365b-8ca6-4efd-9d6b-6b01c09a67ac_114x114.webp 1272w, https://substackcdn.com/image/fetch/$s_!yfa3!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb783365b-8ca6-4efd-9d6b-6b01c09a67ac_114x114.webp 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>Name Resources:</p><pre><code>json</code></pre><p>Code interpretation</p><p>Copy the code</p><p><code>{ "string": [ { "name": "EntryAbility_label", "value": "Ability1" } ] }</code></p><p>Display on desktop:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!yuIG!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd4111fee-39e3-405c-9d19-ef466737c866_458x936.webp" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!yuIG!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd4111fee-39e3-405c-9d19-ef466737c866_458x936.webp 424w, https://substackcdn.com/image/fetch/$s_!yuIG!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd4111fee-39e3-405c-9d19-ef466737c866_458x936.webp 848w, https://substackcdn.com/image/fetch/$s_!yuIG!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd4111fee-39e3-405c-9d19-ef466737c866_458x936.webp 1272w, https://substackcdn.com/image/fetch/$s_!yuIG!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd4111fee-39e3-405c-9d19-ef466737c866_458x936.webp 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!yuIG!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd4111fee-39e3-405c-9d19-ef466737c866_458x936.webp" width="458" height="936" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d4111fee-39e3-405c-9d19-ef466737c866_458x936.webp&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:936,&quot;width&quot;:458,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;img&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="img" title="img" srcset="https://substackcdn.com/image/fetch/$s_!yuIG!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd4111fee-39e3-405c-9d19-ef466737c866_458x936.webp 424w, https://substackcdn.com/image/fetch/$s_!yuIG!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd4111fee-39e3-405c-9d19-ef466737c866_458x936.webp 848w, https://substackcdn.com/image/fetch/$s_!yuIG!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd4111fee-39e3-405c-9d19-ef466737c866_458x936.webp 1272w, https://substackcdn.com/image/fetch/$s_!yuIG!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd4111fee-39e3-405c-9d19-ef466737c866_458x936.webp 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>In the task stack displays:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!zZAs!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1996772f-3ec5-4703-8389-82f92555d894_458x936.webp" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!zZAs!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1996772f-3ec5-4703-8389-82f92555d894_458x936.webp 424w, https://substackcdn.com/image/fetch/$s_!zZAs!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1996772f-3ec5-4703-8389-82f92555d894_458x936.webp 848w, https://substackcdn.com/image/fetch/$s_!zZAs!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1996772f-3ec5-4703-8389-82f92555d894_458x936.webp 1272w, https://substackcdn.com/image/fetch/$s_!zZAs!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1996772f-3ec5-4703-8389-82f92555d894_458x936.webp 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!zZAs!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1996772f-3ec5-4703-8389-82f92555d894_458x936.webp" width="458" height="936" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1996772f-3ec5-4703-8389-82f92555d894_458x936.webp&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:936,&quot;width&quot;:458,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;img&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="img" title="img" srcset="https://substackcdn.com/image/fetch/$s_!zZAs!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1996772f-3ec5-4703-8389-82f92555d894_458x936.webp 424w, https://substackcdn.com/image/fetch/$s_!zZAs!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1996772f-3ec5-4703-8389-82f92555d894_458x936.webp 848w, https://substackcdn.com/image/fetch/$s_!zZAs!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1996772f-3ec5-4703-8389-82f92555d894_458x936.webp 1272w, https://substackcdn.com/image/fetch/$s_!zZAs!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1996772f-3ec5-4703-8389-82f92555d894_458x936.webp 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>If there is more than one , all icons will be created on the desktop:<code>UIAbilityskillsentity.system.home</code></p><pre><code>bash</code></pre><p>Code interpretation</p><p>Copy the code</p><p><code>"skills": [ { "entities": [ "entity.system.home" ], "actions": [ "action.system.home" ] } ]</code></p><ul><li><p><code>Demo/entry/src/main/ets</code> source code file path;</p></li><li><p><code>Demo/entry/src/main/ets/entryability/EntryAbility.ts</code> UI components, similar to <strong>the one in Android</strong>;<code>Activity</code></p></li><li><p><code>Demo/entry/src/main/resources</code> resource file path;</p></li></ul><h1>Project architecture and comparison with Android</h1><p>From the perspective of the overall project architecture, the <strong>HarmonyOS</strong> project is relatively close to the <strong>Compose</strong> + <strong>single-activity</strong> architecture of the <strong>Android</strong> project, and we can also find some corresponding relationships with <strong>the Android</strong> project in <strong>HarmonyOS</strong>:</p><p>AndroidHarmonyOSsettings.gradle.ktsProject configuration filesDemo/build-profile.json5The project configuration file, except that the application signature, SDK version, and multi-channel configuration have been moved herebuild.gradle.ktsModule configuration filesDemo/AppScope/app.json5Apply the configuration file, configure the package name, version, icon, and nameAndroidManifest.xmlManifest fileDemo/entry/src/main/module.json5Configure the module configuration file and configure the application entry and routeApplicationApplication entryAbilityStageApplication entryActivityUI componentsUIAbilityUI componentsNavgationPage routingpagesPage routing</p><h2>life cycle</h2><p>In the node declaration in , we can also configure a global application entry just like <strong>an Android</strong> app, with similar lifecycle method callbacks:<code>module.json5modulesrcEntry</code></p><pre><code>jsx</code></pre><p>Code interpretation</p><p>Copy the code</p><p><code>import AbilityStage from '@ohos.app.ability.AbilityStage'; export default class DemoAbilityStage extends AbilityStage { onCreate() { // &#24212;&#29992;&#21551;&#21160;&#22238;&#35843; } }</code></p><p>UI components in <strong>HarmonyOS</strong> have a similar lifecycle to <strong>Android</strong>:<code>UIAbilityActivity</code></p><pre><code>jsx</code></pre><p>Code interpretation</p><p>Copy the code</p><p><code>import UIAbility from '@ohos.app.ability.UIAbility'; import hilog from '@ohos.hilog'; import window from '@ohos.window'; export default class EntryAbility extends UIAbility { onCreate(want, launchParam) { // &#32452;&#20214;&#21019;&#24314; hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate'); } onDestroy() { // &#32452;&#20214;&#38144;&#27585; hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onDestroy'); } onWindowStageCreate(windowStage: window.WindowStage) { // window &#21019;&#24314; // Main window is created, set main page for this ability hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); // &#35774;&#32622;&#24067;&#23616;&#65292;&#26174;&#31034; ets/pages/Index.ets &#30340;&#24067;&#23616; windowStage.loadContent('pages/Index', (err, data) =&gt; { if (err.code) { hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); return; } hilog.info(0x0000, 'testTag', 'Succeeded in loading the content. Data: %{public}s', JSON.stringify(data) ?? ''); }); } onWindowStageDestroy() { // window &#38144;&#27585; // Main window is destroyed, release UI related resources hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); } onForeground() { // &#36827;&#20837;&#21069;&#21488; // Ability has brought to foreground hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onForeground'); } onBackground() { // &#36827;&#20837;&#21518;&#21488; // Ability has back to background hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onBackground'); } }</code></p><p><strong>HarmonyOS</strong> does not have a lifecycle callback method in <strong>Android</strong>, but there are still solutions to implement it if needed, which need to be implemented in the method:<code>UIAbilityActivityonResumeonPauseonWindowStageCreatewindowStage</code></p><pre><code>dart</code></pre><p>Code interpretation</p><p>Copy the code</p><p><code>onWindowStageCreate(windowStage: window.WindowStage) { windowStage.on('windowStageEvent', (event) =&gt; { // event &#21462;&#20540;&#20026;&#26522;&#20030;&#31867;&#22411; window.WindowStageEventType if(event === window.WindowStageEventType.ACTIVE) { // &#33719;&#21462;&#28966;&#28857; } else { // &#22833;&#21435;&#28966;&#28857; } }) }</code></p><h2>layout</h2><p><strong>HarmonyOS</strong> uses <strong>ArkTS</strong> as the development language and provides <strong>ArkTS UI</strong> components for UI layout, as shown in the layout above:<code>UIAbilityets/pages/Index.ets</code></p><pre><code>kotlin</code></pre><p>Code interpretation</p><p>Copy the code</p><p><code>@Entry // &#22768;&#26126;&#36825;&#20010;&#32452;&#20214;&#21487;&#20316;&#20026;&#39029;&#38754;&#20837;&#21475;&#65292;&#21363;&#22312; UIAbility &#20013;&#21152;&#36733;&#25110;&#36827;&#34892;&#39029;&#38754;&#36339;&#36716; @Component // &#22768;&#26126;&#36825;&#26159;&#19968;&#20010;UI&#32452;&#20214; struct Index { @State message: string = 'Hello World' build() { // &#22768;&#26126;&#24067;&#23616; Row() { // &#27178;&#21521;&#24067;&#23616; Column() { // &#31446;&#21521;&#24067;&#23616; Text(this.message) // &#25991;&#26412;&#25511;&#20214; .fontSize(50) .fontWeight(FontWeight.Bold) } .width('100%') // &#23485;&#24230;&#38138;&#28385; } .height('100%') // &#39640;&#24230;&#38138;&#28385; } }</code></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Obfp!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb2922073-3ec4-470b-9d1c-88dd33e9c49f_231x477.webp" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Obfp!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb2922073-3ec4-470b-9d1c-88dd33e9c49f_231x477.webp 424w, https://substackcdn.com/image/fetch/$s_!Obfp!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb2922073-3ec4-470b-9d1c-88dd33e9c49f_231x477.webp 848w, https://substackcdn.com/image/fetch/$s_!Obfp!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb2922073-3ec4-470b-9d1c-88dd33e9c49f_231x477.webp 1272w, https://substackcdn.com/image/fetch/$s_!Obfp!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb2922073-3ec4-470b-9d1c-88dd33e9c49f_231x477.webp 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Obfp!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb2922073-3ec4-470b-9d1c-88dd33e9c49f_231x477.webp" width="231" height="477" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b2922073-3ec4-470b-9d1c-88dd33e9c49f_231x477.webp&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:477,&quot;width&quot;:231,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;img&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="img" title="img" srcset="https://substackcdn.com/image/fetch/$s_!Obfp!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb2922073-3ec4-470b-9d1c-88dd33e9c49f_231x477.webp 424w, https://substackcdn.com/image/fetch/$s_!Obfp!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb2922073-3ec4-470b-9d1c-88dd33e9c49f_231x477.webp 848w, https://substackcdn.com/image/fetch/$s_!Obfp!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb2922073-3ec4-470b-9d1c-88dd33e9c49f_231x477.webp 1272w, https://substackcdn.com/image/fetch/$s_!Obfp!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb2922073-3ec4-470b-9d1c-88dd33e9c49f_231x477.webp 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>The above is the default generated layout of the new project, the effect is to display the text in the middle of the screen, and more components can be referred to the <a href="https://link.juejin.cn?target=https%3A%2F%2Flinks.jianshu.com%2Fgo%3Fto%3Dhttps%253A%252F%252Fdeveloper.harmonyos.com%252Fcn%252Fdocs%252Fdocumentation%252Fdoc-references%252Fts-components-versions-0000001231119333">component reference (declarative development paradigm based on ArkTS</a>.<code>Hello World</code></p><h2>The interface jumps</h2><h3>Pages jump</h3><p>In the projects generated by <strong>HarmonyOS</strong>, there is only one by default, and the display layout is loaded through , so a multi-interface approach is to write different <strong>pages</strong> and jump directly to different <strong>pages</strong>.<code>UIAbilitywindowStage.loadContent</code></p><p>First, let's create a new file under the path, declare the layout with reference, and add a button to go back to the previous level:<code>ets/pagesSecond.etsIndex.ets</code></p><pre><code>tsx</code></pre><p>Code interpretation</p><p>Copy the code</p><p><code>import router from '@ohos.router' @Entry @Component struct Second { @State message: string = 'Second Page' build() { Row() { Column() { Text(this.message) .fontSize(50) .fontWeight(FontWeight.Bold) // &#28155;&#21152;&#25353;&#38062; Button("&#28857;&#20987;&#36820;&#22238;") .onClick(() =&gt; { // &#25353;&#38062;&#28857;&#20987;&#36890;&#36807; router &#36820;&#22238;&#19978;&#19968;&#32423; router.back() }) } .width('100%') } .height('100%') } }</code></p><p>Then, we need to add the declaration of this interface to the file:<code>resources/base/profile/main_pages.json</code></p><pre><code>json</code></pre><p>Code interpretation</p><p>Copy the code</p><p><code>{ "src": [ "pages/Index", "pages/Second" ] }</code></p><p>Add a button to the previous layout and configure the click-to-jump logic:<code>Index.ets</code></p><pre><code>tsx</code></pre><p>Code interpretation</p><p>Copy the code</p><p><code>import router from '@ohos.router' @Entry @Component struct Index { @State message: string = 'Hello World' build() { Row() { Column() { Text(this.message) .fontSize(50) .fontWeight(FontWeight.Bold) // &#28155;&#21152;&#25353;&#38062; Button("&#28857;&#20987;&#36339;&#36716;") .onClick(() =&gt; { // &#25353;&#38062;&#28857;&#20987;&#36890;&#36807; router &#36339;&#36716;&#21040; pages/Second router.pushUrl({ url: "pages/Second" }) }) } .width('100%') } .height('100%') } }</code></p><p>In this way, you can jump to the interface by clicking the button. It is recommended to create a <strong>Page</strong> in the Path Use, which will automatically generate the corresponding layout file and configuration, which is more convenient and less error-prone.<code>ets/pagesNew -&gt; Page</code></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!i3Q1!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f603f95-f48f-4256-bfad-51f9b30f7517_626x1280.webp" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!i3Q1!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f603f95-f48f-4256-bfad-51f9b30f7517_626x1280.webp 424w, https://substackcdn.com/image/fetch/$s_!i3Q1!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f603f95-f48f-4256-bfad-51f9b30f7517_626x1280.webp 848w, https://substackcdn.com/image/fetch/$s_!i3Q1!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f603f95-f48f-4256-bfad-51f9b30f7517_626x1280.webp 1272w, https://substackcdn.com/image/fetch/$s_!i3Q1!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f603f95-f48f-4256-bfad-51f9b30f7517_626x1280.webp 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!i3Q1!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f603f95-f48f-4256-bfad-51f9b30f7517_626x1280.webp" width="626" height="1280" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/4f603f95-f48f-4256-bfad-51f9b30f7517_626x1280.webp&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1280,&quot;width&quot;:626,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;img&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="img" title="img" srcset="https://substackcdn.com/image/fetch/$s_!i3Q1!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f603f95-f48f-4256-bfad-51f9b30f7517_626x1280.webp 424w, https://substackcdn.com/image/fetch/$s_!i3Q1!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f603f95-f48f-4256-bfad-51f9b30f7517_626x1280.webp 848w, https://substackcdn.com/image/fetch/$s_!i3Q1!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f603f95-f48f-4256-bfad-51f9b30f7517_626x1280.webp 1272w, https://substackcdn.com/image/fetch/$s_!i3Q1!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f603f95-f48f-4256-bfad-51f9b30f7517_626x1280.webp 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h3>UIAbility Jump</h3><p>Although there is only one template officially provided by <strong>HarmonyOS</strong>, it still supports many.<code>UIAbilityUIAbility</code></p><p>Similarly, create a new one under the path, load the layout in , and add the corresponding configuration in , which is still recommended to be created;<code>etsEntryAbility.tsSecondEntryAbility.tsonWindowStageCreatepages/SecondAblitymodule.json5New -&gt; Ability</code></p><p>Modify the text and add a back button in :<code>ets/pages/SecondAbility.ets</code></p><pre><code>tsx</code></pre><p>Code interpretation</p><p>Copy the code</p><p><code>import common from '@ohos.app.ability.common' @Preview @Entry @Component struct SecondAbility { @State message: string = 'Second Ability' build() { Row() { Column() { Text(this.message) .fontSize(50) .fontWeight(FontWeight.Bold) Button("&#28857;&#20987;&#36820;&#22238;") .margin({ top: 30 }) .onClick(() =&gt; { // &#25353;&#38062;&#28857;&#20987;&#20851;&#38381;&#24403;&#21069; UIAbility let context = getContext(this) as unknown as common.UIAbilityContext context.terminateSelf() }) } .width('100%') } .height('100%') } }</code></p><p>Then we modify the code in to add a new button below the previous button and click Jump:<code>ets/pages/Index.etsSecondEntryAbility</code></p><pre><code>tsx</code></pre><p>Code interpretation</p><p>Copy the code</p><p><code>import common from '@ohos.app.ability.common' import Want from '@ohos.app.ability.Want' @Entry @Component struct Index { @State message: string = 'Hello World' build() { Row() { Column() { Text(this.message) .fontSize(50) .fontWeight(FontWeight.Bold) Button("&#28857;&#20987;&#36339;&#36716;") .onClick(() =&gt; { // &#25353;&#38062;&#28857;&#20987;&#36339;&#36716;&#21040; SecondEntryAbility let context = getContext(this) as unknown as common.UIAbilityContext let want: Want = { deviceId: "", bundleName: "com.sample.demo", abilityName: "SecondEntryAbility", } context.startAbility(want) }) // &#28155;&#21152;&#25353;&#38062; Button("&#28857;&#20987;&#36339;&#36716;Ability") .onClick(() =&gt; { // &#25353;&#38062;&#28857;&#20987;&#36339;&#36716;&#21040; SecondEntryAbility let context = getContext(this) as unknown as common.UIAbilityContext let want: Want = { deviceId: "", bundleName: "com.sample.demo", abilityName: "SecondEntryAbility", } context.startAbility(want) }) } .width('100%') } .height('100%') } }</code></p><p>Here we are going to mention the difference between and , although they are both UI components, but in <strong>HarmonyOS</strong>, each open will be displayed separately in the task stack;<code>UIAbilityActivityUIAbility</code></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!pyVl!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc267e041-b0c0-4f65-bd4d-b2f574a527d2_626x1280.webp" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!pyVl!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc267e041-b0c0-4f65-bd4d-b2f574a527d2_626x1280.webp 424w, https://substackcdn.com/image/fetch/$s_!pyVl!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc267e041-b0c0-4f65-bd4d-b2f574a527d2_626x1280.webp 848w, https://substackcdn.com/image/fetch/$s_!pyVl!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc267e041-b0c0-4f65-bd4d-b2f574a527d2_626x1280.webp 1272w, https://substackcdn.com/image/fetch/$s_!pyVl!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc267e041-b0c0-4f65-bd4d-b2f574a527d2_626x1280.webp 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!pyVl!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc267e041-b0c0-4f65-bd4d-b2f574a527d2_626x1280.webp" width="626" height="1280" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c267e041-b0c0-4f65-bd4d-b2f574a527d2_626x1280.webp&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1280,&quot;width&quot;:626,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;img&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="img" title="img" srcset="https://substackcdn.com/image/fetch/$s_!pyVl!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc267e041-b0c0-4f65-bd4d-b2f574a527d2_626x1280.webp 424w, https://substackcdn.com/image/fetch/$s_!pyVl!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc267e041-b0c0-4f65-bd4d-b2f574a527d2_626x1280.webp 848w, https://substackcdn.com/image/fetch/$s_!pyVl!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc267e041-b0c0-4f65-bd4d-b2f574a527d2_626x1280.webp 1272w, https://substackcdn.com/image/fetch/$s_!pyVl!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc267e041-b0c0-4f65-bd4d-b2f574a527d2_626x1280.webp 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h1>summary</h1><p>As an <strong>Android</strong> developer, I'm looking for the similarities between <strong>HarmonyOS</strong> and <strong>Android</strong> development when I write this article, and we don't need to learn about <strong>HarmonyOS from scratch </strong>development, you can start faster.</p><p>Finally, share a HarmonyOS development study guide</p><p><strong>Pay attention to VX public account: Android Lao Pi</strong></p><h2>HarmonyOS Development Learning Guide</h2><p><strong>Chapter 1 Quick Start</strong></p><p>1. Preparation for development</p><p>2. Build the first ArkTS application (Stage model)</p><p>3. Build the first ArkTS application (FA model)</p><p>4. Build the first JS application (FA model)</p><p>5&#12289;........</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!yreF!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F31126145-21dc-404e-8078-880aa21e842d_1080x525.webp" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!yreF!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F31126145-21dc-404e-8078-880aa21e842d_1080x525.webp 424w, https://substackcdn.com/image/fetch/$s_!yreF!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F31126145-21dc-404e-8078-880aa21e842d_1080x525.webp 848w, https://substackcdn.com/image/fetch/$s_!yreF!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F31126145-21dc-404e-8078-880aa21e842d_1080x525.webp 1272w, https://substackcdn.com/image/fetch/$s_!yreF!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F31126145-21dc-404e-8078-880aa21e842d_1080x525.webp 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!yreF!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F31126145-21dc-404e-8078-880aa21e842d_1080x525.webp" width="1080" height="525" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/31126145-21dc-404e-8078-880aa21e842d_1080x525.webp&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:525,&quot;width&quot;:1080,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Image&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Image" title="Image" srcset="https://substackcdn.com/image/fetch/$s_!yreF!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F31126145-21dc-404e-8078-880aa21e842d_1080x525.webp 424w, https://substackcdn.com/image/fetch/$s_!yreF!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F31126145-21dc-404e-8078-880aa21e842d_1080x525.webp 848w, https://substackcdn.com/image/fetch/$s_!yreF!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F31126145-21dc-404e-8078-880aa21e842d_1080x525.webp 1272w, https://substackcdn.com/image/fetch/$s_!yreF!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F31126145-21dc-404e-8078-880aa21e842d_1080x525.webp 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><strong>Chapter 2 Basic Knowledge of Development</strong></p><p>1. Basic knowledge of application packages</p><p>2. Application configuration file (Stage model)</p><p>3. Overview of application configuration files (FA model)</p><p>4&#12289;.......</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!cFHQ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5fdef1cc-cd7a-4e69-ae3a-bd773a6c1515_1080x529.webp" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!cFHQ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5fdef1cc-cd7a-4e69-ae3a-bd773a6c1515_1080x529.webp 424w, https://substackcdn.com/image/fetch/$s_!cFHQ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5fdef1cc-cd7a-4e69-ae3a-bd773a6c1515_1080x529.webp 848w, https://substackcdn.com/image/fetch/$s_!cFHQ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5fdef1cc-cd7a-4e69-ae3a-bd773a6c1515_1080x529.webp 1272w, https://substackcdn.com/image/fetch/$s_!cFHQ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5fdef1cc-cd7a-4e69-ae3a-bd773a6c1515_1080x529.webp 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!cFHQ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5fdef1cc-cd7a-4e69-ae3a-bd773a6c1515_1080x529.webp" width="1080" height="529" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5fdef1cc-cd7a-4e69-ae3a-bd773a6c1515_1080x529.webp&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:529,&quot;width&quot;:1080,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&#22270;&#29255;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="&#22270;&#29255;" title="&#22270;&#29255;" srcset="https://substackcdn.com/image/fetch/$s_!cFHQ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5fdef1cc-cd7a-4e69-ae3a-bd773a6c1515_1080x529.webp 424w, https://substackcdn.com/image/fetch/$s_!cFHQ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5fdef1cc-cd7a-4e69-ae3a-bd773a6c1515_1080x529.webp 848w, https://substackcdn.com/image/fetch/$s_!cFHQ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5fdef1cc-cd7a-4e69-ae3a-bd773a6c1515_1080x529.webp 1272w, https://substackcdn.com/image/fetch/$s_!cFHQ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5fdef1cc-cd7a-4e69-ae3a-bd773a6c1515_1080x529.webp 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><strong>Chapter 3</strong> <strong>Resource Classification and Access</strong></p><p>1. Resource classification and access</p><p>2. Create resource directories and resource files</p><p>3. Resource access</p><p>4&#12289;.......</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!y71q!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4e5c32c7-5bb2-4f67-96ce-53ff1ef3c378_1080x532.webp" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!y71q!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4e5c32c7-5bb2-4f67-96ce-53ff1ef3c378_1080x532.webp 424w, https://substackcdn.com/image/fetch/$s_!y71q!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4e5c32c7-5bb2-4f67-96ce-53ff1ef3c378_1080x532.webp 848w, https://substackcdn.com/image/fetch/$s_!y71q!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4e5c32c7-5bb2-4f67-96ce-53ff1ef3c378_1080x532.webp 1272w, https://substackcdn.com/image/fetch/$s_!y71q!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4e5c32c7-5bb2-4f67-96ce-53ff1ef3c378_1080x532.webp 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!y71q!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4e5c32c7-5bb2-4f67-96ce-53ff1ef3c378_1080x532.webp" width="1080" height="532" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/4e5c32c7-5bb2-4f67-96ce-53ff1ef3c378_1080x532.webp&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:532,&quot;width&quot;:1080,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&#22270;&#29255;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="&#22270;&#29255;" title="&#22270;&#29255;" srcset="https://substackcdn.com/image/fetch/$s_!y71q!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4e5c32c7-5bb2-4f67-96ce-53ff1ef3c378_1080x532.webp 424w, https://substackcdn.com/image/fetch/$s_!y71q!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4e5c32c7-5bb2-4f67-96ce-53ff1ef3c378_1080x532.webp 848w, https://substackcdn.com/image/fetch/$s_!y71q!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4e5c32c7-5bb2-4f67-96ce-53ff1ef3c378_1080x532.webp 1272w, https://substackcdn.com/image/fetch/$s_!y71q!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4e5c32c7-5bb2-4f67-96ce-53ff1ef3c378_1080x532.webp 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><strong>Chapter 4 Learning the ArkTs language</strong></p><p>1. Familiarize yourself with the ArkTS language</p><p>2. Basic grammar</p><p>3. State management</p><p>4. Other status management</p><p>5. Rendering control</p><p>6&#12289;......</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!DORH!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa96ede4e-17e0-4847-b5dd-022391197d79_1080x532.webp" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!DORH!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa96ede4e-17e0-4847-b5dd-022391197d79_1080x532.webp 424w, https://substackcdn.com/image/fetch/$s_!DORH!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa96ede4e-17e0-4847-b5dd-022391197d79_1080x532.webp 848w, https://substackcdn.com/image/fetch/$s_!DORH!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa96ede4e-17e0-4847-b5dd-022391197d79_1080x532.webp 1272w, https://substackcdn.com/image/fetch/$s_!DORH!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa96ede4e-17e0-4847-b5dd-022391197d79_1080x532.webp 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!DORH!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa96ede4e-17e0-4847-b5dd-022391197d79_1080x532.webp" width="1080" height="532" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a96ede4e-17e0-4847-b5dd-022391197d79_1080x532.webp&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:532,&quot;width&quot;:1080,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&#22270;&#29255;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="&#22270;&#29255;" title="&#22270;&#29255;" srcset="https://substackcdn.com/image/fetch/$s_!DORH!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa96ede4e-17e0-4847-b5dd-022391197d79_1080x532.webp 424w, https://substackcdn.com/image/fetch/$s_!DORH!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa96ede4e-17e0-4847-b5dd-022391197d79_1080x532.webp 848w, https://substackcdn.com/image/fetch/$s_!DORH!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa96ede4e-17e0-4847-b5dd-022391197d79_1080x532.webp 1272w, https://substackcdn.com/image/fetch/$s_!DORH!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa96ede4e-17e0-4847-b5dd-022391197d79_1080x532.webp 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><strong>Chapter 5 UI Development</strong></p><p>1. Overview of the Ark Development Framework (ArkUI).</p><p>2. Based on the ArkTS declarative development paradigm</p><p>3. Compatible with JS-like web development paradigm</p><p>4.......</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!IUSY!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd152b44c-9546-46f6-adba-9075905bc5b4_1080x554.webp" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!IUSY!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd152b44c-9546-46f6-adba-9075905bc5b4_1080x554.webp 424w, https://substackcdn.com/image/fetch/$s_!IUSY!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd152b44c-9546-46f6-adba-9075905bc5b4_1080x554.webp 848w, https://substackcdn.com/image/fetch/$s_!IUSY!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd152b44c-9546-46f6-adba-9075905bc5b4_1080x554.webp 1272w, https://substackcdn.com/image/fetch/$s_!IUSY!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd152b44c-9546-46f6-adba-9075905bc5b4_1080x554.webp 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!IUSY!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd152b44c-9546-46f6-adba-9075905bc5b4_1080x554.webp" width="1080" height="554" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d152b44c-9546-46f6-adba-9075905bc5b4_1080x554.webp&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:554,&quot;width&quot;:1080,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&#22270;&#29255;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="&#22270;&#29255;" title="&#22270;&#29255;" srcset="https://substackcdn.com/image/fetch/$s_!IUSY!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd152b44c-9546-46f6-adba-9075905bc5b4_1080x554.webp 424w, https://substackcdn.com/image/fetch/$s_!IUSY!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd152b44c-9546-46f6-adba-9075905bc5b4_1080x554.webp 848w, https://substackcdn.com/image/fetch/$s_!IUSY!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd152b44c-9546-46f6-adba-9075905bc5b4_1080x554.webp 1272w, https://substackcdn.com/image/fetch/$s_!IUSY!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd152b44c-9546-46f6-adba-9075905bc5b4_1080x554.webp 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><strong>Chapter 6 Web Development</strong></p><p>1. Overview of web components</p><p>2. Use the web component to load the page</p><p>3. Set the basic properties and events</p><p>4. Use front-end page JavaScript in your app</p><p>5. Overview of the basic class library of the ArkTS language</p><p>6. Concurrency</p><p>7.......</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Gyu5!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d2bed80-e259-4348-964c-7c70ec9440ac_1080x527.webp" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Gyu5!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d2bed80-e259-4348-964c-7c70ec9440ac_1080x527.webp 424w, https://substackcdn.com/image/fetch/$s_!Gyu5!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d2bed80-e259-4348-964c-7c70ec9440ac_1080x527.webp 848w, https://substackcdn.com/image/fetch/$s_!Gyu5!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d2bed80-e259-4348-964c-7c70ec9440ac_1080x527.webp 1272w, https://substackcdn.com/image/fetch/$s_!Gyu5!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d2bed80-e259-4348-964c-7c70ec9440ac_1080x527.webp 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Gyu5!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d2bed80-e259-4348-964c-7c70ec9440ac_1080x527.webp" width="1080" height="527" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/6d2bed80-e259-4348-964c-7c70ec9440ac_1080x527.webp&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:527,&quot;width&quot;:1080,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&#22270;&#29255;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="&#22270;&#29255;" title="&#22270;&#29255;" srcset="https://substackcdn.com/image/fetch/$s_!Gyu5!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d2bed80-e259-4348-964c-7c70ec9440ac_1080x527.webp 424w, https://substackcdn.com/image/fetch/$s_!Gyu5!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d2bed80-e259-4348-964c-7c70ec9440ac_1080x527.webp 848w, https://substackcdn.com/image/fetch/$s_!Gyu5!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d2bed80-e259-4348-964c-7c70ec9440ac_1080x527.webp 1272w, https://substackcdn.com/image/fetch/$s_!Gyu5!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d2bed80-e259-4348-964c-7c70ec9440ac_1080x527.webp 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>11. Networks and Connections</p><p>12. Telephone Service</p><p>13. Data Management</p><p>14. Document Management</p><p>15. Background task management</p><p>16. Device Management</p><p>17......</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!71HH!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3332bb29-d84d-4e84-8237-943dfb367587_1080x530.webp" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!71HH!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3332bb29-d84d-4e84-8237-943dfb367587_1080x530.webp 424w, https://substackcdn.com/image/fetch/$s_!71HH!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3332bb29-d84d-4e84-8237-943dfb367587_1080x530.webp 848w, https://substackcdn.com/image/fetch/$s_!71HH!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3332bb29-d84d-4e84-8237-943dfb367587_1080x530.webp 1272w, https://substackcdn.com/image/fetch/$s_!71HH!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3332bb29-d84d-4e84-8237-943dfb367587_1080x530.webp 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!71HH!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3332bb29-d84d-4e84-8237-943dfb367587_1080x530.webp" width="1080" height="530" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3332bb29-d84d-4e84-8237-943dfb367587_1080x530.webp&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:530,&quot;width&quot;:1080,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&#22270;&#29255;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="&#22270;&#29255;" title="&#22270;&#29255;" srcset="https://substackcdn.com/image/fetch/$s_!71HH!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3332bb29-d84d-4e84-8237-943dfb367587_1080x530.webp 424w, https://substackcdn.com/image/fetch/$s_!71HH!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3332bb29-d84d-4e84-8237-943dfb367587_1080x530.webp 848w, https://substackcdn.com/image/fetch/$s_!71HH!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3332bb29-d84d-4e84-8237-943dfb367587_1080x530.webp 1272w, https://substackcdn.com/image/fetch/$s_!71HH!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3332bb29-d84d-4e84-8237-943dfb367587_1080x530.webp 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><strong>Chapter 7 Application Models</strong></p><p>1. Overview of the application model</p><p>2. Stage model development guidance</p><p>3. FA model development guidance</p><p>4.......</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Es66!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fed0fdfdf-1db5-47d2-beed-6f0ab70dc62e_1080x516.webp" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Es66!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fed0fdfdf-1db5-47d2-beed-6f0ab70dc62e_1080x516.webp 424w, https://substackcdn.com/image/fetch/$s_!Es66!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fed0fdfdf-1db5-47d2-beed-6f0ab70dc62e_1080x516.webp 848w, https://substackcdn.com/image/fetch/$s_!Es66!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fed0fdfdf-1db5-47d2-beed-6f0ab70dc62e_1080x516.webp 1272w, https://substackcdn.com/image/fetch/$s_!Es66!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fed0fdfdf-1db5-47d2-beed-6f0ab70dc62e_1080x516.webp 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Es66!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fed0fdfdf-1db5-47d2-beed-6f0ab70dc62e_1080x516.webp" width="1080" height="516" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ed0fdfdf-1db5-47d2-beed-6f0ab70dc62e_1080x516.webp&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:516,&quot;width&quot;:1080,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&#22270;&#29255;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="&#22270;&#29255;" title="&#22270;&#29255;" srcset="https://substackcdn.com/image/fetch/$s_!Es66!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fed0fdfdf-1db5-47d2-beed-6f0ab70dc62e_1080x516.webp 424w, https://substackcdn.com/image/fetch/$s_!Es66!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fed0fdfdf-1db5-47d2-beed-6f0ab70dc62e_1080x516.webp 848w, https://substackcdn.com/image/fetch/$s_!Es66!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fed0fdfdf-1db5-47d2-beed-6f0ab70dc62e_1080x516.webp 1272w, https://substackcdn.com/image/fetch/$s_!Es66!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fed0fdfdf-1db5-47d2-beed-6f0ab70dc62e_1080x516.webp 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Label:</p><p><a href="https://www.harmony-developers.com/tag/%E6%95%B0%E6%8D%AE%E5%BA%93">database</a><a href="https://www.harmony-developers.com/tag/%E7%A8%8B%E5%BA%8F%E5%91%98">programmer</a></p><p>&#20316;&#32773;&#65306;&#29992;&#25143;26245236817<br>&#38142;&#25509;&#65306;https://juejin.cn/post/7348363874963783680<br>&#26469;&#28304;&#65306;&#31232;&#22303;&#25496;&#37329;<br>&#33879;&#20316;&#26435;&#24402;&#20316;&#32773;&#25152;&#26377;&#12290;&#21830;&#19994;&#36716;&#36733;&#35831;&#32852;&#31995;&#20316;&#32773;&#33719;&#24471;&#25480;&#26435;&#65292;&#38750;&#21830;&#19994;&#36716;&#36733;&#35831;&#27880;&#26126;&#20986;&#22788;&#12290;</p>]]></content:encoded></item><item><title><![CDATA[IOS Android Harmonyos next Pure code layout vs. pure (cross platform)]]></title><description><![CDATA[The comparison of the pure code layout of iOS, Android, and HarmonyOS 5/Next.]]></description><link>https://www.harmony-developers.com/p/ios-android-harmonyos-next-pure-code</link><guid isPermaLink="false">https://www.harmony-developers.com/p/ios-android-harmonyos-next-pure-code</guid><dc:creator><![CDATA[Benjamin Akhigbe]]></dc:creator><pubDate>Mon, 14 Apr 2025 19:57:53 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa13d975f-78e7-4180-a3e3-fba7cd061946_372x797.webp" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h4>Preface</h4><p>Hello everyone, Today I would like to share with you the comparison of the pure code layout of iOS, Android, and HarmonyOS Next. Because many students have a common problem is to rely too much on third-party frameworks, the basic skills are very poor, and even lazy, and they basically don't want to move when they encounter complex layouts.</p><h4>iOS code implementation</h4><pre><code>cpp</code></pre><p>&#20195;&#30721;&#35299;&#35835;</p><p>&#22797;&#21046;&#20195;&#30721;</p><p><code>// // LoginView.m // 016&#30331;&#24405;&#30028;&#38754; // // Created by xuqing on 2022/5/5. // #import "LoginView.h" #import "WHToast.h" #import "AFNetworking.h" #import "TextUtils.h" #import "ToastUtils.h" #import "RegisterView.h" @implementation LoginView @synthesize usernameLabel=_usernameLabel; @synthesize pswLabel=_passwordLabel; @synthesize userTextfield=_userTextfield; @synthesize pswfield=_passwordfield; @synthesize loginBtn=_loginBtn; @synthesize registerBtn=_registerBtn; @synthesize blackBgV=_blackBgV; @synthesize alertV=_alertV; - (instancetype)initWithFrame:(CGRect)frame { if (self = [super initWithFrame:frame]) { [self setUpSubView]; } return self; } - (void)setUpSubView { self.frame = [UIScreen mainScreen].bounds; // &#21021;&#22987;&#21270;&#36974;&#32617;&#35270;&#22270; self.blackBgV = [[UIView alloc]initWithFrame:self.bounds]; self.blackBgV.backgroundColor = [UIColor grayColor]; self.blackBgV.alpha = 0; [self addSubview:self.blackBgV]; // &#21021;&#22987;&#21270;actionSheetView self.alertV = [[UIView alloc] initWithFrame:CGRectMake(30,self.bounds.size.height/2-120, self.bounds.size.width-60, 240)]; self.alertV.backgroundColor = [UIColor whiteColor]; self.alertV.layer.cornerRadius = 5; self.alertV.layer.masksToBounds = YES; self.alertV.alpha = 0; [self addSubview:self.alertV]; _usernameLabel =[[UILabel alloc]init]; _usernameLabel.frame=CGRectMake(60, 50, 60, 40); _usernameLabel.text=@"&#36134;&#21495;:"; _usernameLabel.textColor=[UIColor blueColor]; [self.alertV addSubview:_usernameLabel]; _userTextfield =[[UITextField alloc] init]; _userTextfield.frame=CGRectMake(100, 50,180, 40); _userTextfield.font= [UIFont systemFontOfSize:15]; // &#35774;&#32622;&#23383;&#20307;&#39068;&#33394; _userTextfield.textColor=[UIColor blackColor]; //&#35774;&#32622;&#36793;&#26694;&#30340;&#39118;&#26684; // UITextBorderStyleBezel bezel&#32447;&#26694; // UITextBorderStyleRoundedRect &#22278;&#35282;&#39118;&#26684; // UITextBorderStyleLine &#32447;&#26694;&#39118;&#26684; // UITextBorderStyleNone &#26080;&#36793;&#26694;&#39118;&#26684; _userTextfield.borderStyle= UITextBorderStyleRoundedRect; //&#35774;&#32622;&#34394;&#25311;&#38190;&#30424;&#39118;&#26684; //UIKeyboardTypeDefault &#40664;&#35748;&#39118;&#26684; //UIKeyboardTypeNumberPad &#32431;&#25968;&#23383;&#39118;&#26684; //UIKeyboardTypeNamePhonePad &#23383;&#27597;&#21644;&#25968;&#23383;&#32452;&#21512;&#39118;&#26684; _userTextfield.keyboardType=UIKeyboardTypeNamePhonePad; _userTextfield.placeholder=@"&#35831;&#36755;&#20837;&#29992;&#25143;&#21517;..."; //&#26159;&#21542;&#20316;&#20026;&#23494;&#30721;&#36755;&#20837; //YES &#20570;&#20026;&#22788;&#29702; &#22278;&#28857;&#21152;&#23494; //NO: &#27491;&#24120;&#26174;&#31034;&#36755;&#20837;&#30340;&#25991;&#23383; _userTextfield.secureTextEntry= NO; [self.alertV addSubview: _userTextfield]; _passwordLabel =[[UILabel alloc]init]; _passwordLabel.frame=CGRectMake(60, 100, 60, 40); _passwordLabel.text=@"&#23494;&#30721;:"; _passwordLabel.textColor=[UIColor blueColor]; [self.alertV addSubview:_passwordLabel]; _passwordfield =[[UITextField alloc] init]; _passwordfield.frame=CGRectMake(100, 100,180, 40); _passwordfield.font= [UIFont systemFontOfSize:15]; // &#35774;&#32622;&#23383;&#20307;&#39068;&#33394; _passwordfield.textColor=[UIColor blackColor]; //&#35774;&#32622;&#36793;&#26694;&#30340;&#39118;&#26684; // UITextBorderStyleBezel bezel&#32447;&#26694; // UITextBorderStyleRoundedRect &#22278;&#35282;&#39118;&#26684; // UITextBorderStyleLine &#32447;&#26694;&#39118;&#26684; // UITextBorderStyleNone &#26080;&#36793;&#26694;&#39118;&#26684; _passwordfield.borderStyle= UITextBorderStyleRoundedRect; //&#35774;&#32622;&#34394;&#25311;&#38190;&#30424;&#39118;&#26684; //UIKeyboardTypeDefault &#40664;&#35748;&#39118;&#26684; //UIKeyboardTypeNumberPad &#32431;&#25968;&#23383;&#39118;&#26684; //UIKeyboardTypeNamePhonePad &#23383;&#27597;&#21644;&#25968;&#23383;&#32452;&#21512;&#39118;&#26684; _passwordfield.keyboardType=UIKeyboardTypeNamePhonePad; _passwordfield.placeholder=@"&#35831;&#36755;&#20837;&#23494;&#30721;..."; //&#26159;&#21542;&#20316;&#20026;&#23494;&#30721;&#36755;&#20837; //YES &#20570;&#20026;&#22788;&#29702; &#22278;&#28857;&#21152;&#23494; //NO: &#27491;&#24120;&#26174;&#31034;&#36755;&#20837;&#30340;&#25991;&#23383; _passwordfield.secureTextEntry= YES; [self.alertV addSubview: _passwordfield]; _loginBtn=[UIButton buttonWithType: UIButtonTypeRoundedRect]; _loginBtn.frame=CGRectMake(80, 160, 80, 40); [_loginBtn setTitle:@"&#30331;&#24405;" forState:UIControlStateNormal]; [_loginBtn addTarget:self action:@selector(login) forControlEvents:UIControlEventTouchUpInside]; _loginBtn.backgroundColor=[UIColor blueColor]; [_loginBtn setTitleColor: [UIColor whiteColor ] forState:UIControlStateNormal] ; //&#35774;&#32622;&#25353;&#38062;&#39068;&#33394; [_loginBtn setTitleColor: [UIColor grayColor] forState:UIControlStateHighlighted] ; [self.alertV addSubview:_loginBtn]; _registerBtn=[UIButton buttonWithType:UIButtonTypeRoundedRect]; _registerBtn.frame=CGRectMake(180, 160, 80, 40); [_registerBtn setTitle:@"&#27880;&#20876;" forState:UIControlStateNormal]; [_registerBtn addTarget:self action:@selector(registerMethod) forControlEvents:UIControlEventTouchUpInside]; _registerBtn.backgroundColor=[UIColor blueColor]; [_registerBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; [self.alertV addSubview:_registerBtn]; } -(void)registerMethod{ [self hidden]; RegisterView * registerview=[[RegisterView alloc]init]; registerview.registerBlock=_logBlock; [registerview show]; } -(void)login{ NSString * _strTextName=_userTextfield.text; NSString * _strTextPsw=_passwordfield.text; if(![TextUtils isBlankString:_strTextName] &amp;&amp;![TextUtils isBlankString:_strTextPsw]){ NSLog(@"&#30331;&#24405;&#25104;&#21151;"); NSLog(@"%@ %@",_strTextName,_strTextPsw); NSString * registerString=@"http://175.178.200.180:8090/boss/user/validlogin?"; NSString * str1=@"username="; NSString * str2=@"password="; NSMutableString *geturl = [NSMutableString string]; [geturl appendString:registerString]; [geturl appendString:str1]; [geturl appendString:_strTextName]; [geturl appendString:@"&amp;"]; [geturl appendString:str2]; [geturl appendString:_strTextPsw]; NSLog(@" geturl --- &gt; %@",geturl); [[AFHTTPSessionManager manager]GET:geturl parameters:nil headers:nil progress:^(NSProgress * _Nonnull downloadProgress) { NSLog(@""); } success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) { NSLog(@""); NSLog(@"&#35831;&#27714;&#25104;&#21151;---%@",responseObject); NSLog(@"&#35831;&#27714; msg ---%@",[responseObject objectForKey:(@"msg")]); NSString * msg=[responseObject objectForKey:(@"msg")]; NSInteger code = [[responseObject objectForKey:(@"code")] integerValue]; if(code==200){ if (self.logBlock) { //&#32531;&#23384;token NSString * token=[responseObject objectForKey:(@"token")]; NSUserDefaults * ud =[NSUserDefaults standardUserDefaults]; [ud setObject:token forKey:@"token"]; self.logBlock(YES, responseObject); [self hidden]; } }else{ [ToastUtils showInfo:msg]; } } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) { NSLog(@""); }]; }else { [ToastUtils showInfo:@"&#36134;&#21495;&#25110;&#32773;&#23494;&#30721;&#19981;&#33021;&#20026;&#31354;" ]; } } - (void)show { [self setUpSubView]; [[UIApplication sharedApplication].keyWindow addSubview:self]; self.hidden = NO; [UIView animateWithDuration:0.3 animations:^{ self.alertV.alpha = 1; self.blackBgV.alpha = 0.5; } completion:^(BOOL finished) { }]; } - (void)hidden { __block typeof(self) weakSelf = self; [UIView animateWithDuration:0.3 animations:^{ self.alertV.alpha = 0; self.blackBgV.alpha = 0; } completion:^(BOOL finished) { weakSelf.hidden = YES; [weakSelf removeFromSuperview]; }]; } #pragma mark -- &#36974;&#32617;&#35270;&#22270;&#28857;&#20987; - (void)tapClick:(UIGestureRecognizer *)tap { NSLog(@"&#36974;&#32617;&#35270;&#22270;&#28857;&#20987;"); } @end</code></p><h4>Renderings</h4><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!owQ1!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f2beec5-65aa-4fcf-bcbc-a19e251ec0ce_730x1572.webp" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!owQ1!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f2beec5-65aa-4fcf-bcbc-a19e251ec0ce_730x1572.webp 424w, https://substackcdn.com/image/fetch/$s_!owQ1!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f2beec5-65aa-4fcf-bcbc-a19e251ec0ce_730x1572.webp 848w, https://substackcdn.com/image/fetch/$s_!owQ1!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f2beec5-65aa-4fcf-bcbc-a19e251ec0ce_730x1572.webp 1272w, https://substackcdn.com/image/fetch/$s_!owQ1!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f2beec5-65aa-4fcf-bcbc-a19e251ec0ce_730x1572.webp 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!owQ1!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f2beec5-65aa-4fcf-bcbc-a19e251ec0ce_730x1572.webp" width="730" height="1572" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/2f2beec5-65aa-4fcf-bcbc-a19e251ec0ce_730x1572.webp&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1572,&quot;width&quot;:730,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;image.png&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="image.png" title="image.png" srcset="https://substackcdn.com/image/fetch/$s_!owQ1!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f2beec5-65aa-4fcf-bcbc-a19e251ec0ce_730x1572.webp 424w, https://substackcdn.com/image/fetch/$s_!owQ1!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f2beec5-65aa-4fcf-bcbc-a19e251ec0ce_730x1572.webp 848w, https://substackcdn.com/image/fetch/$s_!owQ1!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f2beec5-65aa-4fcf-bcbc-a19e251ec0ce_730x1572.webp 1272w, https://substackcdn.com/image/fetch/$s_!owQ1!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f2beec5-65aa-4fcf-bcbc-a19e251ec0ce_730x1572.webp 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h4>Android code implementation</h4><pre><code>ini</code></pre><p>&#20195;&#30721;&#35299;&#35835;</p><p>&#22797;&#21046;&#20195;&#30721;</p><p><code>package com.example.myapplication; import android.app.Dialog; import android.content.Context; import android.graphics.Color; import android.os.Bundle; import android.text.InputType; import android.util.DisplayMetrics; import android.view.Gravity; import android.view.Window; import android.widget.Button; import android.widget.EditText; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.RelativeLayout; import android.widget.TextView; import androidx.appcompat.widget.AppCompatCheckBox; /** * *&#21019;&#24314;&#20154;&#65306;xuqing *&#21019;&#24314;&#26102;&#38388;&#65306;2025&#24180;1&#26376;26&#26085;15:18:50 * &#31867;&#35828;&#26126;&#65306;&#30331;&#24405;&#24377;&#20986; * */ public class LoginDialog extends Dialog { protected final static int MATCH_PARENT = LinearLayout.LayoutParams.MATCH_PARENT; protected final static int WRAP_CONTENT = LinearLayout.LayoutParams.WRAP_CONTENT; protected final int _10dp = DisplayUtils.dip2Px(getContext(), 10); protected final int _5dp = DisplayUtils.dip2Px(getContext(), 5); protected final int _32dp = DisplayUtils.dip2Px(getContext(), 32); protected final int _20dp = DisplayUtils.dip2Px(getContext(), 20); public static final String C_COMFIRM = "#FF26ADF0"; public static final String C_COMFIRM_P = "#DD26ADF0"; public static final String C_CANCEL = "#FFCCCCCC"; public static final String C_CANCEL_P = "#DDCCCCCC"; private Context mContext; protected LinearLayout mParentView; protected LinearLayout mContentView; private EditText editAccount; private EditText editPwd; protected LinearLayout editAccountiLlView; protected LinearLayout editPwdLlView; protected LinearLayout buttomLlView; private TextView accountText; private TextView editPwdText; private RelativeLayout editAccountRl; private RelativeLayout editPwdRl; public LoginDialog(Context context) { super(context); this.mContext = context; } @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); getWindow().setBackgroundDrawableResource(android.R.color.transparent); getWindow().requestFeature(Window.FEATURE_NO_TITLE); mParentView = new LinearLayout(getContext()); mParentView.setOrientation(LinearLayout.VERTICAL); mParentView.setPadding(0, 0, _5dp, _5dp); mParentView.setBackground(DrawableUtils.createShape(0, 0, 0, "#ffffff", "#ffffff"));//#ffffff mContentView=new LinearLayout(getContext()); mContentView.setOrientation(LinearLayout.VERTICAL); LinearLayout.LayoutParams mContentViewlayoutparams=new LinearLayout.LayoutParams( DisplayUtils.dip2Px(getContext(), 255), DisplayUtils.dip2Px(getContext(), 255)); mContentView.setLayoutParams(mContentViewlayoutparams); mContentView.setGravity(Gravity.CENTER); // &#36134;&#21495;&#36755;&#20837;&#26694; editAccount = addNOBgEditText(); //suakuds_pinputaccount_str editAccount.setHint("&#35831;&#36755;&#20837;&#36134;&#21495;"); //editAccount.setText("huangyueze"); RelativeLayout.LayoutParams editAccountlayoutParams = new RelativeLayout.LayoutParams( LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT); editAccountlayoutParams.setMargins(dip2px(0),0,dip2px(30),0); editAccount.setLayoutParams(editAccountlayoutParams); accountText =addTextView(); LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams( LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT); accountText.setLayoutParams(layoutParams); accountText.setText("&#36134;&#21495;:"); layoutParams.setMargins(dip2px(20),0,0,0); editAccountRl=new RelativeLayout(getContext()); RelativeLayout.LayoutParams editAccountRllayoutParams = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT, RelativeLayout.LayoutParams.MATCH_PARENT); editAccountRl.setBackground(DrawableUtils.createShape(1, 10, -1, "#000000", "#ffffff")); editAccountRl.setLayoutParams(editAccountRllayoutParams); editAccountRllayoutParams.setMargins(dip2px(10),0,0,0); editAccountRl.addView(editAccount,editAccountlayoutParams); //&#36134;&#21495;&#32447;&#24615;&#24067;&#23616; editAccountiLlView=new LinearLayout(getContext()); LinearLayout.LayoutParams editAccountiLlViewlayoutParams = new LinearLayout.LayoutParams( LinearLayout.LayoutParams.MATCH_PARENT, dip2px(40)); editAccountiLlView.setLayoutParams(editAccountiLlViewlayoutParams); editAccountiLlView.setOrientation(LinearLayout.HORIZONTAL); editAccountiLlView.setGravity(Gravity.CENTER); editAccountiLlView.setPadding(0, 0, _5dp, _5dp); editAccountiLlView.addView(accountText,layoutParams); editAccountiLlView.addView(editAccountRl,editAccountRllayoutParams); mContentView.addView(editAccountiLlView, editAccountiLlViewlayoutParams); // &#23494;&#30721;&#36755;&#20837;&#26694; editPwd = addNOBgEditText(); LinearLayout.LayoutParams editPwdlayoutParams = new LinearLayout.LayoutParams( LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT); editPwd.setLayoutParams(editPwdlayoutParams); editPwdlayoutParams.setMargins(dip2px(0),0,dip2px(30),0); editPwd.setGravity(Gravity.CENTER_VERTICAL); editPwd.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD); //suakuds_pinputpwd_str editPwd.setHint("&#35831;&#36755;&#20837;&#23494;&#30721;"); editPwdText = addTextView(); LinearLayout.LayoutParams editPwdImagelayoutParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT);; editPwdText.setLayoutParams(editPwdImagelayoutParams); editPwdText.setText("&#23494;&#30721;:"); editPwdImagelayoutParams.setMargins(dip2px(20),0,0,0); //&#36134;&#21495;&#32447;&#24615;&#24067;&#23616; editPwdLlView=new LinearLayout(getContext()); editPwdRl=new RelativeLayout(getContext()); LinearLayout.LayoutParams editPwdRllayoutParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT); editPwdRl.setBackground(DrawableUtils.createShape(1, 10, -1, "#000000", "#ffffff")); editPwdRl.setLayoutParams(editPwdRllayoutParams); editPwdRllayoutParams.setMargins(dip2px(10),0,0,0); editPwdRl.addView(editPwd,editPwdlayoutParams); LinearLayout.LayoutParams editPwdLlViewlayoutParams = new LinearLayout.LayoutParams( LinearLayout.LayoutParams.MATCH_PARENT, dip2px(40)); editPwdLlView.setLayoutParams(editPwdLlViewlayoutParams); editPwdLlView.setOrientation(LinearLayout.HORIZONTAL); editPwdLlView.setGravity(Gravity.CENTER); editPwdLlView.setPadding(0, 0, _5dp, _5dp); editPwdLlView.addView(editPwdText,editPwdImagelayoutParams); editPwdLlView.addView(editPwdRl,editPwdRllayoutParams); mContentView.addView(editPwdLlView, editPwdLlViewlayoutParams); LinearLayout btnLayout = new LinearLayout(getContext()); btnLayout.setOrientation(LinearLayout.HORIZONTAL); btnLayout.setGravity(Gravity.CENTER); LinearLayout.LayoutParams btnLayoutlayoutParams = new LinearLayout.LayoutParams( LinearLayout.LayoutParams.MATCH_PARENT, dip2px(32)); btnLayoutlayoutParams.setMargins(dip2px(40),dip2px(20),dip2px(20),0); LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(0, _32dp); lp.weight = 1; lp.setMargins(_5dp, _5dp, _5dp, _5dp); Button registerBtn = addCancelBtn("&#27880;&#20876;"); btnLayout.addView(registerBtn, lp); //&#28155;&#21152;&#30331;&#38470; lp = new LinearLayout.LayoutParams(0, _32dp); lp.weight = 1; //suakuds_login Button loginBtn = addConfirmBtn("&#30331;&#24405;"); btnLayout.addView(loginBtn, lp); mContentView.addView(btnLayout,btnLayoutlayoutParams); mParentView.addView(mContentView,mContentViewlayoutparams); setContentView(mParentView, new LinearLayout.LayoutParams(MATCH_PARENT, MATCH_PARENT)); } @Override public void show() { super.show(); DisplayMetrics dmDisplayMetrics = new DisplayMetrics(); //&#20026;&#33719;&#21462;&#23631;&#24149;&#23485;&#12289;&#39640; getWindow().getWindowManager().getDefaultDisplay().getMetrics(dmDisplayMetrics); android.view.WindowManager.LayoutParams p = this.getWindow().getAttributes(); //&#33719;&#21462;&#23545;&#35805;&#26694;&#24403;&#21069;&#30340;&#21442;&#25968;&#20540; p.gravity = Gravity.CENTER; this.getWindow().setLayout(DisplayUtils.dip2Px(getContext(), 300), DisplayUtils.dip2Px(getContext(), 250)); } public int dip2px(float dpValue) { final float scale = getContext().getResources().getDisplayMetrics().density; return (int) (dpValue * scale + 0.5f); } protected TextView addTextView() { TextView tv = new TextView(getContext()); tv.setTextColor(0xff222222); tv.setTextSize(12); tv.setGravity(Gravity.CENTER_VERTICAL); return tv; } protected EditText addNOBgEditText() { EditText et = new EditText(getContext()); et.setSingleLine(); et.setMinHeight(_32dp); et.setGravity(Gravity.CENTER_VERTICAL); et.setPadding(dp(5), 5, dp(2), 0); et.setTextSize(dp(5)); et.setTextColor(Color.BLACK); et.setInputType(InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD); et.setBackground(null); return et; } protected int dp(int _dp) { return DisplayUtils.dip2Px(getContext(), _dp); } //&#28155;&#21152;&#21462;&#28040;&#25353;&#38062; protected Button addCancelBtn(String text) { Button cancelBtn = new Button(getContext()); //cancelBtn.setTextSize(10); cancelBtn.setTextColor(Color.WHITE); cancelBtn.setAllCaps(false); cancelBtn.setBackground(DrawableUtils.createStateDrawable(_5dp, C_COMFIRM, C_COMFIRM_P)); cancelBtn.setText(text); cancelBtn.setPadding(_5dp, _5dp, _5dp, _5dp); return cancelBtn; } protected Button addConfirmBtn(String text) { Button confirmBtn = new Button(getContext()); confirmBtn.setTextColor(Color.WHITE); confirmBtn.setAllCaps(false); confirmBtn.setBackground(DrawableUtils.createStateDrawable(_5dp, C_COMFIRM, C_COMFIRM_P)); confirmBtn.setText(text); confirmBtn.setPadding(_5dp, _5dp, _5dp, _5dp); return confirmBtn; } }</code></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!ii-7!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F18e74131-2bd7-4f35-b5e0-82e7cc46ef62_1080x2400.webp" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ii-7!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F18e74131-2bd7-4f35-b5e0-82e7cc46ef62_1080x2400.webp 424w, https://substackcdn.com/image/fetch/$s_!ii-7!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F18e74131-2bd7-4f35-b5e0-82e7cc46ef62_1080x2400.webp 848w, https://substackcdn.com/image/fetch/$s_!ii-7!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F18e74131-2bd7-4f35-b5e0-82e7cc46ef62_1080x2400.webp 1272w, https://substackcdn.com/image/fetch/$s_!ii-7!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F18e74131-2bd7-4f35-b5e0-82e7cc46ef62_1080x2400.webp 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ii-7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F18e74131-2bd7-4f35-b5e0-82e7cc46ef62_1080x2400.webp" width="1080" height="2400" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/18e74131-2bd7-4f35-b5e0-82e7cc46ef62_1080x2400.webp&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:2400,&quot;width&quot;:1080,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;efc49160b0c8bd12ce3793bcc97177d0.jpeg&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="efc49160b0c8bd12ce3793bcc97177d0.jpeg" title="efc49160b0c8bd12ce3793bcc97177d0.jpeg" srcset="https://substackcdn.com/image/fetch/$s_!ii-7!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F18e74131-2bd7-4f35-b5e0-82e7cc46ef62_1080x2400.webp 424w, https://substackcdn.com/image/fetch/$s_!ii-7!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F18e74131-2bd7-4f35-b5e0-82e7cc46ef62_1080x2400.webp 848w, https://substackcdn.com/image/fetch/$s_!ii-7!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F18e74131-2bd7-4f35-b5e0-82e7cc46ef62_1080x2400.webp 1272w, https://substackcdn.com/image/fetch/$s_!ii-7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F18e74131-2bd7-4f35-b5e0-82e7cc46ef62_1080x2400.webp 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h4>HarmonyOSNext &#31471;</h4><pre><code>scss</code></pre><p>&#20195;&#30721;&#35299;&#35835;</p><p>&#22797;&#21046;&#20195;&#30721;</p><p><code>/** * &#33258;&#23450;&#20041;&#20013;&#38388;&#24377;&#31383; */ //&#32447;&#26465;&#26679;&#24335; @Extend(Line) function lineStyle(){ .width('100%') .height(1) .backgroundColor($r('app.color.line_color')) } //&#40657;&#33394;&#23383;&#20307;&#26679;&#24335; @Extend(Text) function blackTextStyle(){ .fontColor($r('app.color.black_text_color')) .fontSize(18) .fontWeight(FontWeight.Medium) } @Extend(TextInput) function inputStyle(){ .placeholderColor($r('app.color.placeholder_color')) .height(45) .fontSize(18) .backgroundColor($r('app.color.background')) .width('100%') .padding({left:0}) .margin({top:12}) } export class LoginCenterPopup extends BaseCenterPopup&lt;CenterBean&gt; { private data = new CenterBean() constructor() { super(wrapBuilder(customPopupBuilder)) this.setParams(this.data) this.data.dismiss = () =&gt; { this.dismiss() } } } @Builder function customPopupBuilder(data: CenterBean) { Column() { Row(){ Text('&#36134;&#21495;').blackTextStyle() TextInput({placeholder:'&#35831;&#36755;&#20837;&#36134;&#21495;'}) .width('100%') .height(35) .type(InputType.Normal) .margin(5) .onChange((value:string)=&gt;{ DataStoreController.getInstance().setUsername(value); }).margin({left:20}) .onSecurityStateChange(((isShowPassword: boolean) =&gt; { // &#26356;&#26032;&#23494;&#30721;&#26174;&#31034;&#29366;&#24577; console.info('isShowPassword', isShowPassword) })).backgroundColor("#00000000") .layoutWeight(1) .borderRadius(8) }.justifyContent(FlexAlign.SpaceBetween) .width('100%') .margin({top:8}) Line().lineStyle().margin({left:80,right:10}) Row(){ Text('&#23494;&#30721;').blackTextStyle() TextInput({placeholder:'&#35831;&#36755;&#20837;&#23494;&#30721;'}) .width('100%') .height(35) .type(InputType.Normal) .margin(5) .onChange((value:string)=&gt;{ DataStoreController.getInstance().setpasswroid(value); }).margin({left:20}) .onSecurityStateChange(((isShowPassword: boolean) =&gt; { // &#26356;&#26032;&#23494;&#30721;&#26174;&#31034;&#29366;&#24577; console.info('isShowPassword', isShowPassword) })).backgroundColor("#00000000") .layoutWeight(1) .borderRadius(8) }.justifyContent(FlexAlign.SpaceBetween) .width('100%') .margin({top:8}) Line().lineStyle().margin({left:80,right:10}) //Line().lineStyle().margin({left:80,right:10}) Row({space:10}){ Button('&#30331;&#24405;',{type:ButtonType.Capsule}) .width('90%') .height(40) .fontSize(16) .fontWeight(FontWeight.Medium) .backgroundColor($r('app.color.login_button_color')) .margin({top:47,bottom:12}) .onClick(()=&gt;{ }).layoutWeight(1) Button('&#27880;&#20876;',{type:ButtonType.Capsule}) .width('90%') .height(40) .fontSize(16) .fontWeight(FontWeight.Medium) .backgroundColor($r('app.color.login_button_color')) .margin({top:47,bottom:12}) .onClick(()=&gt;{ }).layoutWeight(1) }.justifyContent(FlexAlign.SpaceBetween) .width('100%') .margin({top:8}) } }</code></p><h4>Renderings</h4><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!sKL6!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa13d975f-78e7-4180-a3e3-fba7cd061946_372x797.webp" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!sKL6!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa13d975f-78e7-4180-a3e3-fba7cd061946_372x797.webp 424w, https://substackcdn.com/image/fetch/$s_!sKL6!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa13d975f-78e7-4180-a3e3-fba7cd061946_372x797.webp 848w, https://substackcdn.com/image/fetch/$s_!sKL6!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa13d975f-78e7-4180-a3e3-fba7cd061946_372x797.webp 1272w, https://substackcdn.com/image/fetch/$s_!sKL6!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa13d975f-78e7-4180-a3e3-fba7cd061946_372x797.webp 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!sKL6!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa13d975f-78e7-4180-a3e3-fba7cd061946_372x797.webp" width="372" height="797" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a13d975f-78e7-4180-a3e3-fba7cd061946_372x797.webp&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:797,&quot;width&quot;:372,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;image.png&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="image.png" title="image.png" srcset="https://substackcdn.com/image/fetch/$s_!sKL6!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa13d975f-78e7-4180-a3e3-fba7cd061946_372x797.webp 424w, https://substackcdn.com/image/fetch/$s_!sKL6!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa13d975f-78e7-4180-a3e3-fba7cd061946_372x797.webp 848w, https://substackcdn.com/image/fetch/$s_!sKL6!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa13d975f-78e7-4180-a3e3-fba7cd061946_372x797.webp 1272w, https://substackcdn.com/image/fetch/$s_!sKL6!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa13d975f-78e7-4180-a3e3-fba7cd061946_372x797.webp 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h4>contrast</h4><p>We compare the complexity of coding and the difficulty of reading, and our HarmonyOSnext is more simplified and easy to use, and at this time, someone jumped out and said that we have a swift ui in iOS, and that can also do declarative UI, yes, but in the beginning, there was only object-c, so any platform and language needs to be constantly developed to get to where we are today, and the same is true for Android, which uses kotlin with jetpack compose can also implement a similar declarative UI, but at the beginning, there was only a Java pure code layout or java+xml layout, which is why HarmonyOSnext has a late-mover advantage over the native Android and native ios, making up for the shortcomings of its predecessors and giving full play to its own advantages.</p><h4>Comparison of design concepts</h4><ul><li><p>iOS</p></li></ul><p>The pure code layout of ios has CGRectMake to set the x-y coordinates and width and height for us, the upper left corner of the screen is the origin, the horizontal is the right axis, and the vertical downward is the y-axis. It was the design which was relatively OK in that era.</p><ul><li><p>Android</p></li></ul><p>Android's pure code layout does not have the method of setting coordinates like ios, mainly through viewgroup to nest and wrap our view or other viewgroups, and finally add to our layout by calling addview, the code is relatively cumbersome and not easy to read. It's a copy of the XML layout. This is still a relatively high requirement for the programmer itself.</p><ul><li><p>HarmonyOSNext</p></li></ul><p>The pure code of HarmonyOSNext is innate, and the official designation is to use ArkUI to write layouts with the previewer, and the effect of WYSIWYG can be achieved, and the code reading is relatively clear and straightforward. Just like building blocks, we load child components through parent layouts such as linear and relative layouts, and it's easy to achieve the UI we want.</p><h4>Final Summary:</h4><p>Whether it's Android ios or other students who have turned over to learn HarmonyOSNext development, I very much recommend learning the basic skills, don't have xml similar to Android xml similar to xib in ios There is no similar front-end of various frameworks I don't want to learn, it's not necessary at all, the official components are already relatively rich, and the third-party library is also constantly improving, I wish every student can learn well and find a good job, and I hope that the domestic system is getting better and better. That's all for today's article, if you think the article is not bad, you can give me a one-click triple. If you are interested, follow my B station tutorial to learn more about the knowledge of Hongmeng development, you can pay attention to the nut pie public account. Thank you</p><h3>Course address</h3><p><a href="https://link.juejin.cn?target=https%3A%2F%2Fwww.bilibili.com%2Fcheese%2Fplay%2Fss25125">www.bilibili.com/cheese/play&#8230;</a></p><h3>Project Description:</h3><ul><li><p>1 Learn common layout components</p></li><li><p>2 Network request tool class encapsulation</p></li><li><p>3 Arkui Lifecycle Initiation Process</p></li><li><p>4 Encapsulation of the log tool class</p></li><li><p>5 Encapsulation of custom combination components</p></li><li><p>6 Use of Route Navigation Jumps</p></li><li><p>7 Caching of local data and the encapsulation of caching tools</p></li><li><p>8 Implementation of the Welcome Page</p></li><li><p>9 Login Cases and Automatic Login Effect Implementation</p></li><li><p>10 Request Network Data Paging Pull-Up Load Implementation of pull-down refresh</p></li><li><p>11 list data lazy loading implementation</p></li><li><p>12 Use of the WebView Component</p></li></ul><h4>If you use more easy-to-use HarmonyOS NEXT third-party libraries</h4><p>&#20316;&#32773;&#65306;&#22362;&#26524;&#27966;_xq9527<br>&#38142;&#25509;&#65306;https://juejin.cn/post/7463871170015559695<br>&#26469;&#28304;&#65306;&#31232;&#22303;&#25496;&#37329;<br>&#33879;&#20316;&#26435;&#24402;&#20316;&#32773;&#25152;&#26377;&#12290;&#21830;&#19994;&#36716;&#36733;&#35831;&#32852;&#31995;&#20316;&#32773;&#33719;&#24471;&#25480;&#26435;&#65292;&#38750;&#21830;&#19994;&#36716;&#36733;&#35831;&#27880;&#26126;&#20986;&#22788;&#12290;</p><p>Original date: 2025-01-26 </p>]]></content:encoded></item><item><title><![CDATA[[HarmonyOS 5] HarmonyOS implements a handwriting tablet ]]></title><description><![CDATA[Create an interactive component where when the user touches and moves their finger on the screen, a path is dynamically generated based on the position of the touch and drawn on the screen.]]></description><link>https://www.harmony-developers.com/p/harmonyos-5-harmonyos-implements</link><guid isPermaLink="false">https://www.harmony-developers.com/p/harmonyos-5-harmonyos-implements</guid><dc:creator><![CDATA[Harmony OS Developers]]></dc:creator><pubDate>Mon, 14 Apr 2025 19:32:00 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!OWqG!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbadc65f5-e49a-4b2d-b2fd-85cea1b02ba4_451x1053.webp" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2>[HarmonyOS 5] HarmonyOS implements a handwriting tablet</h2><h3>I. Introduction</h3><p><strong>The basic idea of implementing a tablet function is as follows:</strong></p><p>Create an interactive component where when the user touches and moves their finger on the screen, a path is dynamically generated based on the position of the touch and drawn on the screen with a black stroke. When the user presses the screen, the coordinates of the press point are recorded as the starting point of the path. When the user moves his finger, the coordinates of the moving points are constantly recorded, and the path is formed by connecting the line segments.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!OWqG!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbadc65f5-e49a-4b2d-b2fd-85cea1b02ba4_451x1053.webp" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!OWqG!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbadc65f5-e49a-4b2d-b2fd-85cea1b02ba4_451x1053.webp 424w, https://substackcdn.com/image/fetch/$s_!OWqG!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbadc65f5-e49a-4b2d-b2fd-85cea1b02ba4_451x1053.webp 848w, https://substackcdn.com/image/fetch/$s_!OWqG!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbadc65f5-e49a-4b2d-b2fd-85cea1b02ba4_451x1053.webp 1272w, https://substackcdn.com/image/fetch/$s_!OWqG!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbadc65f5-e49a-4b2d-b2fd-85cea1b02ba4_451x1053.webp 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!OWqG!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbadc65f5-e49a-4b2d-b2fd-85cea1b02ba4_451x1053.webp" width="451" height="1053" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/badc65f5-e49a-4b2d-b2fd-85cea1b02ba4_451x1053.webp&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1053,&quot;width&quot;:451,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;image.png&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="image.png" title="image.png" srcset="https://substackcdn.com/image/fetch/$s_!OWqG!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbadc65f5-e49a-4b2d-b2fd-85cea1b02ba4_451x1053.webp 424w, https://substackcdn.com/image/fetch/$s_!OWqG!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbadc65f5-e49a-4b2d-b2fd-85cea1b02ba4_451x1053.webp 848w, https://substackcdn.com/image/fetch/$s_!OWqG!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbadc65f5-e49a-4b2d-b2fd-85cea1b02ba4_451x1053.webp 1272w, https://substackcdn.com/image/fetch/$s_!OWqG!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbadc65f5-e49a-4b2d-b2fd-85cea1b02ba4_451x1053.webp 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><strong>The functional renderings are as follows:</strong></p><h3>Second, the idea of the program</h3><p>The system provides a very convenient line drawing component Path. This component combines canvas and line drawing functions into one. A concise line drawing component is provided.</p><p><strong>For more information, see</strong> Path-Graph-Draw-ArkTS Components-ArkUI (Ark UI Framework)-Application Frameworks - Huawei HarmonyOS Developer <a href="https://developer.huawei.com/consumer/en/doc/harmonyos-guides-V14/drawing-guidelines-V14">https://developer.huawei.com/consumer/en/doc/harmonyos-guides-V14/drawing-guidelines-V14</a></p><p><strong>The idea of using the Path component is very simple, as shown in the following code:</strong></p><pre><code>javascript</code></pre><p>Code interpretation</p><p>Copy the code</p><p><code>Path() .commands(this.pathCommands) // &#35774;&#32622;SVG&#36335;&#24452;&#25551;&#36848;&#23383;&#31526;&#20018; .strokeWidth(5) // &#35774;&#32622;&#36335;&#24452;&#30340;&#25551;&#36793;&#23485;&#24230;&#20026; 5 .fill("none") // &#35774;&#32622;&#36335;&#24452;&#30340;&#22635;&#20805;&#39068;&#33394;&#20026;&#26080; .stroke(Color.Black) // &#35774;&#32622;&#36335;&#24452;&#30340;&#25551;&#36793;&#39068;&#33394;&#20026;&#40657;&#33394; .height('100%') .width('100%')</code></p><p><strong>1. Set the width and height of the component to the size of the canvas area to be displayed.</strong></p><p>height and width are 100 percent.</p><p><strong>2. Set the style, color, and width of the line.</strong></p><p>stroke is Color.Black and strokeWidth is 5</p><p><strong>3. Set the color of the filled area where the closed is drawn.</strong></p><p>fill is none</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!iTOp!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c9b511d-f69b-4a2c-8813-07aa9ade1af4_296x311.webp" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!iTOp!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c9b511d-f69b-4a2c-8813-07aa9ade1af4_296x311.webp 424w, https://substackcdn.com/image/fetch/$s_!iTOp!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c9b511d-f69b-4a2c-8813-07aa9ade1af4_296x311.webp 848w, https://substackcdn.com/image/fetch/$s_!iTOp!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c9b511d-f69b-4a2c-8813-07aa9ade1af4_296x311.webp 1272w, https://substackcdn.com/image/fetch/$s_!iTOp!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c9b511d-f69b-4a2c-8813-07aa9ade1af4_296x311.webp 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!iTOp!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c9b511d-f69b-4a2c-8813-07aa9ade1af4_296x311.webp" width="296" height="311" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5c9b511d-f69b-4a2c-8813-07aa9ade1af4_296x311.webp&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:311,&quot;width&quot;:296,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;image.png&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="image.png" title="image.png" srcset="https://substackcdn.com/image/fetch/$s_!iTOp!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c9b511d-f69b-4a2c-8813-07aa9ade1af4_296x311.webp 424w, https://substackcdn.com/image/fetch/$s_!iTOp!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c9b511d-f69b-4a2c-8813-07aa9ade1af4_296x311.webp 848w, https://substackcdn.com/image/fetch/$s_!iTOp!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c9b511d-f69b-4a2c-8813-07aa9ade1af4_296x311.webp 1272w, https://substackcdn.com/image/fetch/$s_!iTOp!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c9b511d-f69b-4a2c-8813-07aa9ade1af4_296x311.webp 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>If you change the fill color, you will get the following effect:</p><p>Since this effect is not required for the tablet, you need to set fill to none, not fill color.</p><p><strong>4. Set the SVG path description string.</strong></p><p>The most core property of the component. Its value is a string and looks something like this:</p><pre><code>javascript</code></pre><p>Code interpretation</p><p>Copy the code</p><p><code>M225.99999999999997 409.99999999999994 L225.99999999999997 409.99999999999994</code></p><p><strong>First, let's understand what the SVG path descriptor does.</strong></p><p>SVG path descriptors are a set of commands used to define vector graphics paths, and play a key role in drawing graphics using the Path component, creating a variety of complex custom shapes. The main functions are as follows:</p><p><strong>(1) Build a basic graph:</strong></p><p>The M (moveto) command is used to determine the starting point, and the L (lineto), H (horizontal lineto), V (vertical lineto) and other commands are used to draw straight line segments, and basic shapes such as triangles and rectangles can be constructed. For example, commands('M0 20 L50 50 L50 100 Z') defines a triangle that starts at (0,20), draws two straight segments, and ends with the Z(closepath) command to close the path.</p><p><strong>(2) Draw a curve graph:</strong></p><p>With the help of C (curveto), S (smooth curveto), Q (quadratic Belzier curve), T (smooth quadratic Belzier curveto) and other commands, different types of Bezier curves can be drawn to achieve complex curve drawing. Like C100 100 250 100 250 200 you can draw a cubic Bezier curve from the current point to the (250, 200) point, which can be used to create curve shapes such as petals, wavy lines, etc.</p><p><strong>(3) Draw elliptical arcs:</strong></p><p>The A (elliptical arc) command is used to draw elliptical arcs from the current point to a specified point, and by setting the radius, rotation angle, and other flags of the ellipse, you can draw partial arcs of various elliptical shapes, such as the sectors of a pie chart.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!K9_7!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F993aa706-c16e-4d3f-937b-aec0e812c546_332x442.webp" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!K9_7!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F993aa706-c16e-4d3f-937b-aec0e812c546_332x442.webp 424w, https://substackcdn.com/image/fetch/$s_!K9_7!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F993aa706-c16e-4d3f-937b-aec0e812c546_332x442.webp 848w, https://substackcdn.com/image/fetch/$s_!K9_7!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F993aa706-c16e-4d3f-937b-aec0e812c546_332x442.webp 1272w, https://substackcdn.com/image/fetch/$s_!K9_7!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F993aa706-c16e-4d3f-937b-aec0e812c546_332x442.webp 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!K9_7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F993aa706-c16e-4d3f-937b-aec0e812c546_332x442.webp" width="332" height="442" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/993aa706-c16e-4d3f-937b-aec0e812c546_332x442.webp&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:442,&quot;width&quot;:332,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!K9_7!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F993aa706-c16e-4d3f-937b-aec0e812c546_332x442.webp 424w, https://substackcdn.com/image/fetch/$s_!K9_7!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F993aa706-c16e-4d3f-937b-aec0e812c546_332x442.webp 848w, https://substackcdn.com/image/fetch/$s_!K9_7!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F993aa706-c16e-4d3f-937b-aec0e812c546_332x442.webp 1272w, https://substackcdn.com/image/fetch/$s_!K9_7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F993aa706-c16e-4d3f-937b-aec0e812c546_332x442.webp 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><strong>In the handwriting tablet scenario, the SVG path descriptor uses only the M (moveto) and L (lineto) commands to achieve its primary function. </strong>The reason for this is that the core requirement of the tablet is to record and present the trajectory drawn by the user in real time. The M command is used to determine the starting point of the drawing track, and every time the user touches the screen to start writing, it is equivalent to starting a new path, and the M command records this starting coordinate, as if determining the landing point of the first stroke on paper. The L command draws a line from the current point to the specified coordinates, and in the tablet, with the movement of the user's fingers, the coordinate points in the process of movement are continuously obtained, and the points are connected in turn through the L command to form a continuous line and accurately present the handwritten handwriting.</p><p><strong>In the end, we only need to add the onTouch event outside the Path component</strong> to record the user's finger touch event, get its x,y coordinates, and then implement the svg path descriptor of the tablet:</p><pre><code>javascript</code></pre><p>Code interpretation</p><p>Copy the code</p><p><code>// &#22788;&#29702;&#35302;&#25720;&#20107;&#20214;&#30340;&#26041;&#27861; onTouchEvent(event: TouchEvent) { // &#26681;&#25454;&#35302;&#25720;&#20107;&#20214;&#30340;&#31867;&#22411;&#36827;&#34892;&#19981;&#21516;&#30340;&#22788;&#29702; switch (event.type) { // &#24403;&#35302;&#25720;&#31867;&#22411;&#20026;&#25353;&#19979;&#26102; case TouchType.Down: // &#22312; pathCommands &#20013;&#28155;&#21152;&#19968;&#20010;&#31227;&#21160;&#21629;&#20196;&#65288;M&#65289;&#65292;&#24182;&#35760;&#24405;&#25353;&#19979;&#28857;&#30340;&#22352;&#26631; this.pathCommands += 'M' + event.touches[0].x + ' ' + event.touches[0].y; break; // &#24403;&#35302;&#25720;&#31867;&#22411;&#20026;&#31227;&#21160;&#26102; case TouchType.Move: // &#22312; pathCommands &#20013;&#28155;&#21152;&#19968;&#20010;&#32447;&#27573;&#21629;&#20196;&#65288;L&#65289;&#65292;&#24182;&#35760;&#24405;&#31227;&#21160;&#28857;&#30340;&#22352;&#26631; this.pathCommands += 'L' + event.touches[0].x + ' ' + event.touches[0].y; break; // &#20854;&#20182;&#35302;&#25720;&#31867;&#22411;&#65292;&#19981;&#20570;&#22788;&#29702; default: break; } }</code></p><p><strong>5. When it is time to empty the tablet.</strong></p><p>All you need to do is set the commands property of the Path component to an empty string.</p><h3>3. Source code example:</h3><pre><code>javascript</code></pre><p>Code interpretation</p><p>Copy the code</p><p><code>@Entry @Component struct PathTestPage { @State pathCommands: string = ""; private setPathCommands(str: string, event: TouchEvent){ let x = event.touches[0].x; let y = event.touches[0].y; this.pathCommands += str + vp2px(x) + ' ' + vp2px(y); console.log("georgeDebug", " this.pathCommands: " + this.pathCommands); } onTouchEvent(event: TouchEvent){ // event xy &#21333;&#20301;&#65306;vp switch (event.type){ case TouchType.Down: this.setPathCommands('M', event); break; case TouchType.Move: this.setPathCommands('L', event); break; default: break; } } build() { Stack({ alignContent: Alignment.TopStart }){ Path() .commands(this.pathCommands) // &#35774;&#32622;SVG&#36335;&#24452;&#25551;&#36848;&#23383;&#31526;&#20018; .strokeWidth(5) // &#35774;&#32622;&#36335;&#24452;&#30340;&#25551;&#36793;&#23485;&#24230;&#20026; 5 .fill("none") // &#35774;&#32622;&#36335;&#24452;&#30340;&#22635;&#20805;&#39068;&#33394;&#20026;&#26080; .stroke(Color.Black) // &#35774;&#32622;&#36335;&#24452;&#30340;&#25551;&#36793;&#39068;&#33394;&#20026;&#40657;&#33394; .height('100%') .width('100%') .onTouch((event: TouchEvent)=&gt;{ this.onTouchEvent(event); }) Button("&#28165;&#31354;&#32472;&#21046;") .onClick(()=&gt;{ this.pathCommands = ""; }) } .height('100%') .width('100%') } }</code></p><h3>Note:</h3><ol><li><p>Since path cannot be used as the root node of the build, it is wrapped with container component row.</p></li><li><p>The xy unit of coordinates obtained by onTouch is vp, and the unit of svg descriptor is vp, so the value should be converted to units. Otherwise, you'll be able to draw something, but the coordinates and the position of the pen will be reduced.</p></li><li><p>You need to set the width and height of the path component, otherwise it will not be displayed.</p></li></ol><p>&#8203;</p><p>&#20316;&#32773;&#65306;GeorgeGcs<br>&#38142;&#25509;&#65306;https://juejin.cn/post/7491984282539524135<br>&#26469;&#28304;&#65306;&#31232;&#22303;&#25496;&#37329;<br>&#33879;&#20316;&#26435;&#24402;&#20316;&#32773;&#25152;&#26377;&#12290;&#21830;&#19994;&#36716;&#36733;&#35831;&#32852;&#31995;&#20316;&#32773;&#33719;&#24471;&#25480;&#26435;&#65292;&#38750;&#21830;&#19994;&#36716;&#36733;&#35831;&#27880;&#26126;&#20986;&#22788;&#12290;</p>]]></content:encoded></item><item><title><![CDATA[PureHarmony white label SaaS app development flow on source code hostings for enterprise clients ]]></title><description><![CDATA[This article outlines PureHarmony's workflow of white-label SaaS app development strategy designed to leverage global open-source collab and deliver both a dual hybrid channel development approach.]]></description><link>https://www.harmony-developers.com/p/pureharmony-white-label-saas-app</link><guid isPermaLink="false">https://www.harmony-developers.com/p/pureharmony-white-label-saas-app</guid><dc:creator><![CDATA[Harmony OS Developers]]></dc:creator><pubDate>Fri, 04 Apr 2025 07:51:23 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/21cd888e-c6ed-4f01-a101-965abee27295_474x266.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>This article outlines the <strong>PureHarmony workflow</strong>&#8212;a white-label SaaS development strategy designed to leverage global open-source collaboration and deliver both a dual hybrid channel app development distribution approach of the open-source Oniro platform for the Oniro App Store and proprietary HarmonyOS NEXT apps for Huawei&#8217;s AppGallery. By combining <strong>GitHub (U.S.) </strong>early prototype stage, <strong>Codeberg (Germany) </strong>maintenance and extended development, hosting apps for open source platforms, and <strong>Bitbucket (Australia) </strong>for commercial platform expansion, developers can balance agility, compliance, and commercial viability.</p><div><hr></div><h3><strong>1. Development Flow Overview</strong></h3><p>A three-stage pipeline to insulate Oniro development, ensuring scalability:</p><p><strong>Stage Platform Purpose </strong></p><p><em><strong>Early Development Stage 1 Foundation </strong></em></p><ul><li><p>GitHub (U.S.): Rapid prototyping, open-source collaboration from global developers as foundation of original codes</p></li></ul><p><em><strong>Maintenance &amp; Expansion Stage 2+ Apex</strong></em></p><ul><li><p>Codeberg (Germany) sanctions-resilient updates, EU compliance with open source OpenHarmony-Oniro original code development</p></li></ul><p><em><strong>Commercialization Stage 3 Apex</strong></em></p><ul><li><p>Bitbucket (Australia) Proprietary IP original code, enterprise branding on Huawei HarmonyOS development ecosystem and Open Source Oniro-OpenHarmony Oniro App Store ecosystem in parallel, end game.</p><p></p></li></ul><div><hr></div><h3><strong>2. Stage 1: GitHub (U.S.) &#8211; Early Development</strong></h3><p><strong>Focus</strong>: Ideation, open-source collaboration, and MVP builds.<br><strong>Tools &amp; Practices</strong>:</p><ul><li><p><strong>DevEco Studio</strong>: IDE for Oniro-native app development.</p></li><li><p><strong>GitHub Actions</strong>: CI/CD pipelines for testing and dependency management.</p></li><li><p><strong>ArkTS</strong>: Huawei&#8217;s TypeScript-like language for cross-platform compatibility.</p></li><li><p><strong>OpenHarmony SDK</strong>: Leverage open-source tools and APIs.</p></li></ul><p><strong>Why GitHub?</strong></p><ul><li><p>Largest developer community for rapid feedback.</p></li><li><p>Seamless integration with DevEco Studio and ArkUI.</p></li></ul><p><strong>Sanctions Mitigation</strong>:</p><ul><li><p>Avoid Huawei-specific tooling until Codeberg transition.</p></li><li><p>Use GitHub only for non-proprietary code.</p></li></ul><div><hr></div><h3><strong>3. Stage 2: Codeberg (Germany) &#8211; Maintenance &amp; Expansion</strong></h3><p><strong>Focus</strong>: Sanctions-proofing, EU compliance, and feature expansion.<br><strong>Tools &amp; Practices</strong>:</p><ul><li><p><strong>Gitea Migration</strong>: Codeberg&#8217;s Gitea-based platform ensures GDPR compliance and EU data sovereignty.</p></li><li><p><strong>Drone CI</strong>: Replace GitHub Actions with this open-source, self-hosted CI/CD tool.</p></li><li><p><strong>Eclipse Theia</strong>: Open-source IDE for EU-aligned development.</p></li><li><p><strong>OpenChain Compliance</strong>: Audit code for <a href="https://www.federalregister.gov/documents/2019/08/21/2019-17921/addition-of-certain-entities-to-the-entity-list-and-revision-of-entries-on-the-entity-list#:~:text=Huawei%20Technologies%20Co.%2C%20Ltd.%20%28Huawei%29%20and%20sixty-eight%20of,to%20the%20Entity%20List%20effective%20May%2016%2C%202019.">restrictive-origin</a> dependencies.</p></li></ul><p><strong>Why Codeberg?</strong></p><ul><li><p>Non-profit, EU-based governance avoids restrictive party jurisdiction.</p></li><li><p>Aligns with OpenHarmony-Oniro&#8217;s Eclipse Foundation roots.</p></li></ul><p><strong>Key Tasks</strong>:</p><ul><li><p>Strip restrictive party-controlled vunlerable tools (e.g., GitHub Actions, AWS).</p></li><li><p>Implement Eclipse Xpanse with plugins supported global cloud parties like Huawei Cloud and other 3rd parties for storage and compute.</p></li></ul><div><hr></div><h3><strong>4. Stage 3: Bitbucket (Australia) &#8211; Commercialization</strong></h3><p><strong>Focus</strong>: Hybrid/Dual model of pre-final stage Open Source front end code with mixed full end stack and final stage full stack with backend Proprietary code on both having enterprise branding, and AppGallery + Oniro App Store deployment.<br><strong>Tools &amp; Practices</strong>:</p><ul><li><p><strong><a href="https://bitbucket.org/product/features/pipelines/integrations">Bitbucket Pipelines</a></strong>: Atlassian&#8217;s CI/CD for closed-source workflows.</p></li><li><p><strong><a href="https://www.atlassian.com/software/jira">Jira Integration</a></strong>: Align development with Huawei&#8217;s AppGallery requirements.</p></li><li><p><strong>White-Labeling</strong>: Rebrand apps for enterprise clients (e.g., "BankX for HarmonyOS").</p></li><li><p>Use <strong><a href="https://ipfs.tech/">IPFS</a>/<a href="https://docs.filecoin.io/basics/what-is-filecoin">Filecoin</a></strong> for immutable, decentralized code storage to prevent takedowns.</p></li><li><p><strong>Patent Non-Aggression</strong>:</p><ul><li><p>Join the<a href="https://openinventionnetwork.com/"> </a><strong><a href="https://openinventionnetwork.com/">Open Invention Network</a></strong><a href="https://openinventionnetwork.com/"> (OIN)</a> to create mutual defense against patent litigation.</p></li></ul></li><li><p><strong>Strong Copyleft and mixed model partial and weak Copyleft on Oniro App Store and Proprietary License for AppGallery</strong>:</p><ul><li><p>Strong copyleft - License core components on front end under <strong><a href="https://www.gnu.org/licenses/gpl-3.0.en.html">GPLv3</a></strong> or <strong><a href="https://www.gnu.org/licenses/agpl-3.0.en.html">AGPL</a></strong> to deter monopolistic firms from forking/weaponizing Oniro ecosystem code. Coexisting with partial copyleft option.</p></li><li><p><strong>Forking Protections</strong>:</p><ul><li><p>Strong copyleft -  License critical components of back end under <strong><a href="https://prosperitylicense.com/">Prosperity Public License</a></strong> to prevent monopolistic firms from privatizing Oniro ecosystem code.</p></li><li><p>Partial copyleft allows enterprise developer author on parts to share freely and keep proprietary under GNU Free Documentation License (GFDL) and  Design Science License (DSL) used for documentation on Oniro-HarmonyOS ecosystems.</p></li><li><p>Weak copyleft flexibility and compatibility for derivative work on software libraries and components via the GNU Lesser General Public License (LGPL) and the Mozilla Public License (MPL) used for software libraries and components on Oniro-HarmonyOS ecosystems. </p></li><li><p><strong>Closed Repo:</strong></p><ul><li><p><a href="https://info.support.huawei.com/enterprise/en/software-policy">Proprietary License</a> for HarmonyOS AppGallery ecosystem exclusive license code on Software License Agreement - Huawei (EN).</p></li></ul></li></ul></li></ul></li></ul><ul><li><p><strong>Blockchain-Verified Builds</strong>:</p><ul><li><p>Sign releases with blockchain hashes (e.g.,<a href="https://hedera.com/"> </a><strong><a href="https://hedera.com/">Hedera Hashgraph</a></strong>) to prove code integrity and resist tampering.</p></li></ul></li><li><p><strong>DevEco Studio</strong>: Duplicate project under unified folder - Signing applications for both HarmonyOS private repo final development and OpenHarmony open source core only earlier development project repo shared family of platforms adhering to common shared APIs alongside HarmonyOS compatible APIs targets implemented of enterprise branded applications with application/game parity functionalities.</p></li><li><p><strong>Huawei AppGallery Connect</strong>: HarmonyOS (NEXT 5.0+/4.x dual frame earlier) SDK integration for publishing and analytics for signed APP with runtimeOS of HarmonyOS to run for global developers (outside US domestic market).</p></li><li><p><strong><a href="https://github.com/eclipse-oniro4openharmony/f-oh-data?tab=readme-ov-file#submit-application">f-oh-data</a>: </strong>Use Docker for server F-OH Server (to be developed) or website front end (F-OH Web) for publishing and analytics from unsigned/signed OpenHarmony HAP with runtimeOS switch of OpenHarmony to run for global developers (including US domestic market).</p></li></ul><p><strong>Why Bitbucket?</strong></p><ul><li><p>Atlassian&#8217;s Australian base.</p></li><li><p>Enterprise-grade security for proprietary code.</p></li></ul><p><strong>Compliance Checks</strong>:</p><ul><li><p>Ensure original code/IP in final builds.</p></li><li><p>Use Huawei&#8217;s <strong>OSS Audit Tool (OAT)</strong> for license scanning.</p></li></ul><div><hr></div><h3><strong>5. Tools &amp; Compliance Framework</strong></h3><p><strong>Compliance Checklist</strong>:</p><ul><li><p>&#9989; All code migrated to EU-based Codeberg from GitHub scrubbed of U.S. dependencies.</p></li><li><p>&#9989; Proprietary modules hosted only on Bitbucket/Eclipse Xpanse Cloud.</p></li><li><p>&#9989; Final APK (Case by case for HMS EMUI-HarmonyOS 4.x)/HAP HarmonyOS NEXT/5.0+ signed with Huawei&#8217;s AppGallery certificates.</p></li></ul><div><hr></div><h3><strong>6. Case Study: EuroSmart IoT Suite</strong></h3><p>A European IoT startup used PureHarmony to launch a smart home app on HarmonyOS NEXT:</p><ol><li><p><strong>GitHub</strong>: Built MVP with open-source sensor drivers.</p></li><li><p><strong>Codeberg</strong>: Added GDPR-compliant data analytics and EU localization.</p></li><li><p><strong>Bitbucket</strong>: Developed proprietary AI algorithms and partnered with Huawei for AppGallery promotion.<br><strong>Result</strong>: 500K+ downloads globally, even in China, with zero vulnerability to restrictions.</p></li></ol><div><hr></div><h3><strong>7. Strategic Benefits</strong></h3><ul><li><p><strong>Geopolitical Resilience</strong>: PureHarmony decoupling from restrictive tech stacks while retaining global collaboration long-term.</p></li><li><p><strong>Compliance</strong>: Aligning with EU (GDPR), Australian (Privacy Act), and Chinese (CSL) regulations.</p></li><li><p><strong>Market Access</strong>: Tap into Huawei&#8217;s 1 billion+ AppGallery users without GMS dependencies.</p></li></ul><div><hr></div><h3><strong>8. Challenges &amp; Solutions</strong></h3><ul><li><p><strong>Repo Migration</strong>: Use <code>git clone --mirror</code> and Gitea&#8217;s migration tools.</p></li><li><p><strong>CI/CD Fragmentation</strong>: Standardize on open-source <a href="https://eclipse.dev/xpanse/docs/supported-clouds">Eclipse Xpanse recommendations</a> with optional Huawei Cloud&#8217;s DevOps or <em><a href="https://www.openstack.org/">Openstack powered cloud</a>, <a href="https://www.orange-business.com/en/solutions/cloud/flexible-engine">FlexibleEngine</a>, <a href="https://regio-cloud.net/">Regio Cloud</a>, <a href="https://www.plusserver.com/en/">Plus Server</a> </em>for all stages.</p></li><li><p><strong>Contributor Training</strong>: Educate teams on clean-room practices for Codeberg/Bitbucket.</p></li></ul><p></p><p></p><h3><strong>Core Strategy for Mainstream Apps</strong></h3><p><strong>App Type</strong></p><p><em><strong>Oniro App Store (Oniro/OpenHarmony)</strong></em></p><p><em><strong>AppGallery (HarmonyOS Next SDK Kit)</strong></em><strong> </strong></p><p><strong>Banking (Barclays)</strong></p><p>Open-source UI, basic transaction APIs (Codeberg).Proprietary fraud detection, biometric auth (BitBucket + HMS). Both work across the open-source Oniro and commercial HarmonyOS NEXT both based on OpenHarmony ecosystem with a unified app development codebase.</p><p><strong>Social (Instagram)</strong></p><p>Open-core photo filters, feed rendering (Codeberg). AI-driven recommendations, Stories analytics (BitBucket + HMS). Both work across the open-source Oniro and commercial HarmonyOS NEXT both based on OpenHarmony ecosystem with a unified app development codebase.</p><p><strong>Streaming (Netflix)</strong></p><p>Open-source video player (e.g., ExoPlayer) + Open Mobile Hub DRM, AudioVivid, HDRVivid standards (Codeberg). Proprietary CDN, 4K/HDR optimizations, Huawei DRM (BitBucket + HarmonyOS native kits). Both work across the open-source Oniro and commercial HarmonyOS NEXT/5+ both based on OpenHarmony ecosystem with a unified app development codebase.</p><p><strong>Gaming (Angry Birds)</strong></p><p>Open-source game logic (underlining open-source UI frameworks like ZFramework) on Codeberg. Proprietary physics engine, IAP, Huawei AR/VR SDK (BitBucket + HMS). Both work across the open-source Oniro and commercial HarmonyOS NEXT both based on OpenHarmony ecosystem with a unified game development codebase.</p><div><hr></div><h3><strong>2. Technical Implementation</strong></h3><h4><strong>a. Cross-Platform Compatibility</strong></h4><ul><li><p><strong>OpenHarmony Runtime</strong>:</p><ul><li><p>Use <strong>ArkUI</strong> for native OpenHarmony UIs and <strong>Ark Runtime</strong> for Android app compatibility (AAB&#8594;HAP conversion).</p></li><li><p>Example: TikTok&#8217;s Android app runs on Oniro via Ark Runtime, stripped of Google dependencies.</p></li></ul></li><li><p><strong>HarmonyOS SDK</strong>:</p><ul><li><p>Optimize for Huawei&#8217;s hardware (e.g., GPU Turbo, Kirin chips) in AppGallery builds.</p></li></ul></li></ul><h4><strong>b. Feature Parity via Modular Code</strong></h4><ul><li><p><strong>Shared Open-Source Core</strong>:</p><ul><li><p>Host UI frameworks, network layers, and basic APIs on <strong>Codeberg</strong> (Apache 2.0).</p></li><li><p>Example: Spotify&#8217;s playlist management and audio playback logic.</p></li></ul></li><li><p><strong>Proprietary Extensions</strong>:</p><ul><li><p>Keep AI/ML models, payment gateways, and analytics on <strong>BitBucket</strong>.</p></li><li><p>Example: Netflix&#8217;s recommendation engine or TikTok&#8217;s For You Page algorithm.</p></li></ul></li></ul><h4><strong>c. Build Automation</strong></h4><ul><li><p><strong>CI/CD Pipelines</strong>:</p><ul><li><p><strong>Oniro Build</strong>: Compile open-core modules with OpenHarmony&#8217;s DevEco Studio.</p></li><li><p><strong>AppGallery Build</strong>: Merge open-core with proprietary modules + HMS integrations.</p><p></p></li></ul></li></ul><p># Example GitLab CI for dual builds  </p><p>build_oniro:  </p><p>  script:  </p><p>    - devEco build --target openharmony --no-hms-libraries</p><p>build_appgallery:  </p><p>  script:  </p><p>    - devEco build --target harmonyos --hms-libraries  </p><p></p><h3><strong>3. Monetization &amp; Compliance</strong></h3><p><strong>Aspect</strong></p><p><strong>Oniro App Store</strong></p><p><strong>AppGalleryAds</strong></p><p>Open-source ad SDKs (e.g., AdMob alternatives).</p><p>Huawei Ads Kit + proprietary ad targeting.</p><p><strong>In-App Purchases</strong></p><p>Community-driven payment plugins (e.g., Stripe).Huawei IAP (seamless integration with HMS).</p><p><strong>DRM</strong></p><p>Open-source Open Mobile Hub DRM alternative.</p><p>Huawei DRM (hardware-backed security) for HarmonyOS (NEXT/5.0+) devices.</p><p><strong>Regulatory Compliance</strong></p><p>GDPR-compliant via Codeberg (EU hosting). Aligns with China&#8217;s Cybersecurity Law (CSL) and Australian Privacy Act via BitBucket (Australian hosting).</p><div><hr></div><h3><strong>4. Case Study: Assassin&#8217;s Creed Jade</strong></h3><ul><li><p><strong>Oniro Version</strong>:</p><ul><li><p>Open-source game logic (UI) on Codeberg.</p></li><li><p>Uses OpenHarmony&#8217;s <strong>3D rendering engine</strong> (compatible with Vulkan) optimised for original game engine.</p></li></ul></li><li><p><strong>AppGallery Version</strong>:</p><ul><li><p>Adds Huawei&#8217;s Pangu LLM <strong>MindSpore, HiAI </strong>integrating Celia for enhanced NPC interactions.</p></li><li><p>Integrates Huawei&#8217;s <strong>Game Service</strong> for achievements/leaderboards on HarmonyOS NEXT SDK.</p></li></ul></li></ul><div><hr></div><h3><strong>5. Challenges &amp; Solutions</strong></h3><p></p><p><em><strong>Google Play Services Dependency on Android and Apple Darwin, Microsoft Windows dependency development</strong></em></p><p>Replace with OpenHarmony compatible open source frameworks/tools/layers <strong>+ Open Mobile Hub</strong> and Huawei&#8217;s <strong>HarmonyOS NEXT SDK Kits</strong> in parallel.</p><p><strong>Performance Gaps</strong></p><p>Use HarmonyOS SDK&#8217;s hardware optimizations (e.g., GPU Turbo) for AppGallery to take advantage of vertical integration level Kirin.</p><p><strong>Fragmented Codebase</strong></p><p>Modular architecture + shared CI/CD pipelines for open/closed components.</p><p><strong>Developer Adoption</strong></p><p>Provide templates for commercial Unity/Unreal Engine plugins targeting OpenHarmony base across OpenHarmony, including Oniro and Huawei HarmonyOS NEXT/5+ systems.</p><div><hr></div><h3><strong>6. Tools &amp; Resources</strong></h3><ul><li><p><strong>OpenHarmony ArkUI</strong>: <a href="https://gitee.com/openharmony/docs">Developer Documentation</a></p></li><li><p><strong>Huawei HMS Core</strong>: <a href="https://developer.huawei.com/consumer/en/hms">Integration Guide</a></p></li><li><p><strong>Codeberg</strong>: <a href="https://codeberg.org/">Host Open-Source Modules</a></p></li><li><p><strong>BitBucket</strong>: <a href="https://bitbucket.org/">Enterprise-Grade Repos</a></p></li></ul><div><hr></div><p>By decoupling, deploying, app file packaging <strong>open-source frontends</strong> (Oniro) from <strong>proprietary backends</strong> (AppGallery), companies like Netflix, TikTok, and Ubisoft can:</p><ol><li><p><strong>Reach Global Audiences</strong>: Serve open-source builds on Oniro taking advantage of open source underlining UI frameworks within apps/games as well as Open Mobile Hub framework building HAP package and native HarmonyOS Kit versions on AppGallery from runtimeOS switches building APP package.</p></li><li><p><strong>Protect Core IP</strong>: Keep AI, DRM, and monetization logic closed-source on HarmonyOS and webview/3rd party monetization logic on open source Oniro/OpenHarmony.</p></li><li><p><strong>Avoiding Complications</strong>: Use Codeberg/EU tooling for Oniro and Huawei&#8217;s ecosystem with Australian BitBucket</p></li></ol><p>This hybrid model transforms constraints into a strategic advantage, enabling mainstream apps to thrive in both open and closed ecosystems.</p><div><hr></div><h3><strong>Conclusion</strong></h3><p>The <strong>PureHarmony workflow</strong> empowers developers to innovate for independent OpenHarmony, Oniro and HarmonyOS NEXT compatible platforms while navigating today&#8217;s fragmented tech landscape. By strategically leveraging GitHub, Codeberg, and Bitbucket, teams can deliver official licensed commercial apps for Huawei&#8217;s ecosystem without compromising on compliance or agility.</p><p>The hybrid model allows companies to deploy mainstream apps on both <strong>Oniro App Store</strong> (OpenHarmony-based) and <strong>Huawei AppGallery</strong> (HarmonyOS SDK) <em>without</em> sacrificing functionality.</p><p><strong>Call to Action</strong>:</p><ul><li><p>Join the global <a href="https://oniroproject.org/">Oniro Developer Community</a>.</p></li><li><p>Join the global <a href="https://developer.huawei.com/consumer/en/">HarmonyOS Developer Community</a>.</p></li><li><p>Explore <a href="https://codeberg.org/PureHarmonyProject">Codeberg&#8217;s OpenHarmony-Oniro PureHarmony repos.</a></p></li><li><p>Start white-labeling with GitHub prototyping, Codeberg and Bitbucket combo development.</p></li><li><p><a href="https://open.substack.com/pub/hosdevs/p/harmonyos-next-private-repository?r=4u8a4t&amp;utm_campaign=post&amp;utm_medium=web">HarmonyOS Next Private Repository Construction in Practice</a> as final development kickoff</p></li></ul><p><em>Build globally, comply locally, and thrive with the PureHarmony developer guide utility.</em></p>]]></content:encoded></item><item><title><![CDATA[Robius: Multi-Platform App Dev in Rust]]></title><description><![CDATA[Robius is a fully open-source, decentralized, community-driven effort to enable multi-platform application development in Rust. That include OpenHarmony support in development]]></description><link>https://www.harmony-developers.com/p/robius-multi-platform-app-dev-in</link><guid isPermaLink="false">https://www.harmony-developers.com/p/robius-multi-platform-app-dev-in</guid><dc:creator><![CDATA[Harmony OS Developers]]></dc:creator><pubDate>Sat, 29 Mar 2025 21:25:39 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!Zo0i!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5da2a12a-9349-4cee-81e9-5101b5d573c2_1717x1019.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Zo0i!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5da2a12a-9349-4cee-81e9-5101b5d573c2_1717x1019.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Zo0i!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5da2a12a-9349-4cee-81e9-5101b5d573c2_1717x1019.png 424w, https://substackcdn.com/image/fetch/$s_!Zo0i!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5da2a12a-9349-4cee-81e9-5101b5d573c2_1717x1019.png 848w, https://substackcdn.com/image/fetch/$s_!Zo0i!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5da2a12a-9349-4cee-81e9-5101b5d573c2_1717x1019.png 1272w, https://substackcdn.com/image/fetch/$s_!Zo0i!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5da2a12a-9349-4cee-81e9-5101b5d573c2_1717x1019.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Zo0i!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5da2a12a-9349-4cee-81e9-5101b5d573c2_1717x1019.png" width="1456" height="864" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5da2a12a-9349-4cee-81e9-5101b5d573c2_1717x1019.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:864,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:165430,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://www.harmony-developers.com/i/160153505?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5da2a12a-9349-4cee-81e9-5101b5d573c2_1717x1019.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Zo0i!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5da2a12a-9349-4cee-81e9-5101b5d573c2_1717x1019.png 424w, https://substackcdn.com/image/fetch/$s_!Zo0i!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5da2a12a-9349-4cee-81e9-5101b5d573c2_1717x1019.png 848w, https://substackcdn.com/image/fetch/$s_!Zo0i!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5da2a12a-9349-4cee-81e9-5101b5d573c2_1717x1019.png 1272w, https://substackcdn.com/image/fetch/$s_!Zo0i!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5da2a12a-9349-4cee-81e9-5101b5d573c2_1717x1019.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><p>For more info, check out:</p><ul><li><p><a href="https://robius.rs/blog/">Our Project Robius Blog</a></p></li><li><p><a href="https://project-robius.github.io/book/">The Robius Book</a></p></li><li><p>Presentations about Robius:</p><ul><li><p><strong>Project Robius's first status update &amp; demo</strong> (<a href="https://2024.rustnl.org/speakers/#kevin">RustNL 2024</a>)</p><ul><li><p>Videos: <a href="https://www.youtube.com/watch?v=Dg4hlfettn8">YouTube Link</a></p></li><li><p>Slides: <a href="https://github.com/project-robius/files/raw/3ac0a9d2e9f3c78ea51b4875abe02d288fa3685f/RustNL%202024%20and%20GOSIM%20Europe%202024/Robius%20Talk%20RustNL%20May%208,%202024.pptx">PowerPoint (19MB)</a>, <a href="https://github.com/project-robius/files/blob/3ac0a9d2e9f3c78ea51b4875abe02d288fa3685f/RustNL%202024%20and%20GOSIM%20Europe%202024/Robius%20Talk%20RustNL%20May%208%2C%202024.pdf">PDF version (12MB)</a></p></li></ul></li><li><p><strong>Robrix: a Matrix chat client and more</strong> (<a href="https://europe2024.gosim.org/schedule#fediverse">GOSIM Europe 2024</a>)</p><ul><li><p>Videos: <a href="https://www.youtube.com/watch?v=P8RGF942A5g">YouTube link</a></p></li><li><p>Slides: <a href="https://github.com/project-robius/files/raw/3ac0a9d2e9f3c78ea51b4875abe02d288fa3685f/RustNL%202024%20and%20GOSIM%20Europe%202024/Robrix%20Talk%20GOSIM%20Europe%20May%206,%202024.pptx">PowerPoint (22MB)</a>, <a href="https://github.com/project-robius/files/blob/3ac0a9d2e9f3c78ea51b4875abe02d288fa3685f/RustNL%202024%20and%20GOSIM%20Europe%202024/Robrix%20Talk%20GOSIM%20Europe%20May%206%2C%202024.pdf">PDF version (16MB)</a></p></li></ul></li><li><p><strong>Introducing our vision for Project Robius</strong> (<a href="https://workshop2023.gosim.org/schedule#mobile">GOSIM 2023</a>)</p><ul><li><p>Videos: <a href="https://youtu.be/8JfOXfmwotQ?si=kLogqnaApYPNuSq8&amp;t=6802">YouTube link</a>, <a href="https://www.bilibili.com/video/BV1AN4y1Z7vs/">Bilibili link</a></p></li><li><p>Slides: <a href="https://github.com/project-robius/files/raw/041e980ec1d14bf325f1fb2ba743f8ed142a70cb/Robius%20-%20A%20Vision%20for%20Multi-platform%20App%20Development%20in%20Rust.pptx">PowerPoint (18MB)</a>, <a href="https://github.com/project-robius/files/blob/041e980ec1d14bf325f1fb2ba743f8ed142a70cb/Robius%20-%20A%20Vision%20for%20Multi-platform%20App%20Development%20in%20Rust.pdf">PDF version (15MB)</a></p></li></ul></li></ul></li></ul><p>The Robius organization also acts as an informal<a href="https://github.com/project-robius#user-content-fn-1-2e750bd36f16993cf5762424952bad7d"><sup>1</sup></a> working group: a welcoming, public space to collect and discuss resources related to improving and furthering the app dev experience in Rust.</p><blockquote><p>Got a question? Want to get involved? Interested in contributing?<br>Come join our friendly community on the <a href="https://matrix.to/#/#robius:matrix.org">Matrix chat Robius space</a>.</p></blockquote><h2>Our vision</h2><p>We believe that the Rust programming language is the right choice for the next generation of application developers, but that the language ecosystem needs a bit more love and attention to make it a first-class citizen in the world of application development, particularly on mobile platforms.</p><p>We envision a future in which:</p><ol><li><p>Rust developers can create safe, beautiful, and robust applications that execute efficiently and performantly on a wide variety of platforms, especially mobile.</p></li><li><p>Frontend developers using other languages are encouraged to come over to the <s>dark side</s> wonderful world of Rust and give it a try, with a seamless transition experience that helps overcome the steep learning curve commonly associated with Rust.</p></li><li><p>The Rust ecosystem is broadened and strengthened, demonstrating to existing Rust experts in other domains that Rust is a great fit for highly-productive application development, not just low-level systems and embedded programming.</p></li></ol><h3>What's in a name?</h3><p>The name <em>Robius</em> comes from the Latin word <a href="http://latin-dictionary.net/definition/33662/robius-robia-robium">robius</a>, meaning red in color, as in oxen, wheat, rust, etc. This makes for a nice color-based connection to Rust, our programming language of choice.</p><p>Robius rhymes with Mobius, and our logo/icons take inspiration from the wordplay combination of "Rust" and "Mobius strip".</p><blockquote><p>Yes, <em>technically</em>, the original German name is M&#246;bius, but we use an Americanized pronunciation with a long "o" sound: "Roe-bee-us" / &#712;&#633;o&#650;&#712;bi&#601;s.</p></blockquote><h2>Current status</h2><p>Robius is a brand new vision -- we're just getting off the ground.</p><p>Currently, the best way to get started is to directly use one of the <a href="https://github.com/project-robius#key-community-members">recommended UI toolkits</a> to build out your application's UI and define its UX behavior. For now, everything else beyond UI will require you to add the missing pieces yourself, e.g., network connectivity, async multitasking, and access to other device peripherals or system services.</p><p>Everything is developed right here in the open, so check back for updates often! We plan to introduce a pre-alpha version of the full Robius system stack (everything beneath the application) by early-to-mid 2024, which will enable easier access to and integration of other platform/OS features alongside the UI toolkits.</p><h3>Platform support &#128242; &#128421;&#65039; &#127760; &#128187; &#128433;&#65039; &#9000;&#65039;</h3><p><a href="https://project-robius.github.io/book/status.html#platform-support">&#10145;&#65039; Click here for a table &#11013;&#65039;</a> showing which projects support which features on which platforms.</p><h2>Key Community Projects</h2><p>The Robius ecosystem consists of several independent projects that can be composed into a complete system stack to realize fast, painless application development across multiple platforms in pure Rust. Components are loosely coupled, allowing a developer (in the future) to customize which components are used to comprise the underlying system, such as choosing</p><ul><li><p><a href="https://makepad.nl/">Makepad</a> is a cross-platform UI toolkit currently under active development that offers a hybrid retained-mode and immediate-mode UI model.</p><ul><li><p>Rapid development cycle: <em>very</em> fast compile times due to a custom minimal dependency set, plus a custom DSL for live design that enables hot reloading of UI elements.</p></li><li><p>Makepad Studio: an IDE prototype built using Makepad itself with unique features like cross-process shared textures for live reload of an in-window UI app, docking tabs for file/window views, hyper-smooth code folding, and more.</p></li><li><p>Makepad framework: a (growing) collection of highly-performant widgets and minimal, zero/low-overhead platform abstractions.</p></li></ul></li><li><p><a href="https://dioxuslabs.com/">Dioxus</a> is a cross-platform, production-ready UI toolkit that is inspired by React, with a custom metalanguage called RSX that is used to declare UI elements/layout in an HTML-like style.</p><ul><li><p>Supports <em>many</em> platforms with a set of interchangeable target renderers, including desktop, webapps, static sites, text UIs, liveview, and mobile.</p></li><li><p>Fast and memory-efficient, with perfect lighthouse scores and performance orders of magnitude better than Node or Python.</p></li><li><p>Excellent built-in abstractions for state management.</p></li><li><p>Easy, familiar styling using vanilla CSS or the CSS framework of your choice, e.g., Tailwind.</p></li></ul></li><li><p><a href="https://github.com/osiris-apis">Osiris</a> is a set of Rust interfaces for developing immersive applications atop a diverse set of operating systems services and platform-specific functionality.</p><ul><li><p>Osiris aims to provide Rust apps with an easy canonical way to access platform features like storage, networking, multimedia (video, audio, camera), geolocation, device orientation (accelerometer, gyro), timers &amp; alarms, notifications, clipboard, drag-n-drop, and more.</p></li><li><p><code>osi</code>: the primary Rust package that exposes direct access to OS interfaces. Higher-level Rust abstractions are coming soon, after raw interfaces for more platforms are complete.</p></li><li><p>Osiris offers build tooling that can:</p><ol><li><p>Set up new project directories with auto-generated scaffolding for platform-specific integration components that can be customized post-creation.</p></li><li><p>Generate application artifacts that adhere to the policies of each platform, i.e., packages that can be published to common app stores (Google Play, Apple App Store, Microsoft Store, etc).</p></li></ol></li></ul></li></ul><h2>Repositories of Interest</h2><p>Robius aims to provide a fully-functional <em>reference design</em> of the entire system stack beneath the application, for which an architectural overview and detailed documentation will be available.</p><p>We also intend to provide two classes of actual applications:</p><ol><li><p>Flagships: complete, fully-featured apps with a clean UI design, polished UX, and functional business logic. These apps will be publishable to platform app stores.</p></li><li><p>Simple demos: a series of basic example apps that exhibit a few key features, with mock components underneath and elsewhere.</p></li></ol><h4>Flagship apps</h4><ul><li><p><a href="https://github.com/project-robius/robrix">Robrix: the Robius Matrix chat client</a>.</p><ul><li><p>Currently under active development, and looking for help!</p></li><li><p>The needs of this app will be the primary driver for Robius development.</p></li></ul></li><li><p><a href="https://github.com/project-robius/moxin">Moxin: a local explorer for open-source LLMs</a>.</p><ul><li><p>Currently under active development, and looking for help!</p></li><li><p>Allows running LLMs locally and conversing with an AI Chatbot for each model, using the WasmEdge runtime as an LLM backend runtime.</p></li></ul></li></ul><h4>Simple demo apps</h4><ul><li><p><code>makepad_social_media_feed</code>: a mobile UI demo of a social media feed.</p><ul><li><p>Also see Makepad's more recent example: <a href="https://github.com/makepad/makepad/tree/master/examples/news_feed">Makepad news feed</a>.</p></li></ul></li><li><p><code>makepad_taobao</code>: a UI demo for an online shopping app, similar to eBay or Taobao.</p></li><li><p><code>todo_makepad</code>: a basic to-do list app.</p></li><li><p><code>makepad_wechat</code>: a demo of a chat-like app UI, like WeChat, WhatsApp, Signal, etc.</p></li><li><p><code>makepad_tiktok</code>: a UI demo for a TikTok-style short video browsing app.</p></li><li><p><code>makepad_widgets_sample</code>: an app showcasing various widgets offered by Makepad.</p></li><li><p><code>makepad_image_manipulation</code>: a demo of Makepad's ability to do funky transformations on images with high performance.</p></li><li><p>7 GUIs: select implementations of the 7 GUIs benchmark, atop both <a href="https://github.com/project-robius/makepad_7guis">Makepad</a> and <a href="https://github.com/project-robius/dioxus_7guis">Dioxus</a>.</p></li></ul><p>For more examples, check out the extensive set of <a href="https://github.com/DioxusLabs/example-projects">Dioxus example apps</a> and <a href="https://github.com/makepad/makepad/tree/master/examples">Makepad example apps</a>. Osiris-specific examples are coming soon.</p><p><em>[Summer 2025]</em> Publish Robrix v1.0 with full Matrix functionality, for "power" users with OpenHarmony support</p><ul><li><p>Offer a responsive UI design with a dockable, multi-tab view of many rooms side-by-side, which also adapts to varying screen sizes (mobile, desktop, etc).</p><ul><li><p>&#9989; This is already complete! (<a href="https://robius.rs/blog/robius-retrospective-2024#robrix-an-up-and-coming-matrix-chat-client-for-power-users">as described in our previous post</a>)</p></li></ul></li><li><p>Achieve feature parity with existing major clients, including administrative features like a full settings pane, session management, room creation/admin, message search, threads, spaces, etc.</p><ul><li><p>See <a href="https://github.com/project-robius/robrix/milestone/2">Milestone 2</a> on our GitHub page for more details.</p></li><li><p>Generally, these features are <em>not</em> drivers of Robius development, as they don't require complex platform features, so they were of a lower priority initially.</p><p></p></li></ul><p><strong>OpenHarmony community:</strong></p><p>Stay tuned for further developments of Robius multi-platform app development in Rust for OpenHarmony-based platforms.</p></li></ul><p>Original GitHub link: <a href="https://github.com/project-robius">Project Robius</a> and official website <a href="https://robius.rs/">robius.rs</a></p>]]></content:encoded></item><item><title><![CDATA[NGenXX cross-platform framework based on modern C++, supporting biz dev via Lua & JS on platforms such as OpenHarmony/HarmonyOS Next]]></title><description><![CDATA[A cross-platform framework based on modern C++, supporting biz dev via Lua & JS.]]></description><link>https://www.harmony-developers.com/p/ngenxx-cross-platform-framework-based</link><guid isPermaLink="false">https://www.harmony-developers.com/p/ngenxx-cross-platform-framework-based</guid><dc:creator><![CDATA[Harmony OS Developers]]></dc:creator><pubDate>Thu, 27 Mar 2025 17:22:42 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!47w-!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe82e6003-4590-4cb4-9158-25ad786ae561_1663x918.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!47w-!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe82e6003-4590-4cb4-9158-25ad786ae561_1663x918.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!47w-!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe82e6003-4590-4cb4-9158-25ad786ae561_1663x918.png 424w, https://substackcdn.com/image/fetch/$s_!47w-!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe82e6003-4590-4cb4-9158-25ad786ae561_1663x918.png 848w, https://substackcdn.com/image/fetch/$s_!47w-!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe82e6003-4590-4cb4-9158-25ad786ae561_1663x918.png 1272w, https://substackcdn.com/image/fetch/$s_!47w-!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe82e6003-4590-4cb4-9158-25ad786ae561_1663x918.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!47w-!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe82e6003-4590-4cb4-9158-25ad786ae561_1663x918.png" width="1456" height="804" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e82e6003-4590-4cb4-9158-25ad786ae561_1663x918.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:804,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:126008,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://www.harmony-developers.com/i/160003874?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe82e6003-4590-4cb4-9158-25ad786ae561_1663x918.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!47w-!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe82e6003-4590-4cb4-9158-25ad786ae561_1663x918.png 424w, https://substackcdn.com/image/fetch/$s_!47w-!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe82e6003-4590-4cb4-9158-25ad786ae561_1663x918.png 848w, https://substackcdn.com/image/fetch/$s_!47w-!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe82e6003-4590-4cb4-9158-25ad786ae561_1663x918.png 1272w, https://substackcdn.com/image/fetch/$s_!47w-!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe82e6003-4590-4cb4-9158-25ad786ae561_1663x918.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Zh92!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F635c4bde-4f78-478c-bb7a-f2f128247755.svg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Zh92!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F635c4bde-4f78-478c-bb7a-f2f128247755.svg 424w, https://substackcdn.com/image/fetch/$s_!Zh92!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F635c4bde-4f78-478c-bb7a-f2f128247755.svg 848w, https://substackcdn.com/image/fetch/$s_!Zh92!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F635c4bde-4f78-478c-bb7a-f2f128247755.svg 1272w, https://substackcdn.com/image/fetch/$s_!Zh92!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F635c4bde-4f78-478c-bb7a-f2f128247755.svg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Zh92!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F635c4bde-4f78-478c-bb7a-f2f128247755.svg" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/635c4bde-4f78-478c-bb7a-f2f128247755.svg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Arch&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Arch" title="Arch" srcset="https://substackcdn.com/image/fetch/$s_!Zh92!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F635c4bde-4f78-478c-bb7a-f2f128247755.svg 424w, https://substackcdn.com/image/fetch/$s_!Zh92!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F635c4bde-4f78-478c-bb7a-f2f128247755.svg 848w, https://substackcdn.com/image/fetch/$s_!Zh92!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F635c4bde-4f78-478c-bb7a-f2f128247755.svg 1272w, https://substackcdn.com/image/fetch/$s_!Zh92!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F635c4bde-4f78-478c-bb7a-f2f128247755.svg 1456w" sizes="100vw"></picture><div></div></div></a></figure></div><h2>Progress</h2><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!HZ_G!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd41a4285-cab3-4ad3-b599-5c5fbfc25edd_968x481.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!HZ_G!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd41a4285-cab3-4ad3-b599-5c5fbfc25edd_968x481.png 424w, https://substackcdn.com/image/fetch/$s_!HZ_G!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd41a4285-cab3-4ad3-b599-5c5fbfc25edd_968x481.png 848w, https://substackcdn.com/image/fetch/$s_!HZ_G!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd41a4285-cab3-4ad3-b599-5c5fbfc25edd_968x481.png 1272w, https://substackcdn.com/image/fetch/$s_!HZ_G!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd41a4285-cab3-4ad3-b599-5c5fbfc25edd_968x481.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!HZ_G!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd41a4285-cab3-4ad3-b599-5c5fbfc25edd_968x481.png" width="968" height="481" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d41a4285-cab3-4ad3-b599-5c5fbfc25edd_968x481.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:481,&quot;width&quot;:968,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:54466,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.harmony-developers.com/i/160003874?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd41a4285-cab3-4ad3-b599-5c5fbfc25edd_968x481.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!HZ_G!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd41a4285-cab3-4ad3-b599-5c5fbfc25edd_968x481.png 424w, https://substackcdn.com/image/fetch/$s_!HZ_G!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd41a4285-cab3-4ad3-b599-5c5fbfc25edd_968x481.png 848w, https://substackcdn.com/image/fetch/$s_!HZ_G!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd41a4285-cab3-4ad3-b599-5c5fbfc25edd_968x481.png 1272w, https://substackcdn.com/image/fetch/$s_!HZ_G!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd41a4285-cab3-4ad3-b599-5c5fbfc25edd_968x481.png 1456w" sizes="100vw"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><ul><li><p>&#10068; : Unknown;</p></li><li><p>&#11093; : Not supported;</p></li><li><p>&#10060; : With compiling error;</p></li><li><p>&#128736;&#65039; : Under developing;</p></li><li><p>&#8265;&#65039; : With running error;</p></li><li><p>&#10004;&#65039; : Running well.</p></li></ul><h3>Unsupported Features in WebAssembly</h3><ul><li><p>Load Lua script with file;(Will trigger a prompt window)</p></li><li><p><a href="https://github.com/emscripten-core/emscripten/issues/16567">C/C++ callback JS function in async thread</a>.</p></li></ul><h2>Requirements</h2><ul><li><p>C99, C++23;</p></li><li><p>Clang 15+;</p></li><li><p>CMake 3.10+;</p></li><li><p>Xcode 14.0+, for iOS &amp; macOS;</p></li><li><p>Android Studio(or IntelliJ IDEA) with NDK r25+;</p></li><li><p>DevEco Studio with Native SDK, for HarmonyOS;</p></li><li><p><a href="https://emscripten.org/docs/getting_started/downloads.html#sdk-download-and-install">Emscripten</a>, for WebAssembly.</p></li></ul><h2>C++ New Features Compatibility</h2><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Ok6Q!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb98163bf-aa7c-4b4b-8737-e0e76aa40056_808x215.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Ok6Q!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb98163bf-aa7c-4b4b-8737-e0e76aa40056_808x215.png 424w, https://substackcdn.com/image/fetch/$s_!Ok6Q!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb98163bf-aa7c-4b4b-8737-e0e76aa40056_808x215.png 848w, https://substackcdn.com/image/fetch/$s_!Ok6Q!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb98163bf-aa7c-4b4b-8737-e0e76aa40056_808x215.png 1272w, https://substackcdn.com/image/fetch/$s_!Ok6Q!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb98163bf-aa7c-4b4b-8737-e0e76aa40056_808x215.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Ok6Q!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb98163bf-aa7c-4b4b-8737-e0e76aa40056_808x215.png" width="808" height="215" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b98163bf-aa7c-4b4b-8737-e0e76aa40056_808x215.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:215,&quot;width&quot;:808,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:30697,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.harmony-developers.com/i/160003874?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb98163bf-aa7c-4b4b-8737-e0e76aa40056_808x215.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Ok6Q!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb98163bf-aa7c-4b4b-8737-e0e76aa40056_808x215.png 424w, https://substackcdn.com/image/fetch/$s_!Ok6Q!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb98163bf-aa7c-4b4b-8737-e0e76aa40056_808x215.png 848w, https://substackcdn.com/image/fetch/$s_!Ok6Q!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb98163bf-aa7c-4b4b-8737-e0e76aa40056_808x215.png 1272w, https://substackcdn.com/image/fetch/$s_!Ok6Q!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb98163bf-aa7c-4b4b-8737-e0e76aa40056_808x215.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><h2>Dependencies</h2><ul><li><p><a href="https://github.com/ada-url/ada">ada-url</a>: URL parser;(Requires <code>std::ranges</code> in C++20)</p></li><li><p><a href="https://github.com/curl/curl">curl</a>: Networking;</p></li><li><p><a href="https://github.com/DaveGamble/cJSON">cJSON</a>: JSON codec;</p></li><li><p><a href="https://github.com/libuv/libuv">libuv</a>: Asynchronous I/O;</p></li><li><p><a href="https://github.com/lua/lua">lua</a>: Lua runtime;</p></li><li><p><a href="https://github.com/Tencent/MMKV">MMKV</a>: Key-value storage;</p></li><li><p><a href="https://github.com/openssl/openssl">openssl</a>: Crypto;</p></li><li><p><a href="https://github.com/bellard/quickjs">quickjs</a>: JS runtime;</p></li><li><p><a href="https://github.com/sqlite/sqlite">sqlite</a>: DB storage.</p></li></ul><p>GitHub link: <a href="https://github.com/R1NC/NGenXX">R1NC/NGenXX: A cross-platform framework based on modern C++, supporting biz dev via Lua &amp; JS.</a></p>]]></content:encoded></item><item><title><![CDATA[OpenHarmony Zig-addon ]]></title><description><![CDATA[Note: This project is still in the early stage of development and is not ready for use. You can use it as a toy.]]></description><link>https://www.harmony-developers.com/p/openharmony-zig-addon</link><guid isPermaLink="false">https://www.harmony-developers.com/p/openharmony-zig-addon</guid><dc:creator><![CDATA[Harmony OS Developers]]></dc:creator><pubDate>Sat, 22 Mar 2025 06:31:37 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/028bd538-2457-4fc1-bed3-4ec0f249901e_1920x1080.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h1>zig-addon</h1><p>This project can help us to build a native module library for OpenHarmony/HarmonyNext with zig-lang.</p><blockquote><p>Note: This project is still in the early stage of development and is not ready for use. You can use it as a toy.</p></blockquote><h2>Example</h2><p>We provide a simple example to help you get started in <code>examples/add</code>.</p><p>Just run the following command to build the example:</p><pre><code>zig build</code></pre><p>And you can get <code>libadd.so</code> in <code>zig-out/dist</code>.</p><p>Original GitHub link: <a href="https://github.com/harmony-contrib/zig-addon">harmony-contrib/zig-addon: A zig tool use zig to build harmony native module</a></p>]]></content:encoded></item><item><title><![CDATA[Building application for OpenHarmony with Rust (In progress)]]></title><description><![CDATA[This project is in progress, and the API is not stable.]]></description><link>https://www.harmony-developers.com/p/building-application-for-openharmony</link><guid isPermaLink="false">https://www.harmony-developers.com/p/building-application-for-openharmony</guid><dc:creator><![CDATA[Harmony OS Developers]]></dc:creator><pubDate>Sat, 22 Mar 2025 06:24:15 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/66856024-131c-47e7-9c48-ffd24f397fef_709x438.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h1>OpenHarmony Ability</h1><blockquote><p>This project is in progress, and the API is not stable.</p></blockquote><p><code>openharmony-ability</code> is a crate to manage OpenHarmony application's activity with rust, be similar to <a href="https://github.com/rust-mobile/android-activity">android-activity</a>.</p><h2>Architecture</h2><p>The architecture of OpenHarmony is similar to Node.js, where we need to manage the application's lifecycle via callbacks. Hence, there are a few key points to keep in mind.</p><ol><li><p>Don't block the main thread as it can lead to application freezing and crashing.</p></li><li><p>openharmony-ability's run_loop doesn't retain the resource and ownership, so if you create a new resource, you should leak it to prevent NULL pointer.</p></li></ol><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Yx18!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F32dfc65b-0d17-436b-b554-077a6f80438b_4350x2180.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Yx18!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F32dfc65b-0d17-436b-b554-077a6f80438b_4350x2180.png 424w, https://substackcdn.com/image/fetch/$s_!Yx18!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F32dfc65b-0d17-436b-b554-077a6f80438b_4350x2180.png 848w, https://substackcdn.com/image/fetch/$s_!Yx18!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F32dfc65b-0d17-436b-b554-077a6f80438b_4350x2180.png 1272w, https://substackcdn.com/image/fetch/$s_!Yx18!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F32dfc65b-0d17-436b-b554-077a6f80438b_4350x2180.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Yx18!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F32dfc65b-0d17-436b-b554-077a6f80438b_4350x2180.png" width="1456" height="730" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/32dfc65b-0d17-436b-b554-077a6f80438b_4350x2180.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:730,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Architecture&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Architecture" title="Architecture" srcset="https://substackcdn.com/image/fetch/$s_!Yx18!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F32dfc65b-0d17-436b-b554-077a6f80438b_4350x2180.png 424w, https://substackcdn.com/image/fetch/$s_!Yx18!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F32dfc65b-0d17-436b-b554-077a6f80438b_4350x2180.png 848w, https://substackcdn.com/image/fetch/$s_!Yx18!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F32dfc65b-0d17-436b-b554-077a6f80438b_4350x2180.png 1272w, https://substackcdn.com/image/fetch/$s_!Yx18!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F32dfc65b-0d17-436b-b554-077a6f80438b_4350x2180.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>We provide some packages or crates to help you develop OpenHarmony application with Rust.</p><h3>ArkTS</h3><p>We need a entry-point to start the application, and we use ArkTS to manage the application's lifecycle.</p><ul><li><p><a href="https://github.com/harmony-contrib/openharmony-ability/blob/main/package/README.md">@ohos-rs/ability</a><br>All of ability need to extend <code>RustAbility</code> and all lifecycle need to call <code>super.xx</code> to make sure the ability can work normally.</p></li></ul><h3>Rust</h3><ul><li><p><a href="https://github.com/harmony-contrib/openharmony-ability/blob/main/crates/ability/README.md">openharmony-ability</a><br>Basic crate to manage the application's lifecycle.</p></li><li><p><a href="https://github.com/harmony-contrib/openharmony-ability/blob/main/crates/derive/README.md">openharmony-ability-derive</a><br>Macro to generate the ability's implementation.</p></li></ul><h2>Usage</h2><ol><li><p>use <code>ohrs</code> to init project and add <code>openharmony-ability</code> dependencies.</p></li></ol><pre><code>ohrs init hello

cargo add openharmony-ability
cargo add openharmony-ability-derive</code></pre><ol><li><p>Add the follow code to <code>lib.rs</code>.</p></li></ol><pre><code>use ohos_hilog_binding::hilog_info;
use openharmony_ability::App;
use openharmony_ability_derive::ability;

#[ability]
fn openharmony_app(app: App) {
    app.run_loop(|types| {
        hilog_info!(format!("ohos-rs macro: {:?}", types.as_str()).as_str());
    });
}</code></pre><ol><li></li></ol><blockquote><p>Note: <code>ohos_hilog_binding</code> is a optional dependency and you can add or remove it.</p></blockquote><ol><li><p>Add <code>@ohos-rs/ability</code> to your <code>OpenHarmony/HarmonyNext</code> project.</p></li></ol><pre><code>ohpm install @ohos-rs/ability</code></pre><ol><li><p>change the <code>EntryAbility.ets</code> file to the follow code:</p></li></ol><pre><code>import { RustAbility } from "@ohos-rs/ability";
import Want from "@ohos.app.ability.Want";
import { AbilityConstant } from "@kit.AbilityKit";

export default class EntryAbility extends RustAbility {
  public moduleName: string = "example";

  async onCreate(
    want: Want,
    launchParam: AbilityConstant.LaunchParam
  ): Promise&lt;void&gt; {
    // Note: you should call super.onCreate to make sure the ability can work normally.
    super.onCreate(want, launchParam);
  }
}</code></pre><ol><li><p>Change the <code>moduleName</code> to your rust project name. For example, we need to change it with <code>hello</code> in this project.</p></li><li><p>Build your rust project and copy the dynamic library to (Open-)Harmony(Next) project.</p></li><li><p>Now, you can enjoy it.</p></li></ol><h2>Example</h2><p>See example with <a href="https://github.com/harmony-contrib/openharmony-ability/blob/main/example/src/lib.rs">example</a> </p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!M70m!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F19924abd-8039-4976-a411-122e358ac889_1855x1035.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!M70m!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F19924abd-8039-4976-a411-122e358ac889_1855x1035.png 424w, https://substackcdn.com/image/fetch/$s_!M70m!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F19924abd-8039-4976-a411-122e358ac889_1855x1035.png 848w, https://substackcdn.com/image/fetch/$s_!M70m!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F19924abd-8039-4976-a411-122e358ac889_1855x1035.png 1272w, https://substackcdn.com/image/fetch/$s_!M70m!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F19924abd-8039-4976-a411-122e358ac889_1855x1035.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!M70m!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F19924abd-8039-4976-a411-122e358ac889_1855x1035.png" width="1456" height="812" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/19924abd-8039-4976-a411-122e358ac889_1855x1035.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:812,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:147529,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.harmony-developers.com/i/159600770?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F19924abd-8039-4976-a411-122e358ac889_1855x1035.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!M70m!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F19924abd-8039-4976-a411-122e358ac889_1855x1035.png 424w, https://substackcdn.com/image/fetch/$s_!M70m!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F19924abd-8039-4976-a411-122e358ac889_1855x1035.png 848w, https://substackcdn.com/image/fetch/$s_!M70m!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F19924abd-8039-4976-a411-122e358ac889_1855x1035.png 1272w, https://substackcdn.com/image/fetch/$s_!M70m!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F19924abd-8039-4976-a411-122e358ac889_1855x1035.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Original GitHub link: <a href="https://github.com/harmony-contrib/openharmony-ability?tab=readme-ov-file">harmony-contrib/openharmony-ability: Building application for OpenHarmony with Rust</a></p>]]></content:encoded></item><item><title><![CDATA[ASP.NET Core Blazor Hybrid Adaptation on HarmonyOS with Avalonia (software framework) ]]></title><description><![CDATA[The ASP.NET Core Blazor Hybrid framework with Avalonia (software framework) has been adapted to HarmonyOS, welcome everyone to try it out]]></description><link>https://www.harmony-developers.com/p/aspnet-core-blazor-hybrid-adaptation</link><guid isPermaLink="false">https://www.harmony-developers.com/p/aspnet-core-blazor-hybrid-adaptation</guid><dc:creator><![CDATA[Harmony OS Developers]]></dc:creator><pubDate>Sat, 01 Mar 2025 19:05:50 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!oWQh!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9612d423-ef23-4698-8f08-2a9ce41856ae_1650x846.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!oWQh!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9612d423-ef23-4698-8f08-2a9ce41856ae_1650x846.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!oWQh!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9612d423-ef23-4698-8f08-2a9ce41856ae_1650x846.png 424w, https://substackcdn.com/image/fetch/$s_!oWQh!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9612d423-ef23-4698-8f08-2a9ce41856ae_1650x846.png 848w, https://substackcdn.com/image/fetch/$s_!oWQh!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9612d423-ef23-4698-8f08-2a9ce41856ae_1650x846.png 1272w, https://substackcdn.com/image/fetch/$s_!oWQh!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9612d423-ef23-4698-8f08-2a9ce41856ae_1650x846.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!oWQh!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9612d423-ef23-4698-8f08-2a9ce41856ae_1650x846.png" width="1456" height="747" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9612d423-ef23-4698-8f08-2a9ce41856ae_1650x846.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:747,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:355522,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://www.harmony-developers.com/i/158185863?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9612d423-ef23-4698-8f08-2a9ce41856ae_1650x846.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!oWQh!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9612d423-ef23-4698-8f08-2a9ce41856ae_1650x846.png 424w, https://substackcdn.com/image/fetch/$s_!oWQh!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9612d423-ef23-4698-8f08-2a9ce41856ae_1650x846.png 848w, https://substackcdn.com/image/fetch/$s_!oWQh!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9612d423-ef23-4698-8f08-2a9ce41856ae_1650x846.png 1272w, https://substackcdn.com/image/fetch/$s_!oWQh!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9612d423-ef23-4698-8f08-2a9ce41856ae_1650x846.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>The ASP.NET Core Blazor Hybrid framework has been adapted to HarmonyOS, welcome everyone to try it out, and (Dust Renault via BiliBili) have created a OpenHarmony.NET organization, welcome everyone to follow. </p><div class="native-video-embed" data-component-name="VideoPlaceholder" data-attrs="{&quot;mediaUploadId&quot;:&quot;178c8b9d-27c8-48c6-9415-814ffaab1a7c&quot;,&quot;duration&quot;:null}"></div><p></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!KD-1!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fea244cb9-3db1-483b-a4cd-cc3138bb854d_1280x800.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!KD-1!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fea244cb9-3db1-483b-a4cd-cc3138bb854d_1280x800.png 424w, https://substackcdn.com/image/fetch/$s_!KD-1!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fea244cb9-3db1-483b-a4cd-cc3138bb854d_1280x800.png 848w, https://substackcdn.com/image/fetch/$s_!KD-1!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fea244cb9-3db1-483b-a4cd-cc3138bb854d_1280x800.png 1272w, https://substackcdn.com/image/fetch/$s_!KD-1!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fea244cb9-3db1-483b-a4cd-cc3138bb854d_1280x800.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!KD-1!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fea244cb9-3db1-483b-a4cd-cc3138bb854d_1280x800.png" width="1280" height="800" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ea244cb9-3db1-483b-a4cd-cc3138bb854d_1280x800.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:800,&quot;width&quot;:1280,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:601353,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.harmony-developers.com/i/158185863?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fea244cb9-3db1-483b-a4cd-cc3138bb854d_1280x800.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!KD-1!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fea244cb9-3db1-483b-a4cd-cc3138bb854d_1280x800.png 424w, https://substackcdn.com/image/fetch/$s_!KD-1!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fea244cb9-3db1-483b-a4cd-cc3138bb854d_1280x800.png 848w, https://substackcdn.com/image/fetch/$s_!KD-1!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fea244cb9-3db1-483b-a4cd-cc3138bb854d_1280x800.png 1272w, https://substackcdn.com/image/fetch/$s_!KD-1!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fea244cb9-3db1-483b-a4cd-cc3138bb854d_1280x800.png 1456w" sizes="100vw"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><em>Blazor Hybrid - The adaptation has been completed, everyone is welcome to experience it!</em></p><p>Blazor is a .NET front end framework for building web apps using only .NET technologies. In 2021, Blazor extended to the desktop with Blazor Hybrid, allowing developers to use their existing skills on desktop platforms.</p><p>Blazor Hybrid apps are traditional desktop apps that host the actual Blazor web app inside a web view control. They use .NET MAUI for the desktop side, but you can use another framework if it doesn&#8217;t meet your requirements.</p><p>The lack of Linux support and the use of different browser engines on Windows and macOS are limitations of MAUI. Microsoft Edge and Safari vary in how they implement web standards, execute JavaScript, and render pages. In advanced apps, this difference can be a source of bugs and require additional testing.</p><p>If MAUI is not an option, consider opting for Avalonia UI &#8212; a cross-platform UI library with several Chromium-based web views in its ecosystem.</p><p>Original article: <a href="https://teamdev.com/dotnetbrowser/blog/blazor-hybrid-apps-in-avalonia-ui/">Blazor hybrid apps in Avalonia UI | Blog | DotNetBrowser</a></p><p>Code repositories: <a href="https://github.com/OpenHarmony-NET/OpenHarmony.Blazor.Hybrid Organization: https://github.com/OpenHarmony-NET">https://github.com/OpenHarmony-NET/OpenHarmony.Blazor.Hybrid </a></p><p>Organization:<a href="https://github.com/OpenHarmony-NET"> https://github.com/OpenHarmony-NET</a></p><p><a href="https://www.bilibili.com/video/BV1v6XoY4EVR/?spm_id_from=333.337.search-card.all.click&amp;vd_source=97c4bc44d1f801f8bda51d89e34e99ad">Original source (Dust Renault via BiliBili - China)</a></p><p><a href="https://avaloniaui.net/">Avalonia UI</a> - Official Website</p><p>Previous Article: <a href="https://www.harmony-developers.com/p/netavalonia-adaptation-to-harmonyos?utm_source=publication-search">.NET/Avalonia adaptation to HarmonyOS progress</a></p>]]></content:encoded></item><item><title><![CDATA[Breakpoint Adaptation in HarmonyOS Next —— Making Applications Adapt to Different Screen Sizes ]]></title><description><![CDATA[This article aims to deeply explore the technical details of the Huawei HarmonyOS Next system and summarize them based on practical development practices.]]></description><link>https://www.harmony-developers.com/p/breakpoint-adaptation-in-harmonyos</link><guid isPermaLink="false">https://www.harmony-developers.com/p/breakpoint-adaptation-in-harmonyos</guid><dc:creator><![CDATA[Harmony OS Developers]]></dc:creator><pubDate>Wed, 26 Feb 2025 12:45:48 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/1574a30e-e138-4de5-8b87-830b0c89f504_2702x1783.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h1>Breakpoint Adaptation in HarmonyOS Next &#8212;&#8212; Making Applications Adapt to Different Screen Sizes</h1><blockquote><p>This article aims to deeply explore the technical details of the Huawei HarmonyOS Next system and summarize them based on practical development practices. It mainly serves as a medium for technical sharing and communication. There may inevitably be some errors or omissions. Colleagues are welcome to put forward valuable opinions and questions so that we can make progress together. This article is original content, and any form of reprint must indicate the source and the original author.</p></blockquote><p>In the application development of HarmonyOS Next, making applications perfectly adapt to different screen sizes is the key to enhancing the user experience. The breakpoint adaptation technology is like a magic key, helping developers easily open the door to cross-device adaptation. Today, let's take an in-depth look at the relevant knowledge of breakpoint adaptation.</p><h2>The Concept and Definition of Breakpoints</h2><p>Breakpoints, simply put, are the "scales" that divide the width of the application window into different intervals. Through these intervals, developers can set different layouts and styles for the application according to different screen size ranges, so as to achieve the best display effect of the application on various devices. In HarmonyOS Next, the common breakpoint divisions are as follows:<br>| Breakpoint Name | Value Range (vp) |<br>| --- | --- |<br>| XS | [0, 320) |<br>| sm | [320, 600) |<br>| md | [600, 840) |<br>| lg | [840, +&#8734;) |</p><p>This division is not set in stone, and developers can adjust it according to the actual project requirements. For example, if the application is mainly aimed at tablets and large-screen devices, it may not be necessary to adapt to the XS breakpoint; for some special application scenarios, additional breakpoints such as xl and xxl can be added after the lg breakpoint. However, it should be noted that although adding new breakpoints can make the layout more refined, it will also increase the workload of development and design.</p><h2>Using Breakpoint Adaptation in Grid and Navigation Components</h2><h3>Grid Component</h3><p>The Grid component is a powerful assistant for implementing responsive layouts. When used in conjunction with breakpoints, it allows page elements to present different arrangements under different screen sizes. Here is a simple example:</p><pre><code><code>@Entry
@Component
struct GridBreakpointSample {
    @State currentBreakpoint: string = 'unknown'
    build() {
        GridRow({ breakpoints: { value: ['600vp', '840vp'], reference: BreakpointsReference.WindowSize } }) {
            GridCol({ span: { xs: 12, sm: 6, md: 4, lg: 3 } }) {
                Column() {
                    Image($r('app.media.image')).width('100%').aspectRatio(1).backgroundColor('#F1F3F5')
                    Text('Image Description').fontSize(14).textAlign(TextAlign.Center)
                }
            }
        }
          .onBreakpointChange((currentBreakpoint: string) =&gt; {
                this.currentBreakpoint = currentBreakpoint
            })
    }
}
</code></code></pre><p>In the above code, the <code>GridRow</code> component sets the breakpoints through the <code>breakpoints</code> property. Under different breakpoints, the number of columns occupied by the <code>GridCol</code> component is different: it occupies 12 columns under the xs breakpoint, which is suitable for the single-column layout of small-screen devices; it occupies 6 columns under the sm breakpoint; it occupies 4 columns under the md breakpoint; it occupies 3 columns under the lg breakpoint, which is more suitable for the multi-column display of large-screen devices. In this way, the layout of the image and text can be automatically adjusted according to the screen size, ensuring that users can get a good visual experience on different devices.</p><h3>Navigation Component</h3><p>While implementing page navigation, the Navigation component can also adapt to different screen sizes with the help of breakpoints. For example, a stacked navigation may be used on small screens, while a columnar navigation may be switched to on large screens.</p><pre><code><code>@Entry
@Component
struct NavigationBreakpointSample {
    @State currentBreakpoint: string ='sm'
    @State pageInfos: NavPathStack = new NavPathStack()
    build() {
        Navigation(this.pageInfos) {
            if (this.currentBreakpoint ==='sm') {
                // Use stacked navigation on small screens
                Column() {
                    List() {
                        ListItem() {
                            Text('Page 1').fontSize(20).onClick(() =&gt; {
                                this.pageInfos.pushPath({ name: 'Page1' })
                            })
                        }
                        ListItem() {
                            Text('Page 2').fontSize(20).onClick(() =&gt; {
                                this.pageInfos.pushPath({ name: 'Page2' })
                            })
                        }
                    }
                }
            } else {
                // Use columnar navigation on large screens
                Row() {
                    Column() {
                        List() {
                            ListItem() {
                                Text('Page 1').fontSize(20).onClick(() =&gt; {
                                    this.pageInfos.pushPath({ name: 'Page1' })
                                })
                            }
                            ListItem() {
                                Text('Page 2').fontSize(20).onClick(() =&gt; {
                                    this.pageInfos.pushPath({ name: 'Page2' })
                                })
                            }
                        }
                    }
                    Column() {
                        // Content area
                        NavDestination() {
                            if (this.pageInfos.current.path === 'Page1') {
                                Text('This is the content of Page 1').fontSize(20).padding(20)
                            } else if (this.pageInfos.current.path === 'Page2') {
                                Text('This is the content of Page 2').fontSize(20).padding(20)
                            }
                        }
                    }
                }
            }
        }
          .mode(NavigationMode.Auto)
          .onBreakpointChange((breakpoint: string) =&gt; {
                this.currentBreakpoint = breakpoint
            })
    }
}
</code></code></pre><p>In this example, the change of breakpoints is monitored through the <code>onBreakpointChange</code> event, and the layout mode inside the Navigation component is determined according to the current breakpoint value <code>currentBreakpoint</code>. In the case of a small screen (sm breakpoint), a stacked layout is used, and in the case of a large screen, it is switched to a columnar layout, providing users with a more convenient navigation experience.</p><h2>Dynamically Monitoring Window Changes to Adjust the UI</h2><p><code>onBreakpointChange</code> is an important method for implementing dynamic UI adaptation. It can promptly notify developers when the breakpoint changes, so as to make corresponding adjustments to the UI. In addition to the applications in the Grid and Navigation components mentioned earlier, it can also play a role in more complex page layouts.</p><pre><code><code>@Entry
@Component
struct DynamicUIAdjustment {
    @State currentBreakpoint: string ='sm'
    @State isSideBarVisible: boolean = false
    build() {
        Column() {
            if (this.currentBreakpoint ==='sm') {
                // Layout for small screens
                Button('Toggle Sidebar').onClick(() =&gt; {
                    this.isSideBarVisible =!this.isSideBarVisible
                })
                if (this.isSideBarVisible) {
                    // Display sidebar content
                    Text('Sidebar Content').fontSize(20).backgroundColor('#F1F3F5')
                }
            } else {
                // Layout for large screens, always display the sidebar
                Row() {
                    Column() {
                        Text('Sidebar Content').fontSize(20).backgroundColor('#F1F3F5')
                    }
                    .width('30%')
                    // Main content area
                    Column() {
                        Text('Main Content').fontSize(20).padding(20)
                    }
                }
            }
        }
          .onBreakpointChange((breakpoint: string) =&gt; {
                this.currentBreakpoint = breakpoint
                if (breakpoint!=='sm') {
                    this.isSideBarVisible = true
                }
            })
    }
}
</code></code></pre><p>In this example, the <code>onBreakpointChange</code> event not only updates the <code>currentBreakpoint</code> state but also adjusts the display logic of the sidebar according to the breakpoint change. Under the small screen (sm breakpoint), the display and hiding of the sidebar are controlled by a button; while under the large screen, the sidebar is always displayed. In this way, the application interface can be dynamically adjusted according to the change of the window size, providing users with a more seamless user experience.</p><p>The breakpoint adaptation technology of HarmonyOS Next provides developers with powerful tools. By reasonably using breakpoints, achieving adaptation in components such as Grid and Navigation, and dynamically adjusting the UI with the help of <code>onBreakpointChange</code>, applications can show their best state on devices with different screen sizes. It is hoped that everyone can master these skills proficiently in actual development and create higher-quality applications.</p><p><a href="https://dev.to/xun_wang_6384a403f9817c2/breakpoint-adaptation-in-harmonyos-next-making-applications-adapt-to-different-screen-sizes-52np">Original blog post: Breakpoint Adaptation in HarmonyOS Next &#8212;&#8212; Making Applications Adapt to Different Screen Sizes - DEV Community</a></p>]]></content:encoded></item><item><title><![CDATA[Free Window Adaptation in HarmonyOS Next]]></title><description><![CDATA[This article aims to deeply explore the technical details of the Huawei HarmonyOS Next system and summarize them based on practical development practices.]]></description><link>https://www.harmony-developers.com/p/free-window-adaptation-in-harmonyos</link><guid isPermaLink="false">https://www.harmony-developers.com/p/free-window-adaptation-in-harmonyos</guid><dc:creator><![CDATA[Harmony OS Developers]]></dc:creator><pubDate>Wed, 26 Feb 2025 12:39:25 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/58ea9cc5-6c21-459b-84fd-a163af94c94f_3840x3062.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h1>Free Window Adaptation in HarmonyOS Next</h1><blockquote><p>This article aims to deeply explore the technical details of the Huawei HarmonyOS Next system and summarize them based on practical development practices. It mainly serves as a medium for technical sharing and communication. There may inevitably be some errors or omissions. Colleagues are welcome to put forward valuable opinions and questions so that we can make progress together. This article is original content, and any form of reprint must indicate the source and the original author.</p></blockquote><p>In the ecosystem of HarmonyOS Next, free window adaptation is an important part of enhancing the flexibility of applications and the user experience. It allows users to freely adjust the size of the application window, bringing great convenience to multi-device usage scenarios. Next, let's take an in-depth look at the relevant knowledge of free window adaptation.</p><h2>Introduction to the Free Window Mode</h2><p>The free window mode, simply put, means that the size of the application window can be freely adjusted by the user, no longer limited to a fixed size. This mode is suitable for a variety of scenarios. For example, when a user is processing documents and viewing materials on a tablet device at the same time, they can adjust both the document application and the browser application to an appropriate window size to achieve efficient multi-tasking. Or on a large-screen device, users can flexibly adjust the size of the video playback window according to their needs while taking into account other operations. In the free window mode, the application can adjust the layout in real time according to the change of the window size, providing users with a more personalized usage experience.</p><h2>How to Limit the Size Range of the Free Window</h2><p>In HarmonyOS Next, developers can limit the size range of the free window by setting a series of parameters in the application configuration file. These parameters include <code>minWindowWidth</code>, <code>minWindowHeight</code>, <code>maxWindowWidth</code>, <code>maxWindowHeight</code>, <code>minWindowRatio</code>, and <code>maxWindowRatio</code>, etc.</p><p><code>minWindowWidth</code> and <code>minWindowHeight</code> are used to set the minimum window width and height supported by the application, with the unit being vp (virtual pixels). For example, if <code>minWindowWidth</code> is set to 320, then when the user adjusts the window width to be less than 320vp, the window will not be able to shrink further. Similarly, <code>maxWindowWidth</code> and <code>maxWindowHeight</code> limit the maximum width and height of the window.</p><p><code>minWindowRatio</code> and <code>maxWindowRatio</code> specify the minimum and maximum width-to-height ratios of the window. For example, setting <code>minWindowRatio</code> to 0.5 means that the width of the window is at least 0.5 times its height, which can ensure that during the window adjustment process, the content will not be displayed abnormally due to an unbalanced width-to-height ratio.</p><p>The following is an example of setting these parameters in the application configuration file:</p><pre><code><code>{
    "module": {
        //...
        "abilities": [
            {
                //...
                "minWindowWidth": 320,
                "minWindowHeight": 240,
                "maxWindowWidth": 1440,
                "maxWindowHeight": 900,
                "minWindowRatio": 0.5,
                "maxWindowRatio": 2
            }
        ]
    }
}
</code></code></pre><p>By reasonably setting these parameters, developers can meet the different users' needs for window size adjustment while ensuring the normal display of the application interface, and at the same time avoid problems such as layout confusion caused by excessive changes in the window size.</p><h2>Optimizing the Free Window Experience by Combining Adaptive and Responsive Layouts</h2><p>In order to provide a smoother and more beautiful user experience in the free window mode, we can combine adaptive and responsive layouts. The adaptive layout can ensure that when the window size changes within a certain range, the display of page elements remains normal; while the responsive layout can adjust the page structure to adapt to the new size when the window size changes significantly.</p><p>The following is an example code showing how to combine these two layouts in the free window mode:</p><pre><code><code>@Entry
@Component
struct FreeWindowLayout {
    @State currentBreakpoint: string ='sm'
    build() {
        GridRow({ breakpoints: { value: ['600vp', '840vp'], reference: BreakpointsReference.WindowSize } }) {
            GridCol({ span: { xs: 12, sm: 6, md: 4, lg: 3 } }) {
                Column() {
                    // Example of adaptive layout: Image scaling
                    Image($r('app.media.image')).width('100%').aspectRatio(1).backgroundColor('#F1F3F5')
                    // Example of responsive layout: Adjusting the text size under different breakpoints
                    if (this.currentBreakpoint ==='sm') {
                        Text('Image Description').fontSize(14).textAlign(TextAlign.Center)
                    } else {
                        Text('Image Description').fontSize(16).textAlign(TextAlign.Center)
                    }
                }
            }
        }
          .onBreakpointChange((breakpoint: string) =&gt; {
                this.currentBreakpoint = breakpoint
            })
    }
}
</code></code></pre><p>In this example, the <code>GridRow</code> and <code>GridCol</code> components form the basic layout framework, and the responsive layout is achieved by using breakpoints. Under different breakpoints, the number of columns occupied by the <code>GridCol</code> component is different, and the layout of the image and text will be adjusted accordingly. At the same time, by setting <code>width('100%')</code> and <code>aspectRatio(1)</code> for the image, it has the ability to adapt to the window size and always maintain an appropriate display ratio.</p><p>For another example, on the product detail page of an e-commerce application, it can be optimized like this:</p><pre><code><code>@Entry
@Component
struct ProductDetailPage {
    @State currentBreakpoint: string ='sm'
    build() {
        Column() {
            if (this.currentBreakpoint ==='sm') {
                // Layout for a small window, with the image on top and the text below
                Image($r('app.media.productImg')).width('100%').aspectRatio(1.5)
                Text('Product Details: This is a really great product...').fontSize(14).padding(10)
            } else {
                // Layout for a large window, with the image and text side by side
                Row() {
                    Image($r('app.media.productImg')).width('40%').aspectRatio(1.5)
                    Column() {
                        Text('Product Details: This is a really great product...').fontSize(16).padding(10)
                    }
                      .width('60%')
                }
            }
        }
          .onBreakpointChange((breakpoint: string) =&gt; {
                this.currentBreakpoint = breakpoint
            })
    }
}
</code></code></pre><p>In this way, in the free window mode, no matter how the window size changes, the application can provide users with a good visual and interactive experience through the adaptive and responsive layouts, making the content display more reasonable and comfortable.</p><p>The free window adaptation function of HarmonyOS Next brings more possibilities to application development. By reasonably limiting the window size range and skillfully combining the adaptive and responsive layouts, developers can create applications that perform well in the free window mode and meet the diverse usage needs of users. It is hoped that everyone can make full use of these technologies in actual development to bring a better application experience to users.</p><p></p><p><a href="https://dev.to/xun_wang_6384a403f9817c2/free-window-adaptation-in-harmonyos-next-97g">Original Blog Post: Free Window Adaptation in HarmonyOS Next - DEV Community</a></p>]]></content:encoded></item><item><title><![CDATA[ArkUI-X to build a cross-platform app for all three platforms: Android, iOS and HarmonyOS NEXT/OpenHarmony-Oniro]]></title><description><![CDATA[You can build an open-source ArkUI-X framework to build a cross-platform app to run everywhere regardless of platforms]]></description><link>https://www.harmony-developers.com/p/arkui-x-to-build-a-cross-platform</link><guid isPermaLink="false">https://www.harmony-developers.com/p/arkui-x-to-build-a-cross-platform</guid><dc:creator><![CDATA[Harmony OS Developers]]></dc:creator><pubDate>Wed, 26 Feb 2025 10:37:02 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/50cd9074-fd3d-4d4f-8574-44c08695069e_426x342.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>You can build an open-source ArkUI-X framework to build a cross-platform app. See how an app for Android and HarmonyOS NEXT is built at the same time If you have a Mac, you can build an app for three platforms (Android, iOS, and HarmonyOS NEXT/OpenHarmony-Oniro). A developer here used qwen AI to write a basic application.</p><div id="youtube2-Vm54LfMd5Ic" class="youtube-wrap" data-attrs="{&quot;videoId&quot;:&quot;Vm54LfMd5Ic&quot;,&quot;startTime&quot;:null,&quot;endTime&quot;:null}" data-component-name="Youtube2ToDOM"><div class="youtube-inner"><iframe src="https://www.youtube-nocookie.com/embed/Vm54LfMd5Ic?rel=0&amp;autoplay=0&amp;showinfo=0&amp;enablejsapi=0" frameborder="0" loading="lazy" gesture="media" allow="autoplay; fullscreen" allowautoplay="true" allowfullscreen="true" width="728" height="409"></iframe></div></div><p>@Sajjad Mayahi demonstration above here</p>]]></content:encoded></item><item><title><![CDATA[Building the First ArkTS Application in Stage Model on Oniro, OpenHarmony and HarmonyOS]]></title><description><![CDATA[Hello World, let's get started!]]></description><link>https://www.harmony-developers.com/p/building-the-first-arkts-application</link><guid isPermaLink="false">https://www.harmony-developers.com/p/building-the-first-arkts-application</guid><dc:creator><![CDATA[Harmony OS Developers]]></dc:creator><pubDate>Sun, 23 Feb 2025 15:45:25 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!rpSR!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa7911d34-9756-46b1-8b73-7aa985032ed4_899x651.bin" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2><strong>Creating an ArkTS Project</strong></h2><ol><li><p>If you are opening DevEco Studio for the first time, click <strong>Create Project</strong>. If a project is already open, choose <strong>File</strong> &gt; <strong>New</strong> &gt; <strong>Create Project</strong> from the menu bar.</p></li><li><p>On the <strong>Choose Your Ability Template</strong> page, select <strong>Application</strong> (or <strong>Atomic Service</strong>, depending on your project), select <strong>Empty Ability</strong> as the template, and click <strong>Next</strong>.</p><p>To develop a native project, select the <strong>Native C++</strong> template. For details about how to use other templates, see <a href="https://developer.huawei.com/consumer/en/doc/harmonyos-guides-V13/ide-template-V13">Introduction to Project Templates</a>.</p></li></ol><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!rpSR!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa7911d34-9756-46b1-8b73-7aa985032ed4_899x651.bin" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!rpSR!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa7911d34-9756-46b1-8b73-7aa985032ed4_899x651.bin 424w, https://substackcdn.com/image/fetch/$s_!rpSR!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa7911d34-9756-46b1-8b73-7aa985032ed4_899x651.bin 848w, https://substackcdn.com/image/fetch/$s_!rpSR!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa7911d34-9756-46b1-8b73-7aa985032ed4_899x651.bin 1272w, https://substackcdn.com/image/fetch/$s_!rpSR!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa7911d34-9756-46b1-8b73-7aa985032ed4_899x651.bin 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!rpSR!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa7911d34-9756-46b1-8b73-7aa985032ed4_899x651.bin" width="899" height="651" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a7911d34-9756-46b1-8b73-7aa985032ed4_899x651.bin&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:651,&quot;width&quot;:899,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:&quot;Click to enlarge&quot;,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="Click to enlarge" srcset="https://substackcdn.com/image/fetch/$s_!rpSR!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa7911d34-9756-46b1-8b73-7aa985032ed4_899x651.bin 424w, https://substackcdn.com/image/fetch/$s_!rpSR!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa7911d34-9756-46b1-8b73-7aa985032ed4_899x651.bin 848w, https://substackcdn.com/image/fetch/$s_!rpSR!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa7911d34-9756-46b1-8b73-7aa985032ed4_899x651.bin 1272w, https://substackcdn.com/image/fetch/$s_!rpSR!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa7911d34-9756-46b1-8b73-7aa985032ed4_899x651.bin 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><ol><li><p>On the <strong>Create Project</strong> page, <strong>Compatible SDK</strong> indicates the earliest compatible API version. Choose <strong>5.0.0(12)</strong> as an example and retain the default values for other parameters.</p></li></ol><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!sH_8!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe482d0a7-4d9e-484e-9bd3-7048f7aa28dc_791x650.bin" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!sH_8!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe482d0a7-4d9e-484e-9bd3-7048f7aa28dc_791x650.bin 424w, https://substackcdn.com/image/fetch/$s_!sH_8!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe482d0a7-4d9e-484e-9bd3-7048f7aa28dc_791x650.bin 848w, https://substackcdn.com/image/fetch/$s_!sH_8!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe482d0a7-4d9e-484e-9bd3-7048f7aa28dc_791x650.bin 1272w, https://substackcdn.com/image/fetch/$s_!sH_8!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe482d0a7-4d9e-484e-9bd3-7048f7aa28dc_791x650.bin 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!sH_8!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe482d0a7-4d9e-484e-9bd3-7048f7aa28dc_791x650.bin" width="791" height="650" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e482d0a7-4d9e-484e-9bd3-7048f7aa28dc_791x650.bin&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:650,&quot;width&quot;:791,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:&quot;Click to enlarge&quot;,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="Click to enlarge" srcset="https://substackcdn.com/image/fetch/$s_!sH_8!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe482d0a7-4d9e-484e-9bd3-7048f7aa28dc_791x650.bin 424w, https://substackcdn.com/image/fetch/$s_!sH_8!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe482d0a7-4d9e-484e-9bd3-7048f7aa28dc_791x650.bin 848w, https://substackcdn.com/image/fetch/$s_!sH_8!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe482d0a7-4d9e-484e-9bd3-7048f7aa28dc_791x650.bin 1272w, https://substackcdn.com/image/fetch/$s_!sH_8!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe482d0a7-4d9e-484e-9bd3-7048f7aa28dc_791x650.bin 1456w" sizes="100vw"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><ol><li><p>Click <strong>Finish</strong>. DevEco Studio will automatically generate the sample code and resources that match your project type. Wait until the project is created.</p></li></ol><h2><strong>ArkTS Project Directory Structure (Stage Model)</strong></h2><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!R8J_!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F72786f44-c9d3-4ad6-8ff3-8675f7a20eb4_521x861.bin" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!R8J_!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F72786f44-c9d3-4ad6-8ff3-8675f7a20eb4_521x861.bin 424w, https://substackcdn.com/image/fetch/$s_!R8J_!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F72786f44-c9d3-4ad6-8ff3-8675f7a20eb4_521x861.bin 848w, https://substackcdn.com/image/fetch/$s_!R8J_!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F72786f44-c9d3-4ad6-8ff3-8675f7a20eb4_521x861.bin 1272w, https://substackcdn.com/image/fetch/$s_!R8J_!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F72786f44-c9d3-4ad6-8ff3-8675f7a20eb4_521x861.bin 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!R8J_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F72786f44-c9d3-4ad6-8ff3-8675f7a20eb4_521x861.bin" width="521" height="861" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/72786f44-c9d3-4ad6-8ff3-8675f7a20eb4_521x861.bin&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:861,&quot;width&quot;:521,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:&quot;Click to enlarge&quot;,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="Click to enlarge" srcset="https://substackcdn.com/image/fetch/$s_!R8J_!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F72786f44-c9d3-4ad6-8ff3-8675f7a20eb4_521x861.bin 424w, https://substackcdn.com/image/fetch/$s_!R8J_!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F72786f44-c9d3-4ad6-8ff3-8675f7a20eb4_521x861.bin 848w, https://substackcdn.com/image/fetch/$s_!R8J_!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F72786f44-c9d3-4ad6-8ff3-8675f7a20eb4_521x861.bin 1272w, https://substackcdn.com/image/fetch/$s_!R8J_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F72786f44-c9d3-4ad6-8ff3-8675f7a20eb4_521x861.bin 1456w" sizes="100vw"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><ul><li><p><strong>AppScope &gt; app.json5</strong>: global configuration of your application. For details, see <a href="https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V13/app-configuration-file-V13">app.json5 Configuration File</a>.</p></li><li><p><strong>entry</strong>: HarmonyOS project module, which can be built into a Harmony Ability Package (HAP).</p><ul><li><p><strong>src &gt; main &gt; ets</strong>: a collection of ArkTS source code.</p></li><li><p><strong>src &gt; main &gt; ets &gt; entryability</strong>: entry to your application/service.</p></li><li><p><strong>src &gt; main &gt; ets &gt; entrybackupability</strong>: the ability to back up and restore data.</p></li><li><p><strong>src &gt; main &gt; ets &gt; pages</strong>: a collection of pages contained in your application/service.</p></li><li><p><strong>src &gt; main &gt; resources</strong>: a collection of resource files used by your application/service, such as graphics, multimedia, character strings, and layout files. For details about resource files, see <a href="https://developer.huawei.com/consumer/en/doc/harmonyos-guides-V13/resource-categories-and-access-V13">Resource Categories and Access</a>.</p></li><li><p><strong>src &gt; main &gt; module.json5</strong>: module configuration file. This file describes the global configuration information of the application/service, the device-specific configuration information, and the configuration information of the HAP file. For details about the configuration file, see <a href="https://developer.huawei.com/consumer/en/doc/harmonyos-guides-V13/module-configuration-file-V13">module.json5 Configuration File</a>.</p></li><li><p><strong>build-profile.json5</strong>: current module information and build configuration options, including <strong>buildOption</strong> and <strong>targets</strong>.</p></li><li><p><strong>hvigorfile.ts</strong>: module-level build script.</p></li><li><p><strong>obfuscation-rules.txt</strong>: obfuscation rule file. When obfuscation is enabled, the code will be compiled, obfuscated, and compressed during builds in release mode. For details, see <a href="https://developer.huawei.com/consumer/en/doc/harmonyos-guides-V13/ide-build-obfuscation-V13">Enabling Code Obfuscation</a>.</p></li><li><p><strong>oh-package.json5</strong>: describes the bundle name, version, entry file (type declaration file), and dependencies.</p></li></ul></li><li><p><strong>oh_modules</strong>: third-party library dependency information.</p></li><li><p><strong>build-profile.json5</strong>: project-level configuration information, including <strong>signingConfigs</strong> and <strong>products</strong>. Under <strong>products</strong>, you can set <strong>runtimeOS</strong> to <strong>HarmonyOS</strong> (by default).</p></li><li><p><strong>hvigorfile.ts</strong>: project-level build script.</p></li><li><p><strong>oh-package.json5</strong>: global configuration, including <strong>overrides</strong>, <strong>overrideDependencyMap</strong>, and <strong>parameterFile</strong>.</p></li></ul><h2><strong>Building the First Page</strong></h2><ol><li><p>Use the <strong>Text</strong> component.</p><p>After the project synchronization is complete, in the <strong>Project</strong> window, choose <strong>entry</strong> &gt; <strong>src</strong> &gt; <strong>main</strong> &gt; <strong>ets</strong> &gt; <strong>pages</strong> to open the <strong>Index.ets</strong> file and compile the page.</p><p>In this document, texts and buttons are used to implement page redirection and return. You can use the <a href="https://developer.huawei.com/consumer/en/doc/harmonyos-references-V13/ts-container-row-V13">Row</a> and <a href="https://developer.huawei.com/consumer/en/doc/harmonyos-references-V13/ts-container-column-V13">Column</a> components to set up the page layout. In scenarios where more complex elements should be aligned, you can use the <a href="https://developer.huawei.com/consumer/en/doc/harmonyos-references-V13/ts-container-relativecontainer-V13">RelativeContainer</a> component to set up the layout.</p><p>The sample code in the <strong>Index.ets</strong> file is shown below:</p><p></p><h6><code>// Index.ets</code></h6><h6><code>@Entry</code></h6><h6><code>@Component</code></h6><h6><code>struct Index {</code></h6><h6><code>  @State message: string = 'Hello World'</code></h6><h6><code>  build() {</code></h6><h6><code>    Row() {</code></h6><h6><code>      Column() {</code></h6><h6><code>        Text(this.message)</code></h6><h6><code>          .fontSize(50)</code></h6><h6><code>          .fontWeight(FontWeight.Bold)</code></h6><h6><code>      }</code></h6><h6><code>      .width('100%')</code></h6><h6><code>    }</code></h6><h6><code>    .height('100%')</code></h6><h6><code>  }</code></h6><h6><code>}</code></h6></li></ol><p>Add a <strong>Button</strong> component.</p><p>On the default page, add a <strong>Button</strong> component to respond to user clicks and implement redirection to another page. The sample code in the <strong>Index.ets</strong> file is shown below:</p><h6><code>// Index.ets</code></h6><h6><code>@Entry</code></h6><h6><code>@Component</code></h6><h6><code>struct Index {</code></h6><h6><code>  @State message: string = 'Hello World'</code></h6><h6><code>  build() {</code></h6><h6><code>    Row() {</code></h6><h6><code>      Column() {</code></h6><h6><code>        Text(this.message)</code></h6><h6><code>          .fontSize(50)</code></h6><h6><code>          .fontWeight(FontWeight.Bold)</code></h6><h6><code>        // Add a button to respond to user clicks.</code></h6><h6><code>        Button() {</code></h6><h6><code>          Text('Next')</code></h6><h6><code>            .fontSize(30)</code></h6><h6><code>            .fontWeight(FontWeight.Bold)</code></h6><h6><code>        }</code></h6><h6><code>        .type(ButtonType.Capsule)</code></h6><h6><code>        .margin({</code></h6><h6><code>          top: 20</code></h6><h6><code>        })</code></h6><h6><code>        .backgroundColor('#0D9FFB')</code></h6><h6><code>        .width('40%')</code></h6><h6><code>        .height('5%')</code></h6><h6><code>      }</code></h6><h6><code>      .width('100%')</code></h6><h6><code>    }</code></h6><h6><code>    .height('100%')</code></h6><h6><code>  }</code></h6><h6><code>}</code></h6><p>On the toolbar in the upper right corner of the editing window, click <strong>Previewer</strong>. Below is how the first page looks in the Previewer.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!YPRh!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5fb914c0-5c9f-4038-af64-7e015673b654_311x676.bin" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!YPRh!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5fb914c0-5c9f-4038-af64-7e015673b654_311x676.bin 424w, https://substackcdn.com/image/fetch/$s_!YPRh!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5fb914c0-5c9f-4038-af64-7e015673b654_311x676.bin 848w, https://substackcdn.com/image/fetch/$s_!YPRh!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5fb914c0-5c9f-4038-af64-7e015673b654_311x676.bin 1272w, https://substackcdn.com/image/fetch/$s_!YPRh!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5fb914c0-5c9f-4038-af64-7e015673b654_311x676.bin 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!YPRh!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5fb914c0-5c9f-4038-af64-7e015673b654_311x676.bin" width="311" height="676" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5fb914c0-5c9f-4038-af64-7e015673b654_311x676.bin&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:676,&quot;width&quot;:311,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!YPRh!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5fb914c0-5c9f-4038-af64-7e015673b654_311x676.bin 424w, https://substackcdn.com/image/fetch/$s_!YPRh!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5fb914c0-5c9f-4038-af64-7e015673b654_311x676.bin 848w, https://substackcdn.com/image/fetch/$s_!YPRh!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5fb914c0-5c9f-4038-af64-7e015673b654_311x676.bin 1272w, https://substackcdn.com/image/fetch/$s_!YPRh!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5fb914c0-5c9f-4038-af64-7e015673b654_311x676.bin 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h2><strong>Building the Second Page</strong></h2><ol><li><p>Create the second page.</p><ul><li><p>Create the second page file: In the <strong>Project</strong> window, choose <strong>entry &gt; src &gt; main &gt; ets</strong>, right-click the <strong>pages</strong> folder, choose <strong>New &gt; ArkTS File</strong> from the shortcut menu, name the page <strong>Second</strong>, and click <strong>Finish</strong>. Below shows the created page in the <strong>pages</strong> folder.</p></li></ul></li></ol><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!ak1T!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F89fe8d80-0339-4148-a904-3ec25c96d5cf_294x239.bin" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ak1T!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F89fe8d80-0339-4148-a904-3ec25c96d5cf_294x239.bin 424w, https://substackcdn.com/image/fetch/$s_!ak1T!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F89fe8d80-0339-4148-a904-3ec25c96d5cf_294x239.bin 848w, https://substackcdn.com/image/fetch/$s_!ak1T!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F89fe8d80-0339-4148-a904-3ec25c96d5cf_294x239.bin 1272w, https://substackcdn.com/image/fetch/$s_!ak1T!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F89fe8d80-0339-4148-a904-3ec25c96d5cf_294x239.bin 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ak1T!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F89fe8d80-0339-4148-a904-3ec25c96d5cf_294x239.bin" width="294" height="239" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/89fe8d80-0339-4148-a904-3ec25c96d5cf_294x239.bin&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:239,&quot;width&quot;:294,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!ak1T!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F89fe8d80-0339-4148-a904-3ec25c96d5cf_294x239.bin 424w, https://substackcdn.com/image/fetch/$s_!ak1T!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F89fe8d80-0339-4148-a904-3ec25c96d5cf_294x239.bin 848w, https://substackcdn.com/image/fetch/$s_!ak1T!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F89fe8d80-0339-4148-a904-3ec25c96d5cf_294x239.bin 1272w, https://substackcdn.com/image/fetch/$s_!ak1T!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F89fe8d80-0339-4148-a904-3ec25c96d5cf_294x239.bin 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><ol><li><ul><li><p><strong>NOTE</strong></p><p>You can also right-click the <strong>pages</strong> folder, choose <strong>New</strong> &gt; <strong>Page</strong> &gt; <strong>Empty Page</strong>, name the page <strong>Second</strong>, and click <strong>Finish</strong>. In this way, there is no need to manually configure the route for the second page.</p></li><li><p>Configure the route for the second page. In the <strong>Project</strong> window, choose <strong>entry</strong> &gt; <strong>src</strong> &gt; <strong>main</strong> &gt; <strong>resources</strong> &gt; <strong>base</strong> &gt; <strong>profile</strong>. In the <strong>main_pages.json</strong> file, set <strong>pages/Second</strong> under <strong>src</strong>. The sample code is as follows:</p></li></ul></li></ol><pre><code>{
  "src": [
    "pages/Index",
    "pages/Second"
  ]
}</code></pre><ol><li><p>Add <strong>Text</strong> and <strong>Button</strong> components.</p><p>Add <strong>Text</strong> and <strong>Button</strong> components and set their styles, as you do for the first page. The sample code in the <strong>Second.ets</strong> file is shown below:</p></li></ol><h6><code>// Second.ets</code></h6><h6><code>@Entry</code></h6><h6><code>@Component</code></h6><h6><code>struct Second {</code></h6><h6><code>  @State message: string = 'Hi there'</code></h6><h6><code>  build() {</code></h6><h6><code>    Row() {</code></h6><h6><code>      Column() {</code></h6><h6><code>        Text(this.message)</code></h6><h6><code>          .fontSize(50)</code></h6><h6><code>          .fontWeight(FontWeight.Bold)</code></h6><h6><code>        Button() {</code></h6><h6><code>          Text('Back')</code></h6><h6><code>            .fontSize(30)</code></h6><h6><code>            .fontWeight(FontWeight.Bold)</code></h6><h6><code>        }</code></h6><h6><code>        .type(ButtonType.Capsule)</code></h6><h6><code>        .margin({</code></h6><h6><code>          top: 20</code></h6><h6><code>        })</code></h6><h6><code>        .backgroundColor('#0D9FFB')</code></h6><h6><code>        .width('40%')</code></h6><h6><code>        .height('5%')</code></h6><h6><code>      }</code></h6><h6><code>      .width('100%')</code></h6><h6><code>    }</code></h6><h6><code>    .height('100%')</code></h6><h6><code>  }</code></h6><h6><code>}</code></h6><p></p><h2><strong>Implementing Page Redirection</strong></h2><p>You can implement page redirection through the <a href="https://developer.huawei.com/consumer/en/doc/harmonyos-guides-V13/arkts-routing-V13">page router</a>, which finds the target page based on the page URL. Import the <strong>router</strong> module and then perform the steps below:</p><p><a href="https://developer.huawei.com/consumer/en/doc/harmonyos-guides-V13/arkts-navigation-navigation-V13">Navigation</a> is recommended if you want to achieve better transition effects.</p><ol><li><p>Implement redirection from the first page to the second page.</p><p>In the <strong>Index.ets</strong> file of the first page, bind the <strong>onClick</strong> event to the <strong>Next</strong> button so that clicking the button redirects the user to the second page. The sample code in the <strong>Index.ets</strong> file is shown below:</p></li></ol><h6><code>// Index.ets</code></h6><h6><code>// Import the router module.</code></h6><h6><code>import { router } from '@kit.ArkUI';</code></h6><h6><code>import { BusinessError } from '@kit.BasicServicesKit';</code></h6><h6><code>@Entry</code></h6><h6><code>@Component</code></h6><h6><code>struct Index {</code></h6><h6><code>  @State message: string = 'Hello World'</code></h6><h6><code>  build() {</code></h6><h6><code>    Row() {</code></h6><h6><code>      Column() {</code></h6><h6><code>        Text(this.message)</code></h6><h6><code>          .fontSize(50)</code></h6><h6><code>          .fontWeight(FontWeight.Bold)</code></h6><h6><code>        // Add a button to respond to user clicks.</code></h6><h6><code>        Button() {</code></h6><h6><code>          Text('Next')</code></h6><h6><code>            .fontSize(30)</code></h6><h6><code>            .fontWeight(FontWeight.Bold)</code></h6><h6><code>        }</code></h6><h6><code>        .type(ButtonType.Capsule)</code></h6><h6><code>        .margin({</code></h6><h6><code>          top: 20</code></h6><h6><code>        })</code></h6><h6><code>        .backgroundColor('#0D9FFB')</code></h6><h6><code>        .width('40%')</code></h6><h6><code>        .height('5%')</code></h6><h6><code>        // Bind the onClick event to the Next button so that clicking the button redirects the user to the second page.</code></h6><h6><code>        .onClick(() =&gt; {</code></h6><h6><code>          console.info(`Succeeded in clicking the 'Next' button.`)</code></h6><h6><code>          // Go to the second page.</code></h6><h6><code>          router.pushUrl({ url: 'pages/Second' }).then(() =&gt; {</code></h6><h6><code>            console.info('Succeeded in jumping to the second page.')</code></h6><h6><code>          }).catch((err: BusinessError) =&gt; {</code></h6><h6><code>            console.error(`Failed to jump to the second page. Code is ${err.code}, message is ${err.message}`)</code></h6><h6><code>          })</code></h6><h6><code>        })</code></h6><h6><code>      }</code></h6><h6><code>      .width('100%')</code></h6><h6><code>    }</code></h6><h6><code>    .height('100%')</code></h6><h6><code>  }</code></h6><h6><code>}</code></h6><p></p><ol start="2"><li><p>Implement redirection from the second page to the first page.</p></li></ol><p>In the <strong>Second.ets</strong> file of the second page, bind the <strong>onClick</strong> event to the <strong>Back</strong> button so that clicking the button redirects the user back to the first page. The sample code in the <strong>Second.ets</strong> file is shown below:</p><h6><code>// Second.ets</code></h6><h6><code>// Import the router module.</code></h6><h6><code>import { router } from '@kit.ArkUI';</code></h6><h6><code>import { BusinessError } from '@kit.BasicServicesKit';</code></h6><h6><code>@Entry</code></h6><h6><code>@Component</code></h6><h6><code>struct Second {</code></h6><h6><code>  @State message: string = 'Hi there'</code></h6><h6><code>  build() {</code></h6><h6><code>    Row() {</code></h6><h6><code>      Column() {</code></h6><h6><code>        Text(this.message)</code></h6><h6><code>          .fontSize(50)</code></h6><h6><code>          .fontWeight(FontWeight.Bold)</code></h6><h6><code>        Button() {</code></h6><h6><code>          Text('Back')</code></h6><h6><code>            .fontSize(30)</code></h6><h6><code>            .fontWeight(FontWeight.Bold)</code></h6><h6><code>        }</code></h6><h6><code>        .type(ButtonType.Capsule)</code></h6><h6><code>        .margin({</code></h6><h6><code>          top: 20</code></h6><h6><code>        })</code></h6><h6><code>        .backgroundColor('#0D9FFB')</code></h6><h6><code>        .width('40%')</code></h6><h6><code>        .height('5%')</code></h6><h6><code>        // Bind the onClick event to the Back button so that clicking the button redirects the user back to the first page.</code></h6><h6><code>        .onClick(() =&gt; {</code></h6><h6><code>          console.info(`Succeeded in clicking the 'Back' button.`)</code></h6><h6><code>          try {</code></h6><h6><code>            // Return to the first page.</code></h6><h6><code>            router.back()</code></h6><h6><code>            console.info('Succeeded in returning to the first page.')</code></h6><h6><code>          } catch (err) {</code></h6><h6><code>            let code = (err as BusinessError).code; </code></h6><h6><code>            let message = (err as BusinessError).message; </code></h6><h6><code>            console.error(`Failed to return to the first page. Code is ${code}, message is ${message}`)</code></h6><h6><code>          }</code></h6><h6><code>        })</code></h6><h6><code>      }</code></h6><h6><code>      .width('100%')</code></h6><h6><code>    }</code></h6><h6><code>    .height('100%')</code></h6><h6><code>  }</code></h6><h6><code>}</code></h6><p></p><p>Open the <strong>Index.ets</strong> file and click </p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!NgI3!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6f21944e-bfa8-42f1-be37-46aa7afbd7a2_23x23.bin" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!NgI3!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6f21944e-bfa8-42f1-be37-46aa7afbd7a2_23x23.bin 424w, https://substackcdn.com/image/fetch/$s_!NgI3!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6f21944e-bfa8-42f1-be37-46aa7afbd7a2_23x23.bin 848w, https://substackcdn.com/image/fetch/$s_!NgI3!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6f21944e-bfa8-42f1-be37-46aa7afbd7a2_23x23.bin 1272w, https://substackcdn.com/image/fetch/$s_!NgI3!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6f21944e-bfa8-42f1-be37-46aa7afbd7a2_23x23.bin 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!NgI3!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6f21944e-bfa8-42f1-be37-46aa7afbd7a2_23x23.bin" width="23" height="23" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/6f21944e-bfa8-42f1-be37-46aa7afbd7a2_23x23.bin&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:23,&quot;width&quot;:23,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!NgI3!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6f21944e-bfa8-42f1-be37-46aa7afbd7a2_23x23.bin 424w, https://substackcdn.com/image/fetch/$s_!NgI3!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6f21944e-bfa8-42f1-be37-46aa7afbd7a2_23x23.bin 848w, https://substackcdn.com/image/fetch/$s_!NgI3!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6f21944e-bfa8-42f1-be37-46aa7afbd7a2_23x23.bin 1272w, https://substackcdn.com/image/fetch/$s_!NgI3!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6f21944e-bfa8-42f1-be37-46aa7afbd7a2_23x23.bin 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p> in the Previewer to refresh the file. The figure below shows the effect.</p><ol><li><p></p></li></ol><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!HpRe!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F162dd2aa-8db2-4c26-b24e-5a705f42d9c8_518x481.bin" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!HpRe!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F162dd2aa-8db2-4c26-b24e-5a705f42d9c8_518x481.bin 424w, https://substackcdn.com/image/fetch/$s_!HpRe!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F162dd2aa-8db2-4c26-b24e-5a705f42d9c8_518x481.bin 848w, https://substackcdn.com/image/fetch/$s_!HpRe!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F162dd2aa-8db2-4c26-b24e-5a705f42d9c8_518x481.bin 1272w, https://substackcdn.com/image/fetch/$s_!HpRe!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F162dd2aa-8db2-4c26-b24e-5a705f42d9c8_518x481.bin 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!HpRe!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F162dd2aa-8db2-4c26-b24e-5a705f42d9c8_518x481.bin" width="518" height="481" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/162dd2aa-8db2-4c26-b24e-5a705f42d9c8_518x481.bin&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:481,&quot;width&quot;:518,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!HpRe!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F162dd2aa-8db2-4c26-b24e-5a705f42d9c8_518x481.bin 424w, https://substackcdn.com/image/fetch/$s_!HpRe!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F162dd2aa-8db2-4c26-b24e-5a705f42d9c8_518x481.bin 848w, https://substackcdn.com/image/fetch/$s_!HpRe!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F162dd2aa-8db2-4c26-b24e-5a705f42d9c8_518x481.bin 1272w, https://substackcdn.com/image/fetch/$s_!HpRe!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F162dd2aa-8db2-4c26-b24e-5a705f42d9c8_518x481.bin 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h2><strong>Running the Application on a Real Device</strong></h2><ol><li><p>Connect a real device running HarmonyOS to your computer. For details, see <a href="https://developer.huawei.com/consumer/en/doc/harmonyos-guides-V13/ide-run-device-V13">Running Your App/Service on a Local Real Device</a>.</p></li><li><p>Choose <strong>File</strong> &gt; <strong>Project Structure</strong> &gt; <strong>Project</strong> &gt; <strong>Signing Configs</strong>, select <strong>Support HarmonyOS</strong> and <strong>Automatically generate signature</strong>, click <strong>Sign In</strong>, and log in with your HUAWEI ID. Wait until the automatic signature is complete, and click <strong>OK</strong>. The figure shown below is displayed.</p></li></ol><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!SUIF!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fda123db4-d165-4481-9bb7-b665e6dc5177_908x638.bin" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!SUIF!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fda123db4-d165-4481-9bb7-b665e6dc5177_908x638.bin 424w, https://substackcdn.com/image/fetch/$s_!SUIF!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fda123db4-d165-4481-9bb7-b665e6dc5177_908x638.bin 848w, https://substackcdn.com/image/fetch/$s_!SUIF!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fda123db4-d165-4481-9bb7-b665e6dc5177_908x638.bin 1272w, https://substackcdn.com/image/fetch/$s_!SUIF!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fda123db4-d165-4481-9bb7-b665e6dc5177_908x638.bin 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!SUIF!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fda123db4-d165-4481-9bb7-b665e6dc5177_908x638.bin" width="908" height="638" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/da123db4-d165-4481-9bb7-b665e6dc5177_908x638.bin&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:638,&quot;width&quot;:908,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:&quot;Click to enlarge&quot;,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="Click to enlarge" srcset="https://substackcdn.com/image/fetch/$s_!SUIF!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fda123db4-d165-4481-9bb7-b665e6dc5177_908x638.bin 424w, https://substackcdn.com/image/fetch/$s_!SUIF!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fda123db4-d165-4481-9bb7-b665e6dc5177_908x638.bin 848w, https://substackcdn.com/image/fetch/$s_!SUIF!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fda123db4-d165-4481-9bb7-b665e6dc5177_908x638.bin 1272w, https://substackcdn.com/image/fetch/$s_!SUIF!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fda123db4-d165-4481-9bb7-b665e6dc5177_908x638.bin 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><ol><li><p>On the toolbar in the upper right corner of the editing window, click</p></li></ol><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!tzCm!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcbdd6952-13ff-430f-a9eb-fdef53088727_22x22.bin" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!tzCm!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcbdd6952-13ff-430f-a9eb-fdef53088727_22x22.bin 424w, https://substackcdn.com/image/fetch/$s_!tzCm!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcbdd6952-13ff-430f-a9eb-fdef53088727_22x22.bin 848w, https://substackcdn.com/image/fetch/$s_!tzCm!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcbdd6952-13ff-430f-a9eb-fdef53088727_22x22.bin 1272w, https://substackcdn.com/image/fetch/$s_!tzCm!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcbdd6952-13ff-430f-a9eb-fdef53088727_22x22.bin 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!tzCm!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcbdd6952-13ff-430f-a9eb-fdef53088727_22x22.bin" width="22" height="22" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/cbdd6952-13ff-430f-a9eb-fdef53088727_22x22.bin&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:22,&quot;width&quot;:22,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!tzCm!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcbdd6952-13ff-430f-a9eb-fdef53088727_22x22.bin 424w, https://substackcdn.com/image/fetch/$s_!tzCm!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcbdd6952-13ff-430f-a9eb-fdef53088727_22x22.bin 848w, https://substackcdn.com/image/fetch/$s_!tzCm!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcbdd6952-13ff-430f-a9eb-fdef53088727_22x22.bin 1272w, https://substackcdn.com/image/fetch/$s_!tzCm!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcbdd6952-13ff-430f-a9eb-fdef53088727_22x22.bin 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><ol><li><p>to run the project. The figure below shows the effect.</p></li></ol><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!AnEv!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F080facb9-9808-4994-b63d-3e2d0a998402_731x678.bin" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!AnEv!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F080facb9-9808-4994-b63d-3e2d0a998402_731x678.bin 424w, https://substackcdn.com/image/fetch/$s_!AnEv!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F080facb9-9808-4994-b63d-3e2d0a998402_731x678.bin 848w, https://substackcdn.com/image/fetch/$s_!AnEv!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F080facb9-9808-4994-b63d-3e2d0a998402_731x678.bin 1272w, https://substackcdn.com/image/fetch/$s_!AnEv!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F080facb9-9808-4994-b63d-3e2d0a998402_731x678.bin 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!AnEv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F080facb9-9808-4994-b63d-3e2d0a998402_731x678.bin" width="731" height="678" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/080facb9-9808-4994-b63d-3e2d0a998402_731x678.bin&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:678,&quot;width&quot;:731,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:&quot;Click to enlarge&quot;,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="Click to enlarge" srcset="https://substackcdn.com/image/fetch/$s_!AnEv!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F080facb9-9808-4994-b63d-3e2d0a998402_731x678.bin 424w, https://substackcdn.com/image/fetch/$s_!AnEv!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F080facb9-9808-4994-b63d-3e2d0a998402_731x678.bin 848w, https://substackcdn.com/image/fetch/$s_!AnEv!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F080facb9-9808-4994-b63d-3e2d0a998402_731x678.bin 1272w, https://substackcdn.com/image/fetch/$s_!AnEv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F080facb9-9808-4994-b63d-3e2d0a998402_731x678.bin 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Congratulations! You have finished developing your first ArkTS application based on the stage model.</p><p></p><p><a href="https://developer.huawei.com/consumer/en/doc/harmonyos-guides-V14/start-with-ets-stage-V14">Original material: Building the First ArkTS Application in Stage Model-Quick Start-Getting Started - HUAWEI Developers</a></p>]]></content:encoded></item><item><title><![CDATA[HarmonyOS NEXT Use Cases (API 12+): Innovative Application Design and Practice]]></title><description><![CDATA[This article helps implement innovative applications on the HarmonyOS NEXT platform to help developers better understand the features and application scenarios of the new version.]]></description><link>https://www.harmony-developers.com/p/harmonyos-next-use-cases-api-12-innovative</link><guid isPermaLink="false">https://www.harmony-developers.com/p/harmonyos-next-use-cases-api-12-innovative</guid><dc:creator><![CDATA[Benjamin Akhigbe]]></dc:creator><pubDate>Sat, 22 Feb 2025 14:07:25 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/bf87fcf3-1cdf-4589-b60c-a174c330dba9_1920x1351.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2>introduction</h2><p>With the release of HarmonyOS NEXT, developers are ushering in a new ecosystem of operating systems. HarmonyOS NEXT not only inherits the distributed capabilities of HarmonyOS, but also comprehensively upgrades its performance, security, and development experience. In particular, the launch of API 12 and above provides developers with more possibilities for innovative applications. In this article, we will take a closer look at how to design and implement innovative applications on the HarmonyOS NEXT platform to help developers better understand the features and application scenarios of the new version.</p><h3>1. Core features of HarmonyOS NEXT</h3><h4>1.1 Enhancement of distributed capabilities</h4><p>HarmonyOS NEXT has significantly improved its distributed capabilities, especially in terms of device collaboration, data sharing, and task flow. API 12 makes it easier for developers to achieve a seamless experience across devices. For example, users can seamlessly switch tasks between devices such as mobile phones, tablets, and smart watches, making data synchronization more efficient.</p><h4>1.2 Performance optimization and resource management</h4><p>HarmonyOS NEXT has done a lot of work on performance optimization, especially in resource management and scheduling. API 12 introduces a more intelligent resource scheduling mechanism, which can dynamically adjust resource allocation according to the status of the device and the needs of users, ensuring the smooth and stable operation of applications.</p><h4>1.3 Security Improvements</h4><p>Security has always been a key area of focus for HarmonyOS. In HarmonyOS NEXT, API 12 introduces stricter security mechanisms, including data encryption, rights management, and privacy protection. Developers can take advantage of these new features to build more secure and reliable applications.</p><h3>2. Innovative application design ideas</h3><h4>2.1 Cross-device collaborative experience</h4><p>On the HarmonyOS NEXT platform, cross-device collaboration is an important innovation direction. With API 12, developers can design apps that seamlessly switch between multiple devices. For example, users can start a task on their phone and continue on their tablet, and all data will be automatically synced. This design not only improves the user experience, but also enhances the stickiness of the app.</p><h4>2.2 Intelligent Scene Perception</h4><p>HarmonyOS NEXT provides powerful scene-aware capabilities, allowing developers to design apps that automatically adjust their functionality to the user's environment using the scene-aware interface in API 12. For example, when a user enters a meeting room, the app can automatically switch to silent mode and provide meeting-related features. This intelligent design can significantly improve the user experience.</p><h4>2.3 Personalized Recommendations</h4><p>Through the data analytics interface in API 12, developers can design applications that can make personalized recommendations based on user behavior and preferences. For example, a news app can recommend relevant articles based on a user's reading habits, and a shopping app can recommend products based on a user's purchase history. This personalized design increases user satisfaction and increases the activity of the app.</p><h3>3. Practical case: smart home control application</h3><h4>3.1 Application Background</h4><p>With the popularity of smart home devices, the demand for smart home control applications is increasing day by day. On the HarmonyOS NEXT platform, developers can leverage the distributed capabilities and scenario-aware APIs in API 12 to design smarter home control applications.</p><h4>3.2 Functional Design</h4><p>The app's key features include device control, scene mode, and personalized recommendations. With API 12, apps can collaborate across devices, allowing users to control smart devices in their homes from their phones, tablets, or smartwatches. In addition, the app can automatically adjust device settings based on the user's environment, such as automatically dimming the lights and playing soothing music when the user enters the bedroom.</p><h4>3.3 Implementation Details</h4><p>During implementation, developers can take advantage of the distributed data management interface in API 12 to ensure real-time synchronization of device status and user settings. At the same time, through the scene-aware interface, the application can automatically identify the user's environment and trigger the corresponding device control logic. In addition, developers can also use the data analysis interface to make personalized recommendations based on users' usage habits, such as recommending commonly used device settings or scene modes.</p><h3>Fourth, summary and outlook</h3><p>HarmonyOS NEXT provides a powerful platform for developers, especially in API 12 and above, with new features and interfaces that open up more possibilities for the design and implementation of innovative applications. Through design ideas such as cross-device collaboration, intelligent scene awareness, and personalized recommendations, developers can build more intelligent, convenient, and personalized applications, bringing new experiences to users.</p><p>In the future, as the HarmonyOS ecosystem continues to grow, we look forward to seeing more innovative applications emerge to promote the deep integration of smart devices and users' lives. Developers should continue to pay attention to the latest developments of HarmonyOS, make full use of the features and interfaces of the new version, and continue to explore and innovate to create more value for users.</p><h3>References</h3><ol><li><p>HarmonyOS Developer Documentation, API 12+.</p></li><li><p>HarmonyOS NEXT Release Notes.</p></li><li><p>Distributed Capabilities in HarmonyOS NEXT.</p></li><li><p>Security Enhancements in HarmonyOS NEXT.</p></li></ol><div><hr></div><p>The above content is an analysis of HarmonyOS NEXT use cases, which aims to help developers better understand the features and application scenarios of the new version and design innovative applications. Hopefully, this article will provide you with a valuable reference for your development efforts.</p><p><a href="https://juejin.cn/post/7473660325029625919">Original source&#65306;https://juejin.cn/post/7473660325029625919</a><br></p>]]></content:encoded></item><item><title><![CDATA[UIAbility Page Redirection - Huawei Developer HarmonyOS NEXT Codelabs]]></title><description><![CDATA[How to implement UIAbility Page Redirection]]></description><link>https://www.harmony-developers.com/p/uiability-page-redirection-huawei</link><guid isPermaLink="false">https://www.harmony-developers.com/p/uiability-page-redirection-huawei</guid><dc:creator><![CDATA[Benjamin Akhigbe]]></dc:creator><pubDate>Wed, 19 Feb 2025 20:55:08 GMT</pubDate><enclosure url="https://substackcdn.com/image/youtube/w_728,c_limit/rSRYKLkqPL0" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><strong>1 Introduction</strong></p><p>This codelab introduces how to develop a UIAbility in the stage model, implementing page redirection and data transfer within the UIAbility.</p><p>Example:</p><div id="youtube2-rSRYKLkqPL0" class="youtube-wrap" data-attrs="{&quot;videoId&quot;:&quot;rSRYKLkqPL0&quot;,&quot;startTime&quot;:null,&quot;endTime&quot;:null}" data-component-name="Youtube2ToDOM"><div class="youtube-inner"><iframe src="https://www.youtube-nocookie.com/embed/rSRYKLkqPL0?rel=0&amp;autoplay=0&amp;showinfo=0&amp;enablejsapi=0" frameborder="0" loading="lazy" gesture="media" allow="autoplay; fullscreen" allowautoplay="true" allowfullscreen="true" width="728" height="409"></iframe></div></div><h2><strong>Concepts</strong></h2><ul><li><p><a href="https://developer.huawei.com/consumer/en/doc/harmonyos-guides-V5/arkts-routing-0000001885919501-V5">Page router</a>: allows an application to access pages through URLs, especially like navigating to a specified page in an application, replacing the current page with another one in an application, and returning to the previous page or a specified page.</p></li></ul><p></p><p><strong>2 Environment Setup</strong></p><p>You need to set up the HarmonyOS development environment.</p><h2><strong>Software Requirements</strong></h2><ul><li><p>DevEco Studio version: DevEco Studio NEXT Beta1 or later</p></li><li><p>HarmonyOS SDK version: HarmonyOS NEXT Beta1 or later</p></li></ul><h2><strong>Hardware Requirements</strong></h2><ul><li><p>Device type: Huawei phone</p></li><li><p>HarmonyOS: HarmonyOS NEXT Developer Beta1 or later</p></li></ul><h2><strong>Environment Setup</strong></h2><ol><li><p>Install DevEco Studio. For details, see <a href="https://developer.huawei.com/consumer/en/doc/harmonyos-guides-V5/ide-software-download-V5">Downloading Software</a> and <a href="https://developer.huawei.com/consumer/en/doc/harmonyos-guides-V5/ide-software-install-V5">Installing Software</a>.</p></li><li><p>Configure the DevEco Studio development environment, which requires access to the Internet for proper functioning. For details, please refer to <a href="https://developer.huawei.com/consumer/en/doc/harmonyos-guides-V5/ide-environment-config-V5">Configuring the Development Environment</a>.</p></li><li><p>Complete app debugging by referring to the following:</p><ul><li><p><a href="https://developer.huawei.com/consumer/en/doc/harmonyos-guides-V5/ide-debug-device-V5">Debugging Your App on a Real Device</a></p></li></ul><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!LEG1!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5fbfbfe5-44df-44bb-9c9a-74b425bdfc25_980x655.bin" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!LEG1!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5fbfbfe5-44df-44bb-9c9a-74b425bdfc25_980x655.bin 424w, https://substackcdn.com/image/fetch/$s_!LEG1!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5fbfbfe5-44df-44bb-9c9a-74b425bdfc25_980x655.bin 848w, https://substackcdn.com/image/fetch/$s_!LEG1!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5fbfbfe5-44df-44bb-9c9a-74b425bdfc25_980x655.bin 1272w, https://substackcdn.com/image/fetch/$s_!LEG1!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5fbfbfe5-44df-44bb-9c9a-74b425bdfc25_980x655.bin 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!LEG1!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5fbfbfe5-44df-44bb-9c9a-74b425bdfc25_980x655.bin" width="980" height="655" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5fbfbfe5-44df-44bb-9c9a-74b425bdfc25_980x655.bin&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:655,&quot;width&quot;:980,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!LEG1!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5fbfbfe5-44df-44bb-9c9a-74b425bdfc25_980x655.bin 424w, https://substackcdn.com/image/fetch/$s_!LEG1!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5fbfbfe5-44df-44bb-9c9a-74b425bdfc25_980x655.bin 848w, https://substackcdn.com/image/fetch/$s_!LEG1!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5fbfbfe5-44df-44bb-9c9a-74b425bdfc25_980x655.bin 1272w, https://substackcdn.com/image/fetch/$s_!LEG1!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5fbfbfe5-44df-44bb-9c9a-74b425bdfc25_980x655.bin 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div></li></ol><p><strong>3 Code Structure</strong></p><p>This codelab introduces only the core code. For the complete code, download it from the attachment or Gitee source code.</p><p><strong>No Preview</strong></p><div><hr></div><p></p><h6>&#9500;&#9472;&#9472;entry/src/main/ets                // ArkTS code area</h6><h6>&#9474;  &#9500;&#9472;&#9472;common</h6><h6>&#9474;  &#9474;  &#9500;&#9472;&#9472;constants</h6><h6>&#9474;  &#9474;  &#9474;  &#9492;&#9472;&#9472;CommonConstants.ets      // Common constants</h6><h6>&#9474;  &#9474;  &#9492;&#9472;&#9472;utils</h6><h6>&#9474;  &#9474;     &#9492;&#9472;&#9472;Logger.ets               // Logger</h6><h6>&#9474;  &#9500;&#9472;&#9472;entryability</h6><h6>&#9474;  &#9474;  &#9492;&#9472;&#9472;EntryAbility.ets            // Application entry</h6><h6>&#9474;  &#9492;&#9472;&#9472;pages</h6><h6>&#9474;     &#9500;&#9472;&#9472;IndexPage.ets               // Entry page</h6><h6>&#9474;     &#9492;&#9472;&#9472;SecondPage.ets              // Page to be redirected to</h6><h6>&#9492;&#9472;&#9472;entry/src/main/resources&#9;     // Directory of resource files</h6><div><hr></div><p></p><p><strong>4 Page Creation</strong></p><p>Start DevEco Studio and <a href="https://developer.huawei.com/consumer/en/doc/harmonyos-guides/ide-create-new-project-0000001053342414">create a project</a>. In the <strong>pages</strong> directory of the project, right-click <strong>Index.ets</strong> and choose <strong>Refactor</strong> &gt; <strong>Rename</strong> from the shortcut menu to rename the file <strong>IndexPage.ets</strong>. Change the first parameter of the <strong>windowStage.loadContent</strong> method in the <strong>EntryAbility.ets</strong> file in the <strong>entryability</strong> directory of the project to <strong>pages/IndexPage</strong>. Then, the <strong>IndexPage</strong> is automatically loaded when the app is started.</p><p>Go to the <strong>entry &gt; src &gt; main &gt; ets &gt; pages</strong> directory of the project, right-click and choose <strong>New</strong> &gt; <strong>Page</strong>, and create a page named <strong>SecondPage</strong>. DevEco Studio automatically adds <strong>pages/SecondPage</strong> to the <strong>entry &gt; src &gt; main &gt; resources &gt; base &gt; profile &gt; main_pages.json</strong> file in the project directory.</p><p>Note: All created pages must be configured in the <strong>main_pages.json</strong> file. Pages created in DevEco Studio are automatically configured. If you manually copy the <strong>page</strong> file to the <strong>entry &gt; src &gt; main &gt; ets &gt; pages</strong> directory, you need to manually configure the corresponding page in the <strong>main_pages.json</strong> file.</p><div><hr></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!AgyE!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd1dd1f6b-a309-46a7-8ff2-1b77a52a849d_669x663.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!AgyE!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd1dd1f6b-a309-46a7-8ff2-1b77a52a849d_669x663.png 424w, https://substackcdn.com/image/fetch/$s_!AgyE!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd1dd1f6b-a309-46a7-8ff2-1b77a52a849d_669x663.png 848w, https://substackcdn.com/image/fetch/$s_!AgyE!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd1dd1f6b-a309-46a7-8ff2-1b77a52a849d_669x663.png 1272w, https://substackcdn.com/image/fetch/$s_!AgyE!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd1dd1f6b-a309-46a7-8ff2-1b77a52a849d_669x663.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!AgyE!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd1dd1f6b-a309-46a7-8ff2-1b77a52a849d_669x663.png" width="669" height="663" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d1dd1f6b-a309-46a7-8ff2-1b77a52a849d_669x663.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:663,&quot;width&quot;:669,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:81776,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.harmony-developers.com/i/157489347?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd1dd1f6b-a309-46a7-8ff2-1b77a52a849d_669x663.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!AgyE!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd1dd1f6b-a309-46a7-8ff2-1b77a52a849d_669x663.png 424w, https://substackcdn.com/image/fetch/$s_!AgyE!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd1dd1f6b-a309-46a7-8ff2-1b77a52a849d_669x663.png 848w, https://substackcdn.com/image/fetch/$s_!AgyE!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd1dd1f6b-a309-46a7-8ff2-1b77a52a849d_669x663.png 1272w, https://substackcdn.com/image/fetch/$s_!AgyE!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd1dd1f6b-a309-46a7-8ff2-1b77a52a849d_669x663.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div><hr></div><p><strong>5 Page Redirection</strong></p><p>To implement redirection from <strong>IndexPage</strong> to <strong>SecondPage</strong> and transfer data, do the following:</p><ul><li><p>Import the <strong>router</strong> module to the two pages.</p></li><li><p>On <strong>IndexPage</strong>, add a click event to the <strong>Button</strong> component. Use the <strong>router.pushUrl()</strong> method to add the <strong>SecondPage</strong> path to the URL. <strong>params</strong> is a custom parameter.</p></li><li><p><strong>SecondPage</strong> uses the <strong>router.getParams()</strong> method to obtain the custom parameter passed from <strong>IndexPage</strong>.</p></li></ul><p><strong>IndexPage</strong> has a piece of text and a button. Tap the button to go to the next page and transfer data. The <strong>IndexPage.ets</strong> code is as follows:</p><p>The <strong>SecondPage</strong> has two pieces of text, one of which displays the data transferred from <strong>IndexPage</strong>. The code of <strong>SecondPage.ets</strong> is as follows:</p><div><hr></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!6zHc!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F498d057e-7466-4890-9cf2-f5268e70ce82_667x1059.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!6zHc!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F498d057e-7466-4890-9cf2-f5268e70ce82_667x1059.png 424w, https://substackcdn.com/image/fetch/$s_!6zHc!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F498d057e-7466-4890-9cf2-f5268e70ce82_667x1059.png 848w, https://substackcdn.com/image/fetch/$s_!6zHc!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F498d057e-7466-4890-9cf2-f5268e70ce82_667x1059.png 1272w, https://substackcdn.com/image/fetch/$s_!6zHc!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F498d057e-7466-4890-9cf2-f5268e70ce82_667x1059.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!6zHc!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F498d057e-7466-4890-9cf2-f5268e70ce82_667x1059.png" width="667" height="1059" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/498d057e-7466-4890-9cf2-f5268e70ce82_667x1059.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1059,&quot;width&quot;:667,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:120617,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.harmony-developers.com/i/157489347?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F498d057e-7466-4890-9cf2-f5268e70ce82_667x1059.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!6zHc!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F498d057e-7466-4890-9cf2-f5268e70ce82_667x1059.png 424w, https://substackcdn.com/image/fetch/$s_!6zHc!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F498d057e-7466-4890-9cf2-f5268e70ce82_667x1059.png 848w, https://substackcdn.com/image/fetch/$s_!6zHc!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F498d057e-7466-4890-9cf2-f5268e70ce82_667x1059.png 1272w, https://substackcdn.com/image/fetch/$s_!6zHc!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F498d057e-7466-4890-9cf2-f5268e70ce82_667x1059.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div><hr></div><p>On <strong>SecondPage</strong>, add the <strong>onClick()</strong> event for <strong>Button</strong> and call the <strong>router.back()</strong> method to return to the previous page.</p><p></p><p><strong>7 Congratulations</strong></p><p>Well done. You have successfully completed this codelab and learned how to:</p><ol><li><p>Use the page router to implement page redirection.</p></li></ol><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!tquF!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9a123328-7d22-4a3d-945f-c2f4406c90c9_960x560.bin" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!tquF!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9a123328-7d22-4a3d-945f-c2f4406c90c9_960x560.bin 424w, https://substackcdn.com/image/fetch/$s_!tquF!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9a123328-7d22-4a3d-945f-c2f4406c90c9_960x560.bin 848w, https://substackcdn.com/image/fetch/$s_!tquF!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9a123328-7d22-4a3d-945f-c2f4406c90c9_960x560.bin 1272w, https://substackcdn.com/image/fetch/$s_!tquF!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9a123328-7d22-4a3d-945f-c2f4406c90c9_960x560.bin 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!tquF!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9a123328-7d22-4a3d-945f-c2f4406c90c9_960x560.bin" width="960" height="560" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9a123328-7d22-4a3d-945f-c2f4406c90c9_960x560.bin&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:560,&quot;width&quot;:960,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!tquF!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9a123328-7d22-4a3d-945f-c2f4406c90c9_960x560.bin 424w, https://substackcdn.com/image/fetch/$s_!tquF!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9a123328-7d22-4a3d-945f-c2f4406c90c9_960x560.bin 848w, https://substackcdn.com/image/fetch/$s_!tquF!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9a123328-7d22-4a3d-945f-c2f4406c90c9_960x560.bin 1272w, https://substackcdn.com/image/fetch/$s_!tquF!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9a123328-7d22-4a3d-945f-c2f4406c90c9_960x560.bin 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><a href="https://developer.huawei.com/consumer/en/codelabsPortal/carddetails/tutorials_NEXT-PagesRouter">Original source: Huawei Developers - UIAbility Page Redirection</a></p><p><a href="https://github.com/BA489/UIAbility_Codelabs">Source code: BA489/UIAbility_Codelabs: Full code of UIAbility Page Redirection - Huawei Developer HarmonyOS NEXT Codelabs</a></p>]]></content:encoded></item></channel></rss>