Android源代码叠加层如何工作? [英] How does the Android source overlays work?

查看:88
本文介绍了Android源代码叠加层如何工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

氰基mods .

In the android source in the device/sample folder there is a folder called overlays. You see the same overlay folder in e.g. the cyanogen mods.

此叠加文件夹是什么?它是如何工作的?它是干什么用的?我在哪里可以了解到更多信息?

What is this overlay folder? How does it work? What is it used for? Where can I read more about it?

预先感谢

推荐答案

例如,假设您要为设备修改Android源代码中的某些文件(例如,您想要向Launcher资源添加其他字符串).不建议修改Android的实际来源.

For instance, imagine that you want to modify some files in Android source for your device (for instance, you want to add additional string to Launcher resources). It is not recommended to modify the actual sources of Android.

您将创建覆盖来模拟Android的实际文件系统路径布局,并在其中放置更改的文件.如果在Laucher中为字符串,则创建与以下路径相对应的目录:packages/apps/Launcher2/res/values并在其中放置修改后的strings.xml

Instead of this you create overlay that mimics the actual filesystem path layout of Android and put there your changed file. In case of string in Laucher, you create directories that corresponds to the path: packages/apps/Launcher2/res/values and put there modified strings.xml

因此,当您构建设备时,此文件将被替换.

Thus, when you build your device this file will be substituted.

这篇关于Android源代码叠加层如何工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆