In the mobile development process, creating the user interface (UI) is highly resource intensive. Consequently, numerous studies have focused on automating UI development, such as generating UI from screenshots or design specifications. However, they heavily rely on computer vision techniques for image recognition. Any recognition errors can cause invalid UI element generation, compromising the effectiveness of these automated approaches. Moreover, developing an app UI from scratch remains a time consuming and labor intensive task. To address this challenge, we propose a novel approach called GUIMIGRATOR, which enables the cross platform migration of existing Android app UIs to iOS, thereby automatically generating UI to facilitate the reuse of existing UI. This approach not only avoids errors from screenshot recognition but also reduces the cost of developing UIs from scratch. GUIMIGRATOR extracts and parses Android UI layouts, views, and resources to construct a UI skeleton tree. GUIMIGRATOR generates the final UI code files utilizing target code templates, which are then compiled and validated in the iOS development platform, i.e., Xcode. We evaluate the effectiveness of GUIMIGRATOR on 31 Android open source applications across ten domains. The results show that GUIMIGRATOR achieves a UI similarity score of 78 between migration screenshots, outperforming two popular existing LLMs substantially. Additionally, GUIMIGRATOR demonstrates high efficiency, taking only 7.6 seconds to migrate the datasets. These findings indicate that GUIMIGRATOR effectively facilitates the reuse of Android UI code on iOS, leveraging the strengths of both platforms UI frameworks and making new contributions to cross platform development.
翻译:在移动应用开发过程中,用户界面(UI)的构建需要耗费大量资源。因此,众多研究致力于实现UI开发的自动化,例如通过屏幕截图或设计规范生成UI。然而,这些方法严重依赖计算机视觉技术进行图像识别。任何识别错误都可能导致生成无效的UI元素,从而影响自动化方法的有效性。此外,从零开始开发应用UI仍然是一项耗时费力的任务。为应对这一挑战,我们提出了一种名为GUIMIGRATOR的新方法,该方法能够将现有Android应用UI跨平台迁移至iOS,从而自动生成UI以促进现有UI的复用。该方法不仅避免了截图识别可能产生的错误,还降低了从零开发UI的成本。GUIMIGRATOR通过提取和解析Android UI布局、视图及资源来构建UI骨架树,并利用目标代码模板生成最终的UI代码文件,随后在iOS开发平台(即Xcode)中进行编译与验证。我们在涵盖十个领域的31个Android开源应用上评估了GUIMIGRATOR的有效性。结果显示,GUIMIGRATOR在迁移截图间达到了78的UI相似度得分,显著优于两种当前主流的大型语言模型。此外,GUIMIGRATOR展现出高效性,迁移整个数据集仅需7.6秒。这些结果表明,GUIMIGRATOR能有效促进Android UI代码在iOS平台上的复用,充分发挥两个平台UI框架的优势,为跨平台开发做出了新的贡献。