With the growing importance of smartphones, developers face the challenge of creating separate applications for multiple platforms (e.g., Android, iOS, and HarmonyOS), leading to increased development costs and longer iteration cycles. One potential solution is to develop an app on one platform and then automatically convert it to other platforms, reducing the need for separate development efforts. However, migrating user interfaces (UIs) between platforms is particularly challenging due to significant differences in layout structures and development paradigms, such as the disparity between XML layout files in Android and ArkUI framework in HarmonyOS. Manual conversion of UIs is time-consuming, error-prone, and inefficient, necessitating an automated solution to streamline the process and enable seamless migration from Android to HarmonyOS. To address this challenge, we propose the A2H Converter, an automated tool for migrating Android UIs to HarmonyOS. The tool employs an large language model (LLM)-driven multi-agent framework to convert Android XML layouts into HarmonyOS ArkUI layouts. Using the RAG combing with decision rules, the system maps Android UI components to ArkUI equivalents, while a reflective mechanism continuously improves conversion accuracy. A2H Converter handles project-level layouts, ensuring consistency across multiple files and addressing complex UI logic. Experiments on six Android applications collected from GitHub demonstrate that our A2H Converter achieves a migration success rate of over 90.1%, 89.3%, and 89.2% at the component, page, and project levels, respectively. The demo video is available at. The tool is available at http://124.70.54.129:37860/.
翻译:随着智能手机的重要性日益增长,开发者面临着为多个平台(例如Android、iOS和HarmonyOS)分别开发应用程序的挑战,这导致开发成本增加和迭代周期延长。一种潜在的解决方案是在一个平台上开发应用,然后自动将其转换到其他平台,从而减少单独开发的工作量。然而,由于布局结构和开发范式存在显著差异(例如Android的XML布局文件与HarmonyOS的ArkUI框架之间的差异),在不同平台间迁移用户界面(UI)尤其具有挑战性。手动转换UI耗时、易出错且效率低下,因此需要一种自动化解决方案来简化流程,实现从Android到HarmonyOS的无缝迁移。为应对这一挑战,我们提出了A2H转换器,这是一种用于将Android UI迁移到HarmonyOS的自动化工具。该工具采用基于大语言模型(LLM)驱动的多智能体框架,将Android XML布局转换为HarmonyOS ArkUI布局。系统结合检索增强生成(RAG)与决策规则,将Android UI组件映射到对应的ArkUI组件,同时通过反射机制持续提升转换准确性。A2H转换器能够处理项目级布局,确保跨多个文件的一致性并处理复杂的UI逻辑。在从GitHub收集的六个Android应用程序上进行的实验表明,我们的A2H转换器在组件、页面和项目级别的迁移成功率分别超过90.1%、89.3%和89.2%。演示视频可在以下网址获取:http://124.70.54.129:37860/。该工具可通过同一网址访问。