暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

安卓to鸿蒙:资源迁移工具

鸿蒙技术社区 2022-01-20
704

安卓项目向鸿蒙移植的过程中,大家肯定会批量修改资源文件。主要涉及 string color dimen theme 以及 drawable。


安卓的 string color dimen theme 是定义在 xml 文件中,鸿蒙则是用定义在 json 文件中。


目前还不支持安卓的 drawable 转成鸿蒙的 graphic,它们都定义在 xml 中,不过也要做相应的转换。对 python 熟悉的小伙伴可以和我一起完善。


源码如下:

https://gitee.com/andych008/x2j_py


构建


要求 Python 3.6+。


依赖:

#在工程根目录执行
python3 -m venv .venv
source .venv/bin/activate
pip install xmltodict fastapi uvicorn python-multipart


运行:

python3 web.py


浏览器打开:http://127.0.0.1:8000

技术方案


参考 1:使用 python fastapi+vue 快速搭建网站
https://www.elprup.com/2020/09/19/fastapi_vue/


参考 2:MigrateToAndroidX
https://github.com/yuweiguocn/MigrateToAndroidX


参考 3:
https://github.com/abdolence/x2js

👇扫码报名下周三的鸿蒙直播课👇

👇点击关注鸿蒙技术社区👇
了解鸿蒙一手资讯

求分享

求点赞

求在看

文章转载自鸿蒙技术社区,如果涉嫌侵权,请发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论