<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: shaohushuo</title>
    <description>The latest articles on DEV Community by shaohushuo (@shaohushuo).</description>
    <link>https://dev.to/shaohushuo</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1890211%2F9be19636-9cb1-4a26-8e7c-62616441ab22.jpg</url>
      <title>DEV Community: shaohushuo</title>
      <link>https://dev.to/shaohushuo</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/shaohushuo"/>
    <language>en</language>
    <item>
      <title>HarmonyOS Native Development Notes: 05-Things Beyond Development</title>
      <dc:creator>shaohushuo</dc:creator>
      <pubDate>Wed, 25 Jun 2025 03:05:44 +0000</pubDate>
      <link>https://dev.to/shaohushuo/harmonyos-native-development-notes-05-things-beyond-development-1kbf</link>
      <guid>https://dev.to/shaohushuo/harmonyos-native-development-notes-05-things-beyond-development-1kbf</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;The entire application from development to listing requires a series of work, including domain name registration, ICP filing, opening a developer account, App filing, development, testing, listing, review and promotion, etc.&lt;/p&gt;

&lt;h2&gt;
  
  
  Domain Name
&lt;/h2&gt;

&lt;p&gt;Registering and purchasing domain names from domain name service providers, individuals or companies should give priority to .com domain names, and be cautious when purchasing specific domain names such as .org. Filings must have corresponding qualifications or approval conditions, and some suffix domain names may not be able to be filed. For special domain names, it is recommended to check the website of the Ministry of Industry and Information Technology to verify whether filing is supported.&lt;/p&gt;

&lt;h2&gt;
  
  
  Filing
&lt;/h2&gt;

&lt;p&gt;First, choose personal filing or corporate filing. Real-name authentication is required after the domain name is purchased, and the authentication information must be consistent with the filing. If the two are different, the domain name real-name information needs to be changed first.&lt;/p&gt;

&lt;p&gt;There are many types of filing, including domain name filing, App filing, mini-program filing, etc. HarmonyOS Yuan Service filing is currently processed according to App filing, and the two processes are consistent.&lt;br&gt;
Here is how to file a company record. Log in to the operator's record system, such as Alibaba Cloud, enter the record, fill in the company information, corporate legal person ID information and ID photo, website/App person in charge ID information and ID photo, and verify two mobile phone numbers at the same time.&lt;br&gt;
If it is an App record, you need to fill in the application information, application name, package name, icon, fingerprint and signature information, etc. It should be noted that the name and package name should be consistent with the listed one, otherwise the review will be rejected.&lt;br&gt;
After submitting the information, the record service provider will call to verify the information, and Alibaba Cloud will ask for the last six digits of your ID number.&lt;/p&gt;

&lt;p&gt;After the service provider passes the review, it will submit the record information to the Ministry of Industry and Information Technology. At that time, you will receive a text message. At this time, log in to the Ministry of Industry and Information Technology's website, fill in the last 6 digits of the corporate legal person ID number and the last 6 digits of the person in charge, as well as this verification code, and it will be verified.&lt;/p&gt;

&lt;p&gt;The requirements of the management bureaus in different regions are different. Some regions require that the person in charge of the website/App must be himself, while others do not make requirements. You can ask the record service provider.&lt;/p&gt;

&lt;h2&gt;
  
  
  Equipment
&lt;/h2&gt;

&lt;p&gt;Huawei phones are expensive. For some developers, if the main phone is not Huawei, it may be a considerable expense. Here you need to make a decision based on your own situation.&lt;/p&gt;

&lt;p&gt;If you only use ArkTs to develop native HarmonyOS applications, you can consider using an emulator. Most common ones can meet the requirements and the emulator has high availability.&lt;/p&gt;

&lt;p&gt;If you are used to cross-end development frameworks, such as Flutter, or if you are designed to interact with the underlying system API or operate hardware, you need to consider equipping a real machine.&lt;/p&gt;

&lt;p&gt;For devices, the mate60 series is preferred, including mate60, mate60pro, etc. If you are not price sensitive, consider mate70 and new models. Secondly, consider the nova series and then consider MatePad, etc. If you think the new phone is expensive, you can consider Xianyu second-hand. Before purchasing the phone, confirm that it can be upgraded to NEXT normally. Check the upgrade plan on the developer's official website to ensure that the model supports Next, and ask the seller if the system is unlocked and can be upgraded normally.&lt;/p&gt;

&lt;p&gt;At present, most applications are adapted to mobile phones first, and there are fewer applications on matepad. Even if they are used for development, there are certain differences in perception between the two. It is especially important to pay attention to screen size adaptation, which will inevitably be rejected during the review process.&lt;/p&gt;

&lt;h2&gt;
  
  
  Development and testing
&lt;/h2&gt;

&lt;p&gt;To improve development efficiency, you can use the preview function to preview the currently developed page or component in real time. After the module development is completed, debug it with an emulator or real device.&lt;/p&gt;

&lt;p&gt;Enable hot reload. The default IDE is not enabled. If you need to use it, first modify the operation configuration, and then manually click the H hot reload icon. If you want to refresh automatically when saving, find Auto Save in the settings and enable it.&lt;/p&gt;

&lt;p&gt;If the application needs to access the network, configure network access rights in the module.json5 file. For meta-services, you also need to enable "Exemption from control for meta-services in development" in the developer options of the device. When listing, configure the request domain name in the project configuration of AGC.&lt;/p&gt;

&lt;h2&gt;
  
  
  Listing review
&lt;/h2&gt;

&lt;p&gt;When listing, if you check the tablet adaptation, make sure you have tested it on the tablet, or you have enough confidence that there is no adaptation problem. The reviewer will use a tablet to carefully check your app. If any problem is found, the app will not be put on the shelf.&lt;/p&gt;

&lt;p&gt;You can provide a self-test screen recording to improve the review pass rate. If the app has special features in design or use, it is best to explain the reason in detail in the remarks so that the reviewer can fully understand.&lt;/p&gt;

&lt;p&gt;Fill in all information truthfully when putting it on the shelf, and the application classification and labeling should be appropriate. Use the production certificate for packaging, and do not make mistakes when uploading packages and checking them. Even if the software packages not used on AGC are deleted, avoid confusion. When filling in the information, click Save to avoid information loss due to web page jumps during boot.&lt;/p&gt;

&lt;p&gt;After successful submission, the system will first conduct a pre-review, which is a machine review. It takes about one or two hours to wait. You will receive a notification email whether the review is passed or not. Then it will enter a relatively long review waiting period. The review time is generally on weekdays, including Saturdays and Sundays. Based on this, you can reasonably arrange the review time and submit it for review in advance.&lt;/p&gt;

&lt;p&gt;The public beta version and the official version have the same review process and are independent of each other.&lt;/p&gt;

&lt;p&gt;Each time an application is submitted, the reviewer may be different, and the problems found may be different, which varies from person to person and from time to time.&lt;/p&gt;

&lt;p&gt;The review is relatively loose when the application is first launched, and it may be more stringent when it is upgraded and reviewed again.&lt;/p&gt;

&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://domain.miit.gov.cn/" rel="noopener noreferrer"&gt;https://domain.miit.gov.cn/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>harmonyos</category>
      <category>harmony</category>
    </item>
    <item>
      <title>HarmonyOS Native Development Notes: 04-A Complete Meta-Service Case</title>
      <dc:creator>shaohushuo</dc:creator>
      <pubDate>Wed, 25 Jun 2025 03:04:04 +0000</pubDate>
      <link>https://dev.to/shaohushuo/harmonyos-native-development-notes-04-a-complete-meta-service-case-1490</link>
      <guid>https://dev.to/shaohushuo/harmonyos-native-development-notes-04-a-complete-meta-service-case-1490</guid>
      <description>&lt;h1&gt;
  
  
  Cinema Hot Screening
&lt;/h1&gt;

&lt;blockquote&gt;
&lt;p&gt;Share a complete meta-service case, which is a high imitation of Douban's mini program.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;The entire meta-service is divided into 4-5 pages. The homepage is a list page, which shows the popular movies in the current theater. Clicking it is a detailed introduction page, which contains movie details, cast list, related movie recommendations, and popular posters. Opening the poster is a complete poster display page, and you can click it to see a large picture.&lt;br&gt;
In addition, there is an introduction page about us.&lt;/p&gt;
&lt;h2&gt;
  
  
  Design
&lt;/h2&gt;

&lt;p&gt;The meta-service does not use the bottom tab, but places the about us at the bottom of the page, showing it in a more euphemistic way.&lt;/p&gt;
&lt;h2&gt;
  
  
  Code
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Check the &lt;code&gt;entry/src/main/etc/pages/&lt;/code&gt; directory, and the entire application is divided into four pages.
Its routes are configured in &lt;code&gt;entry/src/main/resources/base/profile/main_pages.json&lt;/code&gt;, and the route name corresponds to the file name one by one.
In the directory where &lt;code&gt;main_pages.json&lt;/code&gt; is located, you can see a &lt;code&gt;form_config.json&lt;/code&gt; file, which is used to configure the service card. I will not discuss it here.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The page mostly uses row and column layout, and various spacings are specified by using &lt;code&gt;Blank()&lt;/code&gt; first.&lt;/p&gt;

&lt;p&gt;In the Album page, a grid layout is used. When you click on one of the images, a slideshow will be played. The &lt;code&gt;@lyb/media-preview&lt;/code&gt; third-party library is used here. The following is the core code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="nc"&gt;Grid&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="nc"&gt;ForEach&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;items&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;item&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Photo&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;index&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;number&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="nc"&gt;GridItem&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="nc"&gt;Image&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;item&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;image&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;normal&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;url&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;width&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;100%&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;height&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;140&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;objectFit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;ImageFit&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Cover&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;clickEffect&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;level&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;ClickEffectLevel&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;MIDDLE&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;scale&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;1.1&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt;
&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;visibility&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;index&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;index&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="nx"&gt;Visibility&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Hidden&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Visibility&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Visible&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;onClick&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;options&lt;/span&gt;
&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setInitIndex&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;index&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setMedias&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getPreviewResources&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setIndicator&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nx"&gt;MediaPreview&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;open&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getUIContext&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;options&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;})&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;})&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;columnsTemplate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;1fr 1fr 1fr&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;columnsGap&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;rowsGap&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;scrollBar&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;BarState&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Off&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;The &lt;code&gt;common&lt;/code&gt; directory stores some global variables, such as the &lt;code&gt;Constants.ets&lt;/code&gt; file, where static variables are used. There is also a simple encapsulation of the request class, which also uses a static class as a singleton.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;In order to make the import code more concise and "high cohesion and low coupling", an index file is used to export the classes and methods in this directory.&lt;/p&gt;

&lt;p&gt;The methods in &lt;code&gt;Request&lt;/code&gt; use generics, so that they can be automatically deserialized according to the passed type, reducing the amount of boilerplate code.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;code&gt;components&lt;/code&gt; component directory. This is where the encapsulated widgets are stored. This case contains 4 widgets: cast list, copyright statement, poster list, and related recommendations.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;code&gt;Copyright&lt;/code&gt; is a simple widget that is displayed in the footer.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="p"&gt;@&lt;/span&gt;&lt;span class="nd"&gt;Component&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="nx"&gt;struct&lt;/span&gt; &lt;span class="nx"&gt;Copyright&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="nf"&gt;build&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="nc"&gt;Row&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="nc"&gt;Image&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;$r&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;app.media.nutpi&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)).&lt;/span&gt;&lt;span class="nf"&gt;width&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;32&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nc"&gt;Blank&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;width&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nc"&gt;Text&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Nutpi&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;fontWeight&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;FontWeight&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Bold&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;fontColor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;Color&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Gray&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}.&lt;/span&gt;&lt;span class="nf"&gt;justifyContent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;FlexAlign&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Center&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;width&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;100%&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;onClick&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="nx"&gt;router&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;pushUrl&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;url&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;pages/About&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt;
&lt;span class="p"&gt;})&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;```





&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;code&gt;quickactions/pages/QuickActionCard.ets&lt;/code&gt; is the page for serving cards. Here, the UI of the card is described. Click events are monitored and triggered through Formlink&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
typescript
FormLink({
action: this.ACTION_TYPE,
abilityName: this.ABILITY_NAME,
params: {
action: this.MESSAGE
}
}) {
Row() {
Text('Hot Movies in Theaters').fontSize(14)
.fontColor($r('app.color.card_label'))
Image($r('app.media.icon'))
.width(32)
}
.justifyContent(FlexAlign.SpaceBetween)
.height(this.FULL_HEIGHT_PERCENT)
.width('100%')
.padding({
top: 10,
left: 12,
right: 12,
bottom: 10
})
.backgroundColor($r('app.color.background_color'))
}


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;In the above code, a row layout is described, with an icon on the left and the application name on the right.&lt;/p&gt;

&lt;p&gt;5.&lt;code&gt;viewmodels&lt;/code&gt; is the view data model. This case has 5 models, namely &lt;code&gt;AppInfo&lt;/code&gt;, &lt;code&gt;Celebrities&lt;/code&gt;, &lt;code&gt;Movie&lt;/code&gt;, &lt;code&gt;Photos&lt;/code&gt;, &lt;code&gt;Relative&lt;/code&gt;.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
typescript
export class AppInfo {
logo: string = '';
appName: string = '';
appLinking: string = '';
appId: string = '';
desc: string = '';
type: string = '';
}


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;AppInfo&lt;/code&gt; is a simple application information class, including logo, application name, applink, description and application type.&lt;/p&gt;

&lt;h2&gt;
  
  
  Application screenshots
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Home&lt;/th&gt;
&lt;th&gt;My&lt;/th&gt;
&lt;th&gt;Help&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/.%2F.screenshot%2Fimg-1.jpg" width="800" height="400"&gt;&lt;/td&gt;
&lt;td&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/.%2F.screenshot%2Fimg-2.jpg" width="800" height="400"&gt;&lt;/td&gt;
&lt;td&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/.%2F.screenshot%2Fimg-3.jpg" width="800" height="400"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/.%2F.screenshot%2Fimg-4.jpg" width="800" height="400"&gt;&lt;/td&gt;
&lt;td&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/.%2F.screenshot%2Fimg-5.jpg" width="800" height="400"&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Notes
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Enable Meta Service Exemption Control: System-Developer Options-Developing Meta Service Exemption Control&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Others
&lt;/h2&gt;

&lt;p&gt;For application creation, service cards, package signatures, listing review, etc., you can view previous articles or the reference materials below.&lt;/p&gt;

&lt;h2&gt;
  
  
  Complete code
&lt;/h2&gt;

&lt;p&gt;For the complete code, see the code repository&lt;br&gt;
&lt;a href="https://gitee.com/zacks/arkts-ohos-demo" rel="noopener noreferrer"&gt;https://gitee.com/zacks/arkts-ohos-demo&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://gitee.com/zacks/awesome-harmonyos-flutter/blob/master/%E9%B8%BF%E8%92%99%E5%8E%9F%E7%94%9F%E5%BC%80%E5%8F%91/%E9%B8%BF%E8%92%99%E5%8E%9F%E7%94%9F%E5%BC%80%E5%8F%91%E6%89%8B%E8%AE%B0%EF%BC%9A01-%E5%85%83%E6%9C%8D%E5%8A%A1%E5%BC%80%E5%8F%91.md" rel="noopener noreferrer"&gt;HarmonyOS Native Development Notes: 01-Meta Service Development&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://gitee.com/zacks/awesome-harmonyos-flutter/blob/master/%E9%B8%BF%E8%92%99%E5%8E%9F%E7%94%9F%E5%BC%80%E5%8F%91/%E9%B8%BF%E8%92%99%E5%8E%9F%E7%94%9F%E5%BC%80%E5%8F%91%E6%89%8B%E8%AE%B0%EF%BC%9A02-%E6%9C%8D%E5%8A%A1%E5%8D%A1%E7%89%87%E5%BC%80%E5%8F%91.md" rel="noopener noreferrer"&gt;HarmonyOS Native Development Notes: 02-Service Card Development&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://gitee.com/zacks/awesome-harmonyos-flutter/blob/master/%E9%B8%BF%E8%92%99%E5%8E%9F%E7%94%9F%E5%BC%80%E5%8F%91/%E9%B8%BF%E%208%92%99%E5%8E%9F%E7%94%9F%E5%BC%80%E5%8F%91%E6%89%8B%E8%AE%B0%EF%BC%9A03-%%20E5%85%83%E6%9C%8D%E5%8A%A1%E5%BC%80%E5%8F%91%E5%85%A8%E6%B5%81%E7%A8%8B.md" rel="noopener noreferrer"&gt;HarmonyOS native development notes: 03-Full process of meta-service development&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://gitee.com/zacks/awesome-harmonyos-flutter/blob/master/%E9%B8%BF%E8%92%99%20Flutter%20%E5%AE%9E%E6%88%98/%E9%B8%BF%E8%92%99Flutter%E5%AE%9E%E6%88%98%EF%BC%9A13-%E9%B8%BF%E8%92%99%E5%BA%94%E7%94%A8%E6%89%93%E5%8C%85%E4%B8%8A%E6%9E%B6%E6%B5%81%E7%A8%8B.md" rel="noopener noreferrer"&gt;HarmonyOS application packaging and listing process&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>harmonyos</category>
      <category>harmony</category>
    </item>
    <item>
      <title>HarmonyOS Native Development Notes: 03-The Whole Process of Meta Service Development</title>
      <dc:creator>shaohushuo</dc:creator>
      <pubDate>Wed, 25 Jun 2025 02:59:21 +0000</pubDate>
      <link>https://dev.to/shaohushuo/harmonyos-native-development-notes-03-the-whole-process-of-meta-service-development-3nee</link>
      <guid>https://dev.to/shaohushuo/harmonyos-native-development-notes-03-the-whole-process-of-meta-service-development-3nee</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;This article provides a very detailed introduction to the full process of meta-service development and listing, including meta-service introduction, creation, service cards, signatures, development and testing, signature packaging, listing review, etc.&lt;/p&gt;

&lt;h2&gt;
  
  
  Metaservice Introduction
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz7hp7u8ojkotxmvfgl6p.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz7hp7u8ojkotxmvfgl6p.png" width="800" height="476"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Metaservice is a new way of providing services&lt;/li&gt;
&lt;li&gt;Simple development, no installation, easy to obtain and use&lt;/li&gt;
&lt;li&gt;Compared with mini programs, it is native to the system and smooth and fluent&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;Lightweight application form, with features such as instant opening, pure and refreshing; service companionship, just in time; ready to use, account accompanying; one body with two sides, embedded operation; native intelligence, global search; efficient development, born to be trusted, etc.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fafyg7mn6nvopswyf5uda.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fafyg7mn6nvopswyf5uda.png" width="800" height="478"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Features
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Open in seconds: ready to use, no splash screen ads&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Service companion: fulfillment reminder, service closed loop&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Use and go: exit without pop-up window, service synchronized with account&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Native intelligence: Xiaoyi intelligence, precise reach Global search: system search box&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Efficient development: UX component set, scenario templates, etc.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Create meta-service
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Create project
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuwnvp0aat7y07gauqkbh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuwnvp0aat7y07gauqkbh.png" width="800" height="532"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open DevEco&lt;/li&gt;
&lt;li&gt;New -&amp;gt; Create Project&lt;/li&gt;
&lt;li&gt;Select Atmoic Service&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The first time, we will be prompted to log in with a Huawei account. Click here to log in. Note that the account logged in here is the developer account, which is the account used for listing. If you are an enterprise, you should log in with the company's developer account.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu4r05perrnltxm9l39ta.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu4r05perrnltxm9l39ta.png" width="800" height="532"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click to log in, and you will be redirected to the browser. Log in to the developer account on the web page and authorize it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv5zxg5g2x7hatv16nrdx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv5zxg5g2x7hatv16nrdx.png" width="800" height="945"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The web page shows that the login is successful, and then we can return to Deveco.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fr2ii3ze8x2db29u4jak9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fr2ii3ze8x2db29u4jak9.png" width="800" height="480"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If it is the first time to use, the project has not been created yet. At this time, you need to click &lt;code&gt;Register App ID&lt;/code&gt; to create a new project&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyr53ol38vz72djbwfid3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyr53ol38vz72djbwfid3.png" width="800" height="532"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Fill in the meta service name. It is important to note that the name cannot be duplicated, must be recognizable, and cannot be a generalized category to avoid misleading users. For specific requirements, see the review guide in the reference material, otherwise the listing review will be rejected.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpgny8iq03jq3l9l06szt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpgny8iq03jq3l9l06szt.png" width="800" height="545"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click Next, select the project to which it belongs. If the project has not been created yet, enter the project name and click Confirm to create it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9z3fw4bqp33905iayq7x.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9z3fw4bqp33905iayq7x.png" width="800" height="529"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Complete APPID registration.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2dugpdht4urbnfu4arsz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2dugpdht4urbnfu4arsz.png" width="800" height="544"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It is urgent to create a meta service. Click Finish, and the sample code will be generated.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2vall1p23d0oc0woku5o.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2vall1p23d0oc0woku5o.png" width="800" height="532"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Icon generation
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnthq266fi2ffkw9v1t3p.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnthq266fi2ffkw9v1t3p.png" width="800" height="531"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Right-click the module or file in the project&lt;/p&gt;

&lt;p&gt;New -&amp;gt; Image Asset&lt;/p&gt;

&lt;p&gt;Make a 1024 x 1024 px square icon and automatically generate a circle around it&lt;/p&gt;

&lt;h2&gt;
  
  
  Write a page
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgp3gxwaf88nj1r1wfs9f.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgp3gxwaf88nj1r1wfs9f.png" width="800" height="657"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;@Entry indicates that the custom component is an entry component, which means that the current page is a page&lt;/p&gt;

&lt;p&gt;@Component indicates a custom component&lt;/p&gt;

&lt;p&gt;@State indicates the state variable in the component. Changes in the state variable will trigger a UI refresh&lt;/p&gt;

&lt;p&gt;aboutToAppear is the life cycle, after the component is instantiated and before build()&lt;/p&gt;

&lt;p&gt;build() is the UI description method&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Note: Meta services have exactly the same technology stack as HarmonyOS native applications, only the available API sets are different, and the functions are relatively simple&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Notes on writing meta services
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv640zh6pn32h26xrb9yf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv640zh6pn32h26xrb9yf.png" width="800" height="588"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Many API/Kit Cannot be used in meta-services.&lt;/p&gt;

&lt;p&gt;Open the API reference, you can check on the left to filter the meta-service API set&lt;/p&gt;

&lt;h2&gt;
  
  
  Service card
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn66fgmiqwluq5l7e20j2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn66fgmiqwluq5l7e20j2.png" width="785" height="720"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Static card interaction component FormLink&lt;/p&gt;

&lt;p&gt;Used for interaction between static cards and provider applications&lt;/p&gt;

&lt;p&gt;action: router is used for redirection, and the UIAbility side receives parameters through params&lt;/p&gt;

&lt;h3&gt;
  
  
  Receive parameter transmission
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fua6ynrdjd8sav3n7hp5z.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fua6ynrdjd8sav3n7hp5z.png" width="720" height="782"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;EntryAbility.ets&lt;/p&gt;

&lt;p&gt;Receive parameters through want?.parameters?.params in onCreate and onNewWant&lt;/p&gt;

&lt;p&gt;onCreate: UIAbility instance creation&lt;/p&gt;

&lt;p&gt;onNewWant: UIAbility instance returns to the foreground from the background, hot start&lt;/p&gt;

&lt;p&gt;onWindowStageCreate: After UIAbility is created, before entering the foreground, WindowStage will be created&lt;/p&gt;

&lt;h2&gt;
  
  
  Development and testing
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg85p5jhyshbtdrzb8iye.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg85p5jhyshbtdrzb8iye.png" width="800" height="455"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Simulator&lt;/li&gt;
&lt;li&gt;Previewer&lt;/li&gt;
&lt;li&gt;Real machine debugging&lt;/li&gt;
&lt;li&gt;Hot reload&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fved9uzc5soybygg95nrv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fved9uzc5soybygg95nrv.png" width="800" height="503"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;DevEco Testing&lt;/p&gt;

&lt;p&gt;Stability test&lt;br&gt;
Performance and power consumption test&lt;br&gt;
Regression test&lt;br&gt;
Basic quality test&lt;br&gt;
Device projection&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Support the meta-services of tablets and ensure that compatibility testing has been carried out, otherwise it will affect the listing review.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This part is described in detail in "HarmonyOS Flutter Practice: 13-HarmonyOS Application Packaging and Listing Process".&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9eylkqjs0v4k3kfwq5u7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9eylkqjs0v4k3kfwq5u7.png" width="800" height="499"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create a Key Store in DevEco&lt;/li&gt;
&lt;li&gt;Generate Key and CSR&lt;/li&gt;
&lt;li&gt;Add a new certificate in Huawei AGC, upload CSR, and obtain the Cer certificate file&lt;/li&gt;
&lt;li&gt;Create a Profile file&lt;/li&gt;
&lt;li&gt;Configure the signature file&lt;/li&gt;
&lt;li&gt;Packaging (Build/Huild Apps)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F73uzmi40fbvqq6oplmbp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F73uzmi40fbvqq6oplmbp.png" width="800" height="480"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Return to AGC, complete the application information, and upload the icon&lt;/li&gt;
&lt;li&gt;Upload the software package&lt;/li&gt;
&lt;li&gt;Complete the application introduction, fill in the privacy policy and user agreement&lt;/li&gt;
&lt;li&gt;If it is an APP, you need to prepare the filing and software copyright in advance (it is recommended to use an electronic copyright certificate)&lt;/li&gt;
&lt;li&gt;Submit for review&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://developer.huawei.com/consumer/cn/fa" rel="noopener noreferrer"&gt;Meta-Service&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developer.huawei.com/consumer/cn/doc/app/50129-01" rel="noopener noreferrer"&gt;Meta-Service Review Guide&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="//../HarmonyOS%20Flutter%20Practical/HarmonyOS%20Flutter%20Practice:%2013-HarmonyOS%20Application%20Packaging%20and%20Shelf%20Process.md"&gt;HarmonyOS Flutter Practice: 13-HarmonyOS Application Packaging and Shelf Process&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>harmonyos</category>
      <category>harmony</category>
    </item>
    <item>
      <title>HarmonyOS Native Development Notes: 02 - Service Card Development</title>
      <dc:creator>shaohushuo</dc:creator>
      <pubDate>Tue, 24 Jun 2025 14:42:54 +0000</pubDate>
      <link>https://dev.to/shaohushuo/harmonyos-native-development-notes-02-service-card-development-5ni</link>
      <guid>https://dev.to/shaohushuo/harmonyos-native-development-notes-02-service-card-development-5ni</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Service cards are desktop widgets that can be placed on the desktop and other locations, and can be reached at a touch.&lt;/p&gt;

&lt;p&gt;Service cards are divided into two categories: static cards and dynamic cards. This article introduces static cards.&lt;/p&gt;

&lt;h2&gt;
  
  
  Create
&lt;/h2&gt;

&lt;p&gt;Back to DevEco, right-click in the directory &lt;code&gt;entry&lt;/code&gt;, click Create Service Widget, select &lt;code&gt;Static Widget&lt;/code&gt;, and click Next.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9v8n6t3mi8d3cp6l5r6e.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9v8n6t3mi8d3cp6l5r6e.png" width="800" height="379"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Enter a name, select a supported card size, and click OK to create the card.&lt;/p&gt;

&lt;p&gt;2*2 represents 2 rows and 2 columns, and 1*2 represents 1 row and 2 columns.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6e1lsaqlir32ivc1wnot.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6e1lsaqlir32ivc1wnot.png" width="800" height="532"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Write the card interface&lt;/p&gt;

&lt;h2&gt;
  
  
  Interaction
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Click event parameter transmission
&lt;/h3&gt;

&lt;p&gt;Here ArkUI is used to write the interface, but click events cannot be used. Instead, FormLink should be used. The related events are received on the formability side. Through different parameters, router.push is called to open different pages.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;FormLink({ 
action: this.ACTION_TYPE, 
abilityName: this.ABILITY_NAME, 
params: { 
action: this.MESSAGE 
} 
}) { 
... 
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Parameter reception
&lt;/h3&gt;

&lt;p&gt;In the &lt;code&gt;onCreate&lt;/code&gt; and &lt;code&gt;onNewWant&lt;/code&gt; life cycles in &lt;code&gt;entryability&lt;/code&gt;, to receive parameters&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="nf"&gt;onCreate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;want&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Want&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;launchParam&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;AbilityConstant&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;LaunchParam&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; 

&lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;want&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nx"&gt;parameters&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nx"&gt;params&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; 
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="na"&gt;params&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Record&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;Object&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;parse&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;want&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;parameters&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;params&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; 
&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;selectPage&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;params&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;action&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; 
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;selectPage&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;selectPage&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; 
&lt;span class="p"&gt;}&lt;/span&gt; 
&lt;span class="p"&gt;}&lt;/span&gt; 

&lt;span class="nf"&gt;onNewWant&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;want&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Want&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;launchParam&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;AbilityConstant&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;LaunchParam&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;onNewWant&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;want&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nx"&gt;parameters&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nx"&gt;params&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="c1"&gt;// want.parameters.params corresponds to the content of params in postCardAction()&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="na"&gt;params&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Record&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;Object&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;parse&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;want&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;parameters&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;params&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;selectPage&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;params&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;action&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nx"&gt;hilog&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;info&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;DOMAIN_NUMBER&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;TAG&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;`onNewWant selectPage: &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;selectPage&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;currentWindowStage&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;onWindowStageCreate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;currentWindowStage&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Notes
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;When running, please use normal mode. Service cards do not support HotReload, and cards cannot be displayed normally in hot reload mode.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://developer.huawei.com/consumer/cn/sdk/form-kit/" rel="noopener noreferrer"&gt;Service Card Documentation&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>harmony</category>
      <category>harmonyos</category>
    </item>
    <item>
      <title>HarmonyOS Native Development Notes: 01-Meta-Service Development</title>
      <dc:creator>shaohushuo</dc:creator>
      <pubDate>Tue, 24 Jun 2025 14:29:02 +0000</pubDate>
      <link>https://dev.to/shaohushuo/harmonyos-native-development-notes-01-meta-service-development-624</link>
      <guid>https://dev.to/shaohushuo/harmonyos-native-development-notes-01-meta-service-development-624</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Meta-service is a lightweight application form in HarmonyOS, which can be run directly without downloading. It is similar to WeChat applet, but different from applet, meta-service is more lightweight.&lt;/p&gt;

&lt;p&gt;Meta-service is developed by native and provided at the system level. It is better than applet in terms of ease of use, performance and experience.&lt;/p&gt;

&lt;h2&gt;
  
  
  Create meta-service
&lt;/h2&gt;

&lt;p&gt;Use DevEco, click Create, select Atomic Service in the template on the left, and select Empty Ability in the template on the right. Click Next according to the prompts.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fenoqetnu2lvfenbm3xko.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fenoqetnu2lvfenbm3xko.png" width="800" height="532"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Icon generation
&lt;/h2&gt;

&lt;p&gt;After the icon is designed, you can use DevEco's built-in generation tool to generate an icon that meets the meta-service specification. In the &lt;code&gt;src/main/resources/media&lt;/code&gt; directory, right-click &lt;code&gt;New-&amp;gt;Image Asset&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzjbrlkasz70nx43bf241.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzjbrlkasz70nx43bf241.png" width="800" height="531"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A production dialog box will pop up. Select the designed icon and check the main color to generate the meta-service icon.&lt;/p&gt;

&lt;h2&gt;
  
  
  Write page
&lt;/h2&gt;

&lt;p&gt;Open the &lt;code&gt;src/main/ets/pages/index.ets&lt;/code&gt; page. The writing method is consistent with the ArkUI application. Start writing the page code here.&lt;/p&gt;

&lt;h3&gt;
  
  
  API restrictions
&lt;/h3&gt;

&lt;p&gt;It should be noted that some APIs cannot be used in meta-services. In the HarmonOS document, open the API reference and check &lt;code&gt;Filter meta-service API set&lt;/code&gt; on the left to see which APIs may be used in meta-services.&lt;/p&gt;

&lt;h3&gt;
  
  
  Permission restrictions
&lt;/h3&gt;

&lt;p&gt;There are more permission restrictions in meta-services. In the API documentation, the permissions that support the use of meta-services will be registered at &lt;code&gt;Meta-service API&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/restricted-permissions-V5#section89191571295" rel="noopener noreferrer"&gt;Restricted open permissions&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Dark mode
&lt;/h2&gt;

&lt;p&gt;In the &lt;code&gt;src/main/resources&lt;/code&gt; directory, create a new &lt;code&gt;dark&lt;/code&gt; directory, right-click in the resources directory, select &lt;code&gt;Resource Directory&lt;/code&gt;, select &lt;code&gt;Color Mode&lt;/code&gt; on the left side of the dialog box,&lt;br&gt;
and then click OK&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F82ecr97pl6ka3fvb00v0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F82ecr97pl6ka3fvb00v0.png" width="800" height="491"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In portable code, referencing color variables through lines such as &lt;code&gt;$r('app.color.primary_button_color')&lt;/code&gt; will reference &lt;code&gt;resources/dart/element/color.json&lt;/code&gt; in dark mode. In the file, find the corresponding color variable. For other assets, such as images, the same method is used.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftc3nmz7vusyt9cwsyych.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftc3nmz7vusyt9cwsyych.png" width="786" height="572"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Service card
&lt;/h2&gt;

&lt;p&gt;Meta-services can add service cards. For details, see "HarmonyOS Native Development Notes: 02-Service Card Development"&lt;/p&gt;

&lt;h2&gt;
  
  
  Development and testing
&lt;/h2&gt;

&lt;p&gt;Click Run in DevEco. On the device, you can click the "Search" button above the negative one screen to enter my meta-service list. You can see the newly installed meta-service in the recent.&lt;/p&gt;

&lt;h2&gt;
  
  
  Listing
&lt;/h2&gt;

&lt;p&gt;For details, see "HarmonyOS Flutter Practice: 13-HarmonyOS Application Packaging and Listing Process". First add the application project, then add the meta-service.&lt;/p&gt;

&lt;h2&gt;
  
  
  Notes
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Click failure problem in the navigation bar.
When using &lt;code&gt;RelativeContainer&lt;/code&gt;, it is found that if the button is in the same row as the button on the right side of the meta-service at the top, the click event is not triggered. In this case, do not use the &lt;code&gt;RelativeContainer&lt;/code&gt; component, and use other components such as &lt;code&gt;Column&lt;/code&gt; instead.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://developer.huawei.com/consumer/cn/doc/atomic-guides-V5/atomic-service-definition-V5" rel="noopener noreferrer"&gt;Meta-Service Development Guide&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developer.huawei.com/consumer/cn/doc/harmonyos-references-V5/arkts-api-V5?catalogVersion=V5" rel="noopener noreferrer"&gt;ArkTS API Reference&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/health-permission-description-V5" rel="noopener noreferrer"&gt;Permission Description&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>harmony</category>
      <category>harmonyos</category>
    </item>
    <item>
      <title>HarmonyOS Flutter Repository Stops Updates</title>
      <dc:creator>shaohushuo</dc:creator>
      <pubDate>Fri, 13 Jun 2025 13:47:10 +0000</pubDate>
      <link>https://dev.to/shaohushuo/harmonyos-flutter-repository-stops-updates-5db8</link>
      <guid>https://dev.to/shaohushuo/harmonyos-flutter-repository-stops-updates-5db8</guid>
      <description>&lt;h2&gt;
  
  
  Stop Updates
&lt;/h2&gt;

&lt;p&gt;Friends who are familiar with Flutter Harmony development should know that Flutter 3.7.12 Harmony SDK has been released in the open source Harmony community for almost a year. The Harmony adaptation of Flutter 3.22.x has been provided by the &lt;a href="https://gitee.com/harmonycommando_flutter/flutter" rel="noopener noreferrer"&gt;Harmony Commando Repository&lt;/a&gt;. Recently, some friends reported that it has not stopped updating for more than 2 months, and many people thought that maintenance has stopped.&lt;/p&gt;

&lt;p&gt;This is not the case.&lt;/p&gt;

&lt;h2&gt;
  
  
  Migration and merging
&lt;/h2&gt;

&lt;p&gt;Flutter's Harmony adaptation work has been ongoing. The article &lt;a href="https://blog.csdn.net/zackslee/article/details/144914441" rel="noopener noreferrer"&gt;Harmony Flutter Practice: 15-Flutter Engine Impeller Harmonyization, Performance Optimization and Future&lt;/a&gt; details the adaptation work content and future plans. The author mentioned in the previous article &lt;a href="https://blog.csdn.net/zackslee/article/details/146475114" rel="noopener noreferrer"&gt;The original open source Harmony warehouse stopped updating&lt;/a&gt; that with the collective migration of the open source Harmony warehouse to &lt;a href="https://gitcode.com/openharmony-sig/" rel="noopener noreferrer"&gt;gitcode&lt;/a&gt;, &lt;a href="https://gitee.com/harmonycommando_flutter/flutter" rel="noopener noreferrer"&gt;the 3.22.x version of Flutter SDK maintained by the Harmony Commando&lt;/a&gt; has also been merged into the &lt;a href="https://gitcode.com/openharmony-sig/flutter_flutter" rel="noopener noreferrer"&gt;Open Source Harmony Flutter Main Repository&lt;/a&gt;, and currently exists in the form of branch &lt;code&gt;3.22.0-ohos&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;So far, the initial integration of Flutter Harmony has been completed, and two major versions are maintained simultaneously using one repository.&lt;/p&gt;

&lt;h2&gt;
  
  
  Summary Review
&lt;/h2&gt;

&lt;p&gt;Flutter Harmony SDK is still active, and the last update was 4 days ago. If you need to use FVM to install the 3.22 version of the SDK, you can use the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone &lt;span class="nt"&gt;-b&lt;/span&gt; 3.22.0-ohos https://gitcode.com/openharmony-sig/flutter_flutter.git custom_3.22.0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you need to use FVM to install the 3.7.12 version of the SDK, you can use the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone &lt;span class="nt"&gt;-b&lt;/span&gt; br_3.7.12-ohos-1.0.6 https://gitcode.com/openharmony-sig/flutter_flutter.git custom_3.7.12
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The following are all the warehouse addresses related to Flutter Harmony:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Flutter sdk &lt;a href="https://gitcode.com/openharmony-sig/flutter_flutter" rel="noopener noreferrer"&gt;https://gitcode.com/openharmony-sig/flutter_flutter&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Flutter engine &lt;a href="https://gitee.com/openharmony-sig/flutter_engine" rel="noopener noreferrer"&gt;https://gitee.com/openharmony-sig/flutter_engine&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Flutter packages &lt;a href="https://gitcode.com/openharmony-sig/flutter_packages" rel="noopener noreferrer"&gt;https://gitcode.com/openharmony-sig/flutter_packages&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Flutter sample sample library &lt;a href="https://gitcode.com/openharmony-sig/flutter_samples" rel="noopener noreferrer"&gt;https://gitcode.com/openharmony-sig/flutter_samples&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For other third-party libraries under gitee/openharmony-sig, just replace the domain name, such as flutter inappwebview migrated to &lt;a href="https://gitcode.com/openharmony-sig/flutter_inappwebview" rel="noopener noreferrer"&gt;https://gitcode.com/openharmony-sig/flutter_inappwebview&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In addition, some friends are using Flutter 3.7.12 version, then the SDK also needs to switch the source address, just change the domain name.&lt;/p&gt;

</description>
      <category>harmonyos</category>
      <category>flutter</category>
    </item>
    <item>
      <title>Which HarmonyOS native applications are using Flutter</title>
      <dc:creator>shaohushuo</dc:creator>
      <pubDate>Fri, 13 Jun 2025 13:46:41 +0000</pubDate>
      <link>https://dev.to/shaohushuo/which-harmonyos-native-applications-are-using-flutter-2057</link>
      <guid>https://dev.to/shaohushuo/which-harmonyos-native-applications-are-using-flutter-2057</guid>
      <description>&lt;h2&gt;
  
  
  Background
&lt;/h2&gt;

&lt;p&gt;On August 4, 2023, Huawei released HarmonyOS NEXT at the "2023 Huawei Developer Conference" and announced that the system would be open to cooperative enterprise developers.&lt;/p&gt;

&lt;p&gt;HarmonyOS NEXT, also known as HarmonyOS 5.0, is the largest update version in the history of Harmony. Harmony is no longer compatible with Android and uses its own kernel (Harmony kernel), which completely replaces the original system functions in terms of kernel, operating system, and application layer. Harmony has completely gotten rid of the title of "Android shell".&lt;/p&gt;

&lt;h2&gt;
  
  
  Harmony native
&lt;/h2&gt;

&lt;p&gt;For Everbright's application manufacturers and developers, all applications must be redeveloped and adapted. So what is the so-called native Harmony development? This article will discuss the following aspects:&lt;/p&gt;

&lt;h3&gt;
  
  
  Bottom-level adaptation
&lt;/h3&gt;

&lt;p&gt;The original application needs to be rewritten, such as using ArkUI to completely re-adapt, or based on some cross-platform frameworks for Harmony adaptation. Some of the original Android system services also need to be replaced with &lt;a href="https://developer.huawei.com/consumer/cn/sdk" rel="noopener noreferrer"&gt;HarmonyOS Kit&lt;/a&gt;, such as Huawei's one-click login, payment, advertising, Webview, etc. APIs involving system functions need to be adapted and developed, and the best application will run on the Harmony system.&lt;/p&gt;

&lt;h3&gt;
  
  
  Harmony characteristics
&lt;/h3&gt;

&lt;p&gt;In addition to bottom-level adaptation, it is also necessary to start from the characteristics of Harmony and customize the development of functions exclusive to Harmony, such as service cards, meta-services, live windows, Xiaoyi, etc. Service cards can add various quick services on the desktop to display commonly used information; meta-services can use high-frequency quick services without installing the application or opening the application itself, such as recharging phone bills, checking express delivery, and ordering food; the live window is similar to the function of iOS, but it is more flexible and requires customized development; in order to better improve the user experience, the application can also be integrated with Xiaoyi. Through the intent framework, image and text dragging, etc., users can better use Xiaoyi Assistant, integrate application services, and recommend more valuable information to each user.&lt;/p&gt;

&lt;p&gt;HarmonyOS has many features that may not be available in other systems, such as distributed features, which can achieve &lt;a href="https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V13/distributed-overview-V13" rel="noopener noreferrer"&gt;seamless application flow&lt;/a&gt;, from one device to another; in addition, there are one-touch transmission, &lt;a href="some%20of%20the%20original%20Android%20system%20services%20also%20need%20to%20be%20used%20synchronously%20with%20[HarmonyOS%20Kit](https://developer.huawei.com/consumer/cn/sdk"&gt;unified code scanning&lt;/a&gt;, etc.&lt;/p&gt;

&lt;h3&gt;
  
  
  Business logic transformation
&lt;/h3&gt;

&lt;p&gt;In addition, in terms of business logic, HarmonyOS native applications also need to be transformed. Unlike the previous Android, which directly requested various permissions when the App was started, the HarmonyOS system provides various &lt;a href="https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/security-component-overview-V5" rel="noopener noreferrer"&gt;security controls&lt;/a&gt; and &lt;a href="https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/use-picker" rel="noopener noreferrer"&gt;System Picker&lt;/a&gt; can achieve safe and fast access to user data without requesting permissions, for example&lt;/p&gt;

&lt;h3&gt;
  
  
  One-to-many adaptation
&lt;/h3&gt;

&lt;p&gt;Harmony system naturally supports systems of various devices, whether it is mobile phones, tablets, folding p screens, smart screens, or Harmony PCs, so it is natural to develop Harmony applications and adapt to multiple devices.&lt;/p&gt;

&lt;p&gt;The so-called "one-to-many" refers to &lt;a href="https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/foreword" rel="noopener noreferrer"&gt;"one-time development, multi-terminal deployment"&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Whether using ArkUI, or Flutter, React Native, Uniapp and other frameworks, you can adapt to multiple terminals well. By identifying the screen ratio and size, the application can be flexibly laid out, or monitoring screen change events to trigger the application to re-layout, etc., due to the large number of devices and different ratios, these require a lot of work.&lt;/p&gt;

&lt;h2&gt;
  
  
  Which applications are using Flutter
&lt;/h2&gt;

&lt;p&gt;Flutter is a cross-platform development framework developed by Google and is used for development on Android, iOS, Linux, MacOS, Windows and other platforms. With the efforts of the open source Harmony community, Flutter also supports Harmony native development. So, which top applications use Flutter in Harmony native development? After data collection and research and analysis, the author has sorted out some of the top applications.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Serial number&lt;/th&gt;
&lt;th&gt;Application&lt;/th&gt;
&lt;th&gt;Download volume&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;WeChat&lt;/td&gt;
&lt;td&gt;4.18 million&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;Xianyu&lt;/td&gt;
&lt;td&gt;1.78 million&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;UC&lt;/td&gt;
&lt;td&gt;1.5 million&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;DingTalk&lt;/td&gt;
&lt;td&gt;1.38 million&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;5&lt;/td&gt;
&lt;td&gt;Quark&lt;/td&gt;
&lt;td&gt;1.07 million&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;6&lt;/td&gt;
&lt;td&gt;Enterprise WeChat&lt;/td&gt;
&lt;td&gt;850,000&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;7&lt;/td&gt;
&lt;td&gt;Shell&lt;/td&gt;
&lt;td&gt;530,000&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;8&lt;/td&gt;
&lt;td&gt;Douban&lt;/td&gt;
&lt;td&gt;320,000&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;9&lt;/td&gt;
&lt;td&gt;Alibaba Cloud Disk&lt;/td&gt;
&lt;td&gt;140,000&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;10&lt;/td&gt;
&lt;td&gt;Soul&lt;/td&gt;
&lt;td&gt;-&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;blockquote&gt;
&lt;p&gt;Download data as of May 5, 2025&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Many Alibaba applications use Flutter, including UC, Xianyu, Quark, DingTalk, etc. Among the contributors to the open source Harmony Flutter repository, UC can also be seen.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frxsoy6lufpymo718zxe0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frxsoy6lufpymo718zxe0.png" width="800" height="202"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For WeChat, Flutter also appeared. As early as before the launch of Harmony WeChat, there were reports of &lt;a href="https://blog.csdn.net/eclipsexys/article/details/143450711" rel="noopener noreferrer"&gt;screenshots&lt;/a&gt; of Moments using Flutter. "The technology selection of WeChat Moments turned out to be..."). At the same time, earlier, WeChat launched a new &lt;a href="https://developers.weixin.qq.com/miniprogram/dev/framework/runtime/skyline/introduction.html" rel="noopener noreferrer"&gt;mini-program rendering engine Skyline&lt;/a&gt;, and during the test, someone caught &lt;a href="https://gist.github.com/OpenGG/1c71380dd1401b7c93d39294772344fe" rel="noopener noreferrer"&gt;Skyline and flutter related logs&lt;/a&gt;, plus two articles released by WeChat after WeChat Harmony was officially launched, &lt;a href="https://mp.weixin.qq.com/s/vtW2fJjgZU5Ge2zTQKK6Ig" rel="noopener noreferrer"&gt;What do you need to go through to develop WeChat Harmony version? &lt;/a&gt;, these evidences show that WeChat is using Flutter.&lt;/p&gt;

</description>
      <category>harmonyos</category>
      <category>flutter</category>
    </item>
    <item>
      <title>HarmonyOS Flutter Practice: 25-Hybrid Development Detailed Explanation-5-Jump to Flutter Page</title>
      <dc:creator>shaohushuo</dc:creator>
      <pubDate>Fri, 13 Jun 2025 13:46:11 +0000</pubDate>
      <link>https://dev.to/shaohushuo/harmonyos-flutter-practice-25-hybrid-development-detailed-explanation-5-jump-to-flutter-page-3ekp</link>
      <guid>https://dev.to/shaohushuo/harmonyos-flutter-practice-25-hybrid-development-detailed-explanation-5-jump-to-flutter-page-3ekp</guid>
      <description>&lt;h2&gt;
  
  
  Overview
&lt;/h2&gt;

&lt;p&gt;In the previous chapter, we introduced how to initialize the Flutter engine. This article focuses on how to add and jump to the Flutter page.&lt;/p&gt;

&lt;h2&gt;
  
  
  Jump Principle
&lt;/h2&gt;

&lt;p&gt;The jump principle is as follows:&lt;/p&gt;

&lt;p&gt;Essentially, it jumps from a native page A to another native page B, but the difference is that page B is a page container with embedded Flutter content.&lt;/p&gt;

&lt;p&gt;At the same time, before opening page B, we need to notify Flutter to switch pages in advance. Here, the communication mechanism provided by Flutter is used, that is, EventChannel.&lt;/p&gt;

&lt;h2&gt;
  
  
  Add FlutterPage
&lt;/h2&gt;

&lt;p&gt;In order to display Flutter content, we need to create a native page as a container to host Flutter.&lt;/p&gt;

&lt;p&gt;Add a page in the &lt;code&gt;entry/src/main/etc/pages&lt;/code&gt; directory, for example, name it &lt;code&gt;FlutterContainerPage&lt;/code&gt;, right-click the &lt;code&gt;ohos/entry/src/main/ets/pages&lt;/code&gt; directory, select New-&amp;gt;Page-&amp;gt;Empty Page, change PageName to &lt;code&gt;FlutterContainerPage&lt;/code&gt;, click Finish, and then modify the page content as follows:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;FlutterEntry&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;FlutterPage&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;FlutterView&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@ohos/flutter_ohos&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;

&lt;span class="p"&gt;@&lt;/span&gt;&lt;span class="nd"&gt;Entry&lt;/span&gt;
&lt;span class="p"&gt;@&lt;/span&gt;&lt;span class="nd"&gt;Component&lt;/span&gt;
&lt;span class="nx"&gt;struct&lt;/span&gt; &lt;span class="nx"&gt;Index&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

&lt;span class="k"&gt;private&lt;/span&gt; &lt;span class="nx"&gt;flutterEntry&lt;/span&gt;&lt;span class="p"&gt;?:&lt;/span&gt; &lt;span class="nx"&gt;FlutterEntry&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;private&lt;/span&gt; &lt;span class="nx"&gt;flutterView&lt;/span&gt;&lt;span class="p"&gt;?:&lt;/span&gt; &lt;span class="nx"&gt;FlutterView&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="nf"&gt;aboutToAppear&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;flutterEntry&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;FlutterEntry&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;getContext&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;flutterEntry&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;aboutToAppear&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;flutterView&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;flutterEntry&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getFlutterView&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nf"&gt;aboutToDisappear&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;flutterEntry&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nf"&gt;aboutToDisappear&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nf"&gt;onPageShow&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;flutterEntry&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nf"&gt;onPageShow&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nf"&gt;onPageHide&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;flutterEntry&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nf"&gt;onPageHide&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nf"&gt;build&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="nc"&gt;RelativeContainer&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="nc"&gt;FlutterPage&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;viewId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;flutterView&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nf"&gt;getId&lt;/span&gt;&lt;span class="p"&gt;()})&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;FlutterPage is a component provided by OpenHarmony Flutter SDK, which is used to render Flutter pages in ArkUI. The principle is to use XComponent in ArkUI to customize the rendering content.&lt;/p&gt;

&lt;h2&gt;
  
  
  Modify the native page
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;router&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@kit.ArkUI&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="p"&gt;@&lt;/span&gt;&lt;span class="nd"&gt;Entry&lt;/span&gt;
&lt;span class="p"&gt;@&lt;/span&gt;&lt;span class="nd"&gt;Component&lt;/span&gt;
&lt;span class="nx"&gt;struct&lt;/span&gt; &lt;span class="nx"&gt;Index&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="nf"&gt;build&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="nc"&gt;Column&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="nc"&gt;Text&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Hello World&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;fontSize&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;50fp&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;fontWeight&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;FontWeight&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Bold&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nc"&gt;Blank&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;height&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;80&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nc"&gt;Button&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Jump to Flutter&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;onClick&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="nx"&gt;router&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;pushUrl&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;url&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;pages/FlutterContainerPage&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;})&lt;/span&gt;
&lt;span class="p"&gt;})&lt;/span&gt;
&lt;span class="p"&gt;}.&lt;/span&gt;&lt;span class="nf"&gt;justifyContent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;FlexAlign&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Center&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;alignItems&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;HorizontalAlign&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Center&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;width&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;100%&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;height&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;100%&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We add a button to the native page and jump to the Flutter page when the button is clicked.&lt;/p&gt;

&lt;h2&gt;
  
  
  Next
&lt;/h2&gt;

&lt;p&gt;In the above example, the Flutter page opened each time is fixed. Next, we will explore how to dynamically jump to the Flutter page.&lt;/p&gt;

&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://gitcode.com/openharmony-tpc/flutter_samples/blob/br_3.7.12-ohos-1.1.0/ohos/docs/04_development/%E5%A6%82%E4%BD%95%E4%BD%BF%E7%94%A8%E6%B7%B7%E5%90%88%E5%BC%80%E5%8F%91%E6%B7%BB%E5%8A%A0%E8%B7%B3%E8%BD%AC%20FlutterEntry.md" rel="noopener noreferrer"&gt;How to add jump FlutterEntry using hybrid development&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://gitcode.com/openharmony-tpc/flutter_samples/tree/br_3.7.12-ohos-1.1.0/ohos/flutter_page_sample2" rel="noopener noreferrer"&gt;flutter_page_sample2&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://gitcode.com/openharmony-tpc/flutter_samples/tree/br_3.7.12-ohos-1.1.0/ohos/flutter_page_sample1" rel="noopener noreferrer"&gt;flutter_page_sample1&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>harmonyos</category>
      <category>flutter</category>
    </item>
    <item>
      <title>HarmonyOS Flutter Practice: 24-Hybrid Development Detailed Explanation-4-Initialize Flutter</title>
      <dc:creator>shaohushuo</dc:creator>
      <pubDate>Fri, 13 Jun 2025 13:45:41 +0000</pubDate>
      <link>https://dev.to/shaohushuo/harmonyos-flutter-practice-24-hybrid-development-detailed-explanation-4-initialize-flutter-1372</link>
      <guid>https://dev.to/shaohushuo/harmonyos-flutter-practice-24-hybrid-development-detailed-explanation-4-initialize-flutter-1372</guid>
      <description>&lt;h2&gt;
  
  
  Overview
&lt;/h2&gt;

&lt;p&gt;After adding the Flutter module to the host Harmony project, you need to implement page jump, message communication and other functions. This article focuses on how to initialize Flutter.&lt;/p&gt;

&lt;h2&gt;
  
  
  Project configuration
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Add dependencies
&lt;/h3&gt;

&lt;p&gt;Edit the ohos_app/oh-package.json file&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;If you import the Flutter module through the Har package, you need to add the following content
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="nl"&gt;"dependencies"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="nl"&gt;"@ohos/flutter_module"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"file:har/my_flutter_module.har"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="nl"&gt;"@ohos/flutter_ohos"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"file:har/my_flutter.har"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="err"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="s2"&gt;"overrides"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="nl"&gt;"@ohos/flutter_ohos"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"file:har/flutter.har"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;If you import the Flutter module through source code, you need to add the following content:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="nl"&gt;"dependencies"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="nl"&gt;"@ohos/flutter_module"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"./flutter_module"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="nl"&gt;"@ohos/flutter_ohos"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"./har/flutter.har"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="err"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Initialize the Flutter engine
&lt;/h2&gt;

&lt;p&gt;Edit &lt;code&gt;ohos_app/entry/src/main/ets/entryability/EntryAbility.ts&lt;/code&gt; file, modify it as follows:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight diff"&gt;&lt;code&gt;&lt;span class="gd"&gt;-import { AbilityConstant, ConfigurationConstant, UIAbility, Want } from '@kit.AbilityKit';
-import { hilog } from '@kit.PerformanceAnalysisKit';
-import { window } from '@kit.ArkUI';
&lt;/span&gt;&lt;span class="gi"&gt;+import { FlutterAbility, FlutterEngine } from '@ohos/flutter_ohos';
+import { GeneratedPluginRegistrant } from '@ohos/flutter_module';
&lt;/span&gt;&lt;span class="err"&gt;
&lt;/span&gt;&lt;span class="gd"&gt;-const DOMAIN = 0x0000;
-
-export default class EntryAbility extends UIAbility {
- onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void {
- this.context.getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_NOT_SET);
- hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onCreate');
- }
-
- onDestroy(): void {
- hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onDestroy');
- }
-
- onWindowStageCreate(windowStage: window.WindowStage): void {
- // Main window is created, set main page for this ability
- hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageCreate');
-
- windowStage.loadContent('pages/Index', (err) =&amp;gt; {
- if (err.code) {
- hilog.error(DOMAIN, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err));
- return;
- }
- hilog.info(DOMAIN, 'testTag', 'Succeeded in loading the content.');
- });
- }
-
- onWindowStageDestroy(): void {
- // Main window is destroyed, release UI related resources
- hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageDestroy');
- }
-
- onForeground(): void {
- // Ability has brought to foreground
- hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onForeground');
- }
-
- onBackground(): void {
- // Ability has back to background
- hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onBackground');
&lt;/span&gt;&lt;span class="gi"&gt;+export default class EntryAbility extends FlutterAbility {
+ configureFlutterEngine(flutterEngine: FlutterEngine) {
+ super.configureFlutterEngine(flutterEngine)
+ GeneratedPluginRegistrant.registerWith(flutterEngine); 
&lt;/span&gt;}
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The final EntryAbility.ts file content is as follows:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;FlutterAbility&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;FlutterEngine&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@ohos/flutter_ohos&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;GeneratedPluginRegistrant&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@ohos/flutter_module&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;EntryAbility&lt;/span&gt; &lt;span class="kd"&gt;extends&lt;/span&gt; &lt;span class="nc"&gt;FlutterAbility&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; 
&lt;span class="nf"&gt;configureFlutterEngine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;flutterEngine&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;FlutterEngine&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;super&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;configureFlutterEngine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;flutterEngine&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nx"&gt;GeneratedPluginRegistrant&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;registerWith&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;flutterEngine&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;EntryAbility&lt;/code&gt; inherits from &lt;code&gt;FlutterAbility&lt;/code&gt;, and &lt;code&gt;FlutterAbility&lt;/code&gt; inherits from &lt;code&gt;UIAbility&lt;/code&gt;, which adds the following features to &lt;code&gt;UIAbility&lt;/code&gt;:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Engine management&lt;/li&gt;
&lt;li&gt;Initialize Flutter engine (FlutterEngine)&lt;/li&gt;
&lt;li&gt;Handle Flutter and native capability binding through Delegate&lt;/li&gt;
&lt;li&gt;Manage window lifecycle (create/destroy)&lt;/li&gt;
&lt;li&gt;UI interaction&lt;/li&gt;
&lt;li&gt;Create FlutterView view container&lt;/li&gt;
&lt;li&gt;Handle system configuration changes (dark mode/font scaling)&lt;/li&gt;
&lt;li&gt;Implement multi-language/accessibility service adaptation&lt;/li&gt;
&lt;li&gt;Lifecycle coordination&lt;/li&gt;
&lt;li&gt;Forward native lifecycle events to the Flutter layer (onForeground/onBackground)&lt;/li&gt;
&lt;li&gt;Handle exception recovery (appRecovery.restartApp)&lt;/li&gt;
&lt;li&gt;Extension support&lt;/li&gt;
&lt;li&gt;Provide plugin management interface (addPlugin)&lt;/li&gt;
&lt;li&gt;Support hot reload configuration synchronization (onConfigurationUpdate)&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;This section mainly introduces how to initialize the Flutter engine and initialize the Flutter Module. In the next section, we will introduce how to jump from native to Flutter and display the interface.&lt;/p&gt;

&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://gitcode.com/openharmony-sig/flutter_samples/blob/br_3.7.12-ohos-1.1.0/ohos/docs/04_development/%E5%A6%82%E4%BD%95%E4%BD%BF%E7%94%A8%E6%B7%B7%E5%90%88%E5%BC%80%E5%8F%91%20module.md" rel="noopener noreferrer"&gt;How to use the hybrid development module&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://gitcode.com/openharmony-sig/flutter_samples/blob/br_3.7.12-ohos-1.1.0/ohos/docs/04_development/%E5%A6%82%E4%BD%95%E4%BD%BF%E7%94%A8%E6%B7%B7%E5%90%88%E5%BC%80%E5%8F%91%E6%B7%BB%E5%8A%A0%E8%B7%B3%E8%BD%AC%20FlutterEntry.md" rel="noopener noreferrer"&gt;How to add a jump using hybrid development FlutterEntry&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>harmonyos</category>
      <category>flutter</category>
    </item>
    <item>
      <title>HarmonyOS Flutter Practice: 23-Hybrid Development Detailed Explanation-3-Source Code Mode Introduction</title>
      <dc:creator>shaohushuo</dc:creator>
      <pubDate>Fri, 13 Jun 2025 13:45:15 +0000</pubDate>
      <link>https://dev.to/shaohushuo/harmonyos-flutter-practice-23-hybrid-development-detailed-explanation-3-source-code-mode-4ock</link>
      <guid>https://dev.to/shaohushuo/harmonyos-flutter-practice-23-hybrid-development-detailed-explanation-3-source-code-mode-4ock</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;In the previous article &lt;a href="//./Harmony%20Flutter%20Practice:%2022-Hybrid%20Development%20Detailed%20Explanation-2-Har%20Package%20Mode%20Introduction.md"&gt;Hybrid Development Detailed Explanation-2-Har Package Mode Introduction&lt;/a&gt;, we introduced how to package the Flutter module into a Har package and introduce it into the native Harmony project. In this article, we will introduce how to introduce the Flutter module into the native Harmony project through source code dependency.&lt;/p&gt;

&lt;h2&gt;
  
  
  Create work
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Create a root directory
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;mkdir &lt;/span&gt;ohos_flutter_module_demo
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This directory is used to store flutter projects and Harmony projects.&lt;/p&gt;

&lt;h3&gt;
  
  
  Create a Flutter module
&lt;/h3&gt;

&lt;p&gt;First, create a Flutter module. We choose the same directory as the ohos_app project&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;flutter create &lt;span class="nt"&gt;--template&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;module my_flutter_module
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;If fvm is used, first make sure that the flutter version used in the current directory is the Harmony SDK version. For example, you can use &lt;code&gt;fvm use custom_3.22.0&lt;/code&gt; to set it, and then add fvm before the flutter command. The above command becomes &lt;code&gt;fvm flutter create --template=module my_flutter_module&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The following output appears on the command line:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;Creating project my_flutter_module...
Resolving dependencies &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="sb"&gt;`&lt;/span&gt;my_flutter_module&lt;span class="sb"&gt;`&lt;/span&gt;...
Downloading packages...
Got dependencies &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="sb"&gt;`&lt;/span&gt;my_flutter_module&lt;span class="sb"&gt;`&lt;/span&gt;&lt;span class="nb"&gt;.&lt;/span&gt;
Wrote 12 files.

All &lt;span class="k"&gt;done&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;
Your module code is &lt;span class="k"&gt;in &lt;/span&gt;my_flutter_module/lib/main.dart.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Create Flutter After the module is successfully created, the directory structure is as follows:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F55z1ewza1pinugerpazk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F55z1ewza1pinugerpazk.png" width="688" height="866"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Create a DevEco project
&lt;/h3&gt;

&lt;p&gt;Use DevEco to create a new project named ohos_app in the ohos_flutter_module_demo directory.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F73dzdqvs4ecbqw7aowah.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F73dzdqvs4ecbqw7aowah.png" width="800" height="532"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Note that the saved directory is xxxx/ohos_flutter_module_demo/ohos_app&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;After the DevEco project is created, sign the project as follows.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Open the my_flutter_module/.ohos project in DevEco Studio and configure the debug signature (File -&amp;gt; Project Structure -&amp;gt; Signing Configs, check Automatically generate signature), then click Apply and OK.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After successful creation, the entire directory structure is as follows:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffe0vj8dn4q99k0vt4tq8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffe0vj8dn4q99k0vt4tq8.png" width="686" height="1470"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As you can see, we put the Flutter module at the same level as the ohos_app project. The .ohos directory is automatically created in my_flutter_module, which is also a simple Harmony project, but it will contain a module named flutter_module.&lt;/p&gt;

&lt;h2&gt;
  
  
  Configure source code dependencies
&lt;/h2&gt;

&lt;h3&gt;
  
  
  .ohos soft link to the main project
&lt;/h3&gt;

&lt;p&gt;Since the solution given in the &lt;a href="https://gitcode.com/openharmony-sig/flutter_samples/blob/br_3.7.12-ohos-1.1.0/ohos/docs/04_development/%E5%A6%82%E4%BD%95%E4%BD%BF%E7%94%A8%E6%B7%B7%E5%90%88%E5%BC%80%E5%8F%91%20module.md" rel="noopener noreferrer"&gt;Open Source Harmony Official Document&lt;/a&gt; is not ideal, here we use the soft link solution to achieve source code-based linkage development.&lt;/p&gt;

&lt;p&gt;Under normal circumstances, after my_flutter_module is successfully created, it will contain a .ohos directory, which is a Harmony project (containing the flutter_module module), which can be used as the host of Flutter. However, this host project is not the ohos_app we expected. The two projects have no connection, so they cannot be developed in conjunction.&lt;/p&gt;

&lt;p&gt;So we do the following:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# ⚠️First, you need to copy flutter_module to the Harmony host project to avoid the error "Error: Parse ohos module.json5 error: Error: Can not found module.json5 at"&lt;/span&gt;
&lt;span class="nb"&gt;cp&lt;/span&gt; &lt;span class="nt"&gt;-r&lt;/span&gt; my_flutter_module/.ohos/flutter_module ohos_app/

&lt;span class="c"&gt;# Enter the directory my_flutter_module and create a soft link here&lt;/span&gt;
&lt;span class="nb"&gt;cd &lt;/span&gt;my_flutter_module
&lt;span class="c"&gt;# Delete the .ohos directory&lt;/span&gt;
&lt;span class="nb"&gt;rm&lt;/span&gt; &lt;span class="nt"&gt;-rf&lt;/span&gt; .ohos
&lt;span class="c"&gt;# Create a soft link to the Harmony host project and change the directory name as needed&lt;/span&gt;
&lt;span class="nb"&gt;ln&lt;/span&gt; &lt;span class="nt"&gt;-s&lt;/span&gt; ../ohos_app .ohos
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Through the above operations, we replace the .ohos directory with the ohos_app Harmony project in a soft link. In this way, when we run the Flutter code, ohos_app will be used as the host, which realizes the linkage source code development and supports hot reload.&lt;/p&gt;

&lt;h3&gt;
  
  
  Update the project
&lt;/h3&gt;

&lt;p&gt;After the above operation, we run &lt;code&gt;flutter run&lt;/code&gt; to let Flutter automatically update the project configuration&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Run the flutter code to update the Harmony project directory&lt;/span&gt;
flutter run
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Check the &lt;code&gt;ohos_app/build-profile.json5&lt;/code&gt; file, you can see that the command automatically adds the module configuration:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight diff"&gt;&lt;code&gt;"modules": [
...
&lt;span class="gi"&gt;+ {
+ "name": "flutter_module",
+ "srcPath": "./flutter_module"
+ }
&lt;/span&gt;]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Also check the ohos_app/har directory, you can see that the flutter.har file is automatically generated.&lt;/p&gt;

&lt;p&gt;You can see that when running &lt;code&gt;flutter run&lt;/code&gt;, the console outputs the following:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;Launching lib/main.dart on FMR0224904009635 &lt;span class="k"&gt;in &lt;/span&gt;debug mode...
start hap build...
...
Running Hvigor task assembleHap... 95.7s
✓ Built ../ohos_app/entry/build/default/outputs/default/entry-default-signed.hap.
installing hap. bundleName: com.shaohushuo.ohos_app
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After a while of waiting, our App is running. The application displays a native page, and the Flutter engine and Flutter page are not loaded. We will introduce these implementations in the next chapter.&lt;/p&gt;

&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://docs.flutter.cn/platform-integration/platform-channels/" rel="noopener noreferrer"&gt;Writing dual-end platform code (plug-in writing and implementation)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://gitcode.com/openharmony-sig/flutter_samples/blob/master/ohos/docs/04_development/README.md" rel="noopener noreferrer"&gt;Harmony Flutter function development&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/0xZOne/ohos-flutter-add2app" rel="noopener noreferrer"&gt;Harmony add-to-app example&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://gitcode.com/openharmony-sig/flutter_samples/blob/master/ohos/docs/04_development/%E5%A6%82%E4%BD%95%E4%BD%BF%E7%94%A8%E6%B7%B7%E5%90%88%E5%BC%80%E5%8F%91%20module.md" rel="noopener noreferrer"&gt;How to use hybrid development module&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>harmonyos</category>
      <category>flutter</category>
    </item>
    <item>
      <title>HarmonyOS Flutter Practice: 22- Detailed Explanation of Hybrid Development-2-Introduction of Har Package Mode</title>
      <dc:creator>shaohushuo</dc:creator>
      <pubDate>Fri, 13 Jun 2025 13:20:31 +0000</pubDate>
      <link>https://dev.to/shaohushuo/harmonyos-flutter-practice-22-detailed-explanation-of-hybrid-development-2-introduction-of-har-3hj</link>
      <guid>https://dev.to/shaohushuo/harmonyos-flutter-practice-22-detailed-explanation-of-hybrid-development-2-introduction-of-har-3hj</guid>
      <description>&lt;h1&gt;
  
  
  Load it into the HarmonyOS project as a Har package
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Create work
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Create a root directory
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;mkdir &lt;/span&gt;ohos_flutter_module_demo
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This directory is used to store flutter projects and Harmony projects.&lt;/p&gt;

&lt;h3&gt;
  
  
  Create a Flutter module
&lt;/h3&gt;

&lt;p&gt;First, create a Flutter module. We choose the same directory as the ohos_app project&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;flutter create &lt;span class="nt"&gt;--template&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;module my_flutter_module
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;If fvm is used, first make sure that the flutter version used in the current directory is the Harmony SDK version. For example, you can use &lt;code&gt;fvm use custom_3.22.0&lt;/code&gt; to set it, and then add fvm before the flutter command. The above command becomes &lt;code&gt;fvm flutter create --template=module my_flutter_module&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The following output appears on the command line:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;Creating project my_flutter_module...
Resolving dependencies &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="sb"&gt;`&lt;/span&gt;my_flutter_module&lt;span class="sb"&gt;`&lt;/span&gt;...
Downloading packages...
Got dependencies &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="sb"&gt;`&lt;/span&gt;my_flutter_module&lt;span class="sb"&gt;`&lt;/span&gt;&lt;span class="nb"&gt;.&lt;/span&gt;
Wrote 12 files.

All &lt;span class="k"&gt;done&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;
Your module code is &lt;span class="k"&gt;in &lt;/span&gt;my_flutter_module/lib/main.dart.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Create Flutter After the module is successfully created, the directory structure is as follows:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6k22696hzqahdmr5iih3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6k22696hzqahdmr5iih3.png" width="688" height="866"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Create a DevEco project
&lt;/h3&gt;

&lt;p&gt;Use DevEco to create a new project named ohos_app in the ohos_flutter_module_demo directory.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1v56ort2p05serxdm7vy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1v56ort2p05serxdm7vy.png" width="800" height="532"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Note that the saved directory is xxxx/ohos_flutter_module_demo/ohos_app&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;After successful creation, the entire directory structure is as follows:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fj9dtee41uzrnwfc2zoli.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fj9dtee41uzrnwfc2zoli.png" width="686" height="1470"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As you can see, we put the Flutter module at the same level as the ohos_app project. The .ohos directory is automatically created in my_flutter_module, which is also a simple Harmony project, but it will contain a module named flutter_module.&lt;/p&gt;

&lt;h2&gt;
  
  
  Package the Flutter module into a Har package
&lt;/h2&gt;

&lt;p&gt;Next, we use the &lt;code&gt;flutter build har&lt;/code&gt; command to package the Flutter module into a Har package.&lt;/p&gt;

&lt;p&gt;Before packaging, first configure the signature, open the .ohos directory with DevEco, and then sign the project. The operation is as follows:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;DevEco Studio opens the my_flutter_module/.ohos project and configures the debug signature (File -&amp;gt; Project Structure -&amp;gt; Signing Configs, check Automatically generate signature)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;flutter build har &lt;span class="nt"&gt;--debug&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The following output appears on the command line:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;Running Hvigor task assembleHar... 47.5s

Consuming the Module
1. Open &amp;lt;host project&amp;gt;/oh-package.json5
2. Add flutter_module to the dependencies list:

&lt;span class="s2"&gt;"dependencies"&lt;/span&gt;: &lt;span class="o"&gt;{&lt;/span&gt;
&lt;span class="s2"&gt;"@ohos/flutter_module"&lt;/span&gt;: &lt;span class="s2"&gt;"file:path/to/har/flutter_module.har"&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;

3. Override flutter and plugins dependencies:

&lt;span class="s2"&gt;"overrides"&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
&lt;span class="s2"&gt;"@ohos/flutter_ohos"&lt;/span&gt;: &lt;span class="s2"&gt;"file:path/to/har/flutter.har"&lt;/span&gt;,
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Observe the directory &lt;code&gt;my_flutter_module/.ohos/har&lt;/code&gt;, you can see that the Har package of the Flutter module has been generated, and two files are generated in it, namely flutter_module.har and flutter.har.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Note that the generated flutter_module.har is the default name and has nothing to do with the project name. If you want to change the generated name, you can modify the package name in the my_flutter_module/.ohos/flutter_module/oh-package.json5 file.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Introduce Har package into ohos project
&lt;/h2&gt;

&lt;p&gt;Next, we copy the generated har package to the host project ohos, and then return to the ohos project project to add the generated Har package to the dependency configuration.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Copy the Har package
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cp&lt;/span&gt; &lt;span class="nt"&gt;-r&lt;/span&gt; my_flutter_module/.ohos/har/&lt;span class="k"&gt;*&lt;/span&gt; ohos/har/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Edit the ohos_app/oh-package.json5 file:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="nl"&gt;"dependencies"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="nl"&gt;"@ohos/flutter_module"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"file:har/my_flutter_module.har"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="nl"&gt;"@ohos/flutter_ohos"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"file:har/my_flutter.har"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="err"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="s2"&gt;"overrides"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="nl"&gt;"@ohos/flutter_ohos"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"file:har/flutter.har"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;Note: If you do not want to use the method of copying the Har package, you can also directly import the original Har location through a relative path. You can use the following method to import:&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="nl"&gt;"dependencies"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="nl"&gt;"@ohos/flutter_module"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"file:../my_flutter_module/.ohos/har/flutter_module.har"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="nl"&gt;"@ohos/flutter_ohos"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"file:../my_flutter_module/.ohos/har/flutter.har"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="err"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="nl"&gt;"overrides"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="nl"&gt;"@ohos/flutter_ohos"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"file:../my_flutter_module/.ohos/har/flutter.har"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="err"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Overrides need to be configured here to solve the dependency conflict problem, because &lt;code&gt;@ohos/flutter_module&lt;/code&gt; depends on &lt;code&gt;@ohos/flutter_ohos&lt;/code&gt;, but because a relative directory is used, it will cause loading failure, so overrides are used here to re-specify the path of &lt;code&gt;@ohos/flutter_ohos&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;In addition, unlike the above tips or official documents, we also added &lt;code&gt;@ohos/flutter_ohos&lt;/code&gt; in dependencies. This is for IDE prompts. If not, the following error message will appear&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;Cannot find module &lt;span class="s1"&gt;'@ohos/flutter_ohos'&lt;/span&gt; or its corresponding &lt;span class="nb"&gt;type &lt;/span&gt;declarations. &amp;lt;ArkTSCheck&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Finally, sign the ohos project again and run the DevEco project.&lt;/p&gt;

&lt;h2&gt;
  
  
  Next
&lt;/h2&gt;

&lt;p&gt;Now we just introduce the Har package into the ohos project. In the next article &lt;a href="//./Harmony%20Flutter%20Actual%20Combat:%2022-Hybrid%20Development%20Detailed%20Explanation-4-Jump%20to%20Flutter%20Page.md"&gt;Jump to Flutter Page&lt;/a&gt;, we will introduce how to initialize the Flutter engine in the ohos native project and jump to open the Flutter page in the appropriate place.&lt;/p&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;This mode is suitable for larger project teams. A common scenario is that colleagues responsible for Flutter development develop designated modules and deliver them to the Harmony native development team in the form of Har packages.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;In this mode, the Harmony native development team does not need to pay too much attention to the Flutter content, and does not even need to install the Flutter development environment, which can better separate responsibilities.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Disadvantages: Since the Flutter module is packaged into a Har package and exists as an so file, Flutter cannot be hot-reloaded.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://gitcode.com/openharmony-sig/flutter_samples/tree/master/ohos/flutter_page_sample1" rel="noopener noreferrer"&gt;flutter_page_sample1&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://gitcode.com/openharmony-sig/flutter_samples/tree/master/ohos/flutter_page_sample2" rel="noopener noreferrer"&gt;flutter_page_sample2&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>harmonyos</category>
      <category>flutter</category>
    </item>
    <item>
      <title>HarmonyOS Flutter Practice: 21- Detailed Explanation of Hybrid Development-1-Overview</title>
      <dc:creator>shaohushuo</dc:creator>
      <pubDate>Fri, 13 Jun 2025 13:17:52 +0000</pubDate>
      <link>https://dev.to/shaohushuo/harmonyos-flutter-practice-21-detailed-explanation-of-hybrid-development-1-overview-1ne2</link>
      <guid>https://dev.to/shaohushuo/harmonyos-flutter-practice-21-detailed-explanation-of-hybrid-development-1-overview-1ne2</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;In the previous series of articles, we started with building the development environment, talked about how to use and integrate third-party plug-ins, how to transform existing projects into Harmony, and how to review them; we also took the use of Amap's HarmonyOS SDK as an example to explain how to integrate Amap into the project.&lt;/p&gt;

&lt;h2&gt;
  
  
  Hybrid Development
&lt;/h2&gt;

&lt;p&gt;In addition to using Flutter projects as the main project development, there is another common development method, namely hybrid development. The main project project is the HarmonyOS project, and the Flutter project exists in the form of a module, which is loaded into the main project project in a dependent manner, and finally realizes hybrid development.&lt;/p&gt;

&lt;p&gt;Presumably, hybrid development will not be unfamiliar, because we have also briefly introduced the two forms of hybrid development of Harmony Flutter projects.&lt;/p&gt;

&lt;p&gt;Starting from this chapter, we will go deeper and explore these two hybrid development methods based on principles and engineering practice.&lt;/p&gt;

&lt;h2&gt;
  
  
  Two ways of hybrid development
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Loading to HarmonyOS project as Har package&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;HAR (Harmony Archive) is a static shared package that can contain code, C++ libraries, resources and configuration files. HAR can be used to share ArkUI components, resources and other related codes among multiple modules or multiple projects.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkb3xwzkcl3tr44zibv9u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkb3xwzkcl3tr44zibv9u.png" width="800" height="562"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This development method is to compile and package the Flutter module into a HAR package, and introduce this module package in the native Harmony project as a Har package to achieve hybrid development.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Loading to HarmonyOS project as source code&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;From the introduction of method 1, it can be found that each update of the Flutter module needs to be recompiled into a Har package and repackaged into the native Harmony project, which is very troublesome. So there is a way of source code dependency, that is,&lt;/p&gt;

&lt;p&gt;Let the native Harmony project depend on the source code of the Flutter module, so that when the Flutter code changes, it does not need to be repackaged into a Har package, and hot updates can be implemented during the development process to refresh the interface in real time.&lt;/p&gt;

&lt;h2&gt;
  
  
  Development process
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;General directory&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;For the convenience of management/demonstration, the directory name of this example is ohos_flutter_module_demo. We create both the native Harmony project and the Flutter module in this directory.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create a native Harmony project&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This is the host project. Here we use DevEco Studio to create a native Harmony project under the ohos_flutter_module_demo directory. The project name in this article is ohos_app.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create a Flutter module&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The process is the same. We can use the following command to create a Flutter module:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;flutter create &lt;span class="nt"&gt;--template&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;module my_flutter_module
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The final project directory structure is as follows:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ohos_flutter_module_demo
├── my_flutter_module
├── ohos_app
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this way, for easy maintenance, the Flutter module is created outside the host project and is at the same level as the host project. In this article, the parent directory is ohos_flutter_module_demo, and there are two subdirectories under it, namely ohos_app (host project) and my_flutter_module (Flutter module).&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Compile Flutter module&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If you want to use the Har package mode, you need to compile the Flutter module into a Har package first; if you want to use the source code dependency method, this step is not required.&lt;/p&gt;

&lt;p&gt;Use the following command to compile the Flutter module into a Har package:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;flutter build har &lt;span class="nt"&gt;--debug&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Configure the native Harmony project&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If you use the Har package mode, you can add the Har package to the dependency file:&lt;/p&gt;

&lt;p&gt;First, copy the built Har package to the ohos Harmony project:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cp&lt;/span&gt; &lt;span class="nt"&gt;-r&lt;/span&gt; my_flutter_module/.ohos/har/&lt;span class="k"&gt;*&lt;/span&gt; ohos_app/har/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="nl"&gt;"dependencies"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="nl"&gt;"@ohos/flutter_module"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"file:har/flutter_module.har"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="nl"&gt;"@ohos/flutter_ohos"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"file:har/flutter.har"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="err"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="s2"&gt;"overrides"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="nl"&gt;"@ohos/flutter_ohos"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"file:har/flutter.har"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you use the source code mode, you need to add the source code of the Flutter module to the dependency file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="s2"&gt;"dependencies"&lt;/span&gt;: &lt;span class="o"&gt;{&lt;/span&gt;
&lt;span class="s2"&gt;"@ohos/flutter_module"&lt;/span&gt;: &lt;span class="s2"&gt;"../flutter_module"&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Modify the entry file (optional)
Modify the entry file and copy the EntryAbility.ets and Index.ets files in the .ohos directory generated by the Flutter module to the host project for replacement
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cp my_flutter_module/.ohos/entry/src/main/ets/entryability/EntryAbility.ets ohos_app/entry/src/main/ets/entryability/EntryAbility.ets
cp my_flutter_module/.ohos/entry/src/main/ets/pages/Index.ets ohos_app/entry/src/main/ets/pages/Index.ets
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>harmonyos</category>
      <category>flutter</category>
    </item>
  </channel>
</rss>
