显示RAM信息的核心代码是大蛋的,我只不过是整理下教程而已!

大蛋应该不会介意的吧,首先你需要apktool和SystemUI.apk,framework-res.apk

然后开始加载框架和反编译...

$ apktool if framework-res.apk
$ apktool d SystemUI.apk

然后把附件里的东西直接解压进去,附件点我

然后添加ID,打开res/values/public.xml,增加下面的ID

memory_info_total
memory_info_free
memory_info_buffers
memory_info_cached
memory_info_swapcached

然后也在res/values/ids.xml也加入上面的ID

最后修改smali/com/android/systemui/recent/MemoryInfoLayout.smali里的ID为你增加的对应ID即可!

接着在res/layout-land/下的Recent panel布局文件中加入以下内容

<com.android.systemui.recent.MemoryInfoLayout android:gravity="center_vertical" android:layout_gravity="bottom" android:clickable="true" android:layout_width="fill_parent" android:layout_height="30.0dip">
<View android:visibility="invisible" android:layout_width="5.0dip" android:layout_height="fill_parent" />
<ImageView android:background="#ff04ff11" android:layout_width="12.0dip" android:layout_height="12.0dip" />
<TextView android:textSize="12.0dip" android:textColor="@color/status_bar_recents_app_label_color" android:ellipsize="marquee" android:id="@id/memory_info_total" android:paddingLeft="5.0dip" android:paddingRight="5.0dip" android:layout_width="wrap_content" android:layout_height="wrap_content" />
<ImageView android:background="#ff061ef2" android:layout_width="12.0dip" android:layout_height="12.0dip" />
<TextView android:textSize="12.0dip" android:textColor="@color/status_bar_recents_app_label_color" android:ellipsize="marquee" android:id="@id/memory_info_free" android:paddingLeft="5.0dip" android:paddingRight="5.0dip" android:layout_width="wrap_content" android:layout_height="wrap_content" />
<ImageView android:background="#fff901e4" android:layout_width="12.0dip" android:layout_height="12.0dip" />
<TextView android:textSize="12.0dip" android:textColor="@color/status_bar_recents_app_label_color" android:ellipsize="marquee" android:id="@id/memory_info_buffers" android:paddingLeft="5.0dip" android:paddingRight="5.0dip" android:layout_width="wrap_content" android:layout_height="wrap_content" />
<ImageView android:background="#fffae602" android:layout_width="12.0dip" android:layout_height="12.0dip" />
<TextView android:textSize="12.0dip" android:textColor="@color/status_bar_recents_app_label_color" android:ellipsize="marquee" android:id="@id/memory_info_cached" android:paddingLeft="5.0dip" android:paddingRight="5.0dip" android:layout_width="wrap_content" android:layout_height="wrap_content" />
<ImageView android:background="#fffd1505" android:layout_width="12.0dip" android:layout_height="12.0dip" />
<TextView android:textSize="12.0dip" android:textColor="@color/status_bar_recents_app_label_color" android:ellipsize="marquee" android:id="@id/memory_info_swapcached" android:paddingLeft="5.0dip" android:layout_width="wrap_content" android:layout_height="wrap_content" />
</com.android.systemui.recent.MemoryInfoLayout>

还需要在res/layout/或者res/layout-port/里的Recent panel布局文件里加入以下内容

<com.android.systemui.recent.MemoryInfoLayout android:gravity="center_vertical" android:layout_gravity="bottom" android:clickable="true" android:layout_width="fill_parent" android:layout_height="30.0dip">
<View android:visibility="invisible" android:layout_width="5.0dip" android:layout_height="fill_parent" />
<ImageView android:background="#ff04ff11" android:layout_width="10.0dip" android:layout_height="10.0dip" />
<TextView android:textSize="10.0dip" android:textColor="@color/status_bar_recents_app_label_color" android:ellipsize="marquee" android:id="@id/memory_info_total" android:paddingLeft="5.0dip" android:paddingRight="5.0dip" android:layout_width="wrap_content" android:layout_height="wrap_content" />
<ImageView android:background="#ff061ef2" android:layout_width="10.0dip" android:layout_height="10.0dip" />
<TextView android:textSize="10.0dip" android:textColor="@color/status_bar_recents_app_label_color" android:ellipsize="marquee" android:id="@id/memory_info_free" android:paddingLeft="5.0dip" android:paddingRight="5.0dip" android:layout_width="wrap_content" android:layout_height="wrap_content" />
<TextView android:textSize="10.0dip" android:textColor="@color/status_bar_recents_app_label_color" android:ellipsize="marquee" android:id="@id/memory_info_buffers" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="wrap_content" />
<ImageView android:background="#fffae602" android:layout_width="10.0dip" android:layout_height="10.0dip" />
<TextView android:textSize="10.0dip" android:textColor="@color/status_bar_recents_app_label_color" android:ellipsize="marquee" android:id="@id/memory_info_cached" android:paddingLeft="5.0dip" android:layout_width="wrap_content" android:layout_height="wrap_content" />
<TextView android:textSize="10.0dip" android:textColor="@color/status_bar_recents_app_label_color" android:ellipsize="marquee" android:id="@id/memory_info_swapcached" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="wrap_content" />
</com.android.systemui.recent.MemoryInfoLayout>

然后重新编译并替换dex跟布局文件就好了

任务管理界面添加显示RAM信息的更多相关文章

  1. JavaBean组件<jsp:forward>动作<jsp:param>动作登录页面输入用户名和密码,然后进入检查页面判断是否符合要求,符合要求跳转到成功界面,不符合要求返回登录界面,显示错误信息。

    JavaBean组件 JavaBean组件实际是一种java类.通过封装属性和方法成为具有某种功能或者处理某个业务的对象. 特点:1.实现代码的重复利用.2.容易编写和维护.3.jsp页面调用方便. ...

  2. 为MFC界面添加一个Log Window

    前言 由于早期的图像处理程序基于VC6.0,MFC也是采用VC6.0开发的.在实际处理中,我不仅需要界面的显示,有很多时候,我需要算法处理的过程中的信息,比如每个阶段的耗时,处理的图像大小,以及如果需 ...

  3. u-boot界面添加命令[demo]

    目标板:2440 如何在u-boot界面中增加命令 在/common/目录下建立文件,调用执行函数do_bootm就行,然后在修改Makefile,就OK了. 比如在u-boot界面添加命令test ...

  4. [OpenCV Qt教程] 在Qt图形界面中显示OpenCV图像的OpenGL Widget (第一部分)

    本文译自:http://www.robot-home.it/blog/en/software/tutorial-opencv-qt-opengl-widget-per-visualizzare-imm ...

  5. Dynamics CRM 客户端程序开发:在实体的列表界面添加按钮

    关注本人微信和易信公众号: 微软动态CRM专家罗勇 ,回复114或者20140312可方便获取本文,同时可以在第一时间得到我发布的最新的博文信息,follow me! 如果没有安装Ribbon Wor ...

  6. PHP通过ini_set()来设置显示错误信息和执行时间

    PHP的 ini_set函数是设置选项中的值,在执行函数后生效,脚本结束的时候,这个设置也失效.不是所有的选项都能被改函数设置的.具体那些值能够设置,可以查看手册中的列表. 就是能够设置php.ini ...

  7. JUCE 界面库显示中文乱码问题

    JUCE 界面库显示中文乱码问题 环境: Windows7 64位 旗舰版 Visual Studio Ultimate 2012 JUCE 4.1 问题描述: 直接使用juce::String存储中 ...

  8. net发布的dll方法和类显示注释信息(字段说明信息)[图解]

    自己发布的dll添加的另一个项目中突然没有字段说明信息了,给使用带来了很多的不便,原因是为了跨项目引用,所以导致不显示注释信息的,一下是解决这个问题的方法. 在要发布(被引用)的项目上右键 => ...

  9. 在ASP.NET 5中显示错误信息

    在 ASP.NET 5 中如果不进行显示错误信息的相关配置,在发生错误时,在浏览器中只能看到空白页面. 显示错误信息的配置方法如下: 1)在 project.json 中添加对 Microsoft.A ...

随机推荐

  1. 《你不知道的JavaScript》一

    1.编译原理 尽管通常将 JavaScript 归类为"动态"或"解释执行"语言,但事实上它是一门编译语言. 在传统编译语言的流程中,程序中的一段源代码在执行之 ...

  2. (转)直接拿来用!最火的iOS开源项目(二)

    “每一次的改变总意味着新的开始.”这句话用在iOS上可谓是再合适不过的了.GitHub上的iOS开源项目数不胜数,iOS每一次的改变,总会引发iOS开源项目的演变,从iOS 1.x到如今的iOS 7, ...

  3. Office2010安装错误

    Office2010安装“错误1406.安装程序无法将值Assembly写入注册表项” 我们在安装Office2010的时候,会遇到如上所示的错误. 今天我自己在安装的过程中就遇到类似的情况.由于我原 ...

  4. Python实现顺时钟回形矩阵

    无意间在网上看到了一个面试题是,写出一个回形矩阵.实现的效果大致如下: [ 1,   2,   3,   4, 5] [16, 17, 18, 19, 6] [15, 24, 25, 20, 7] [ ...

  5. EF CRUD 操作

    1.Add 操作 public bool Add(EFDataModels.User model) { try { int result=0; using (DBEntities db = new D ...

  6. ASP.NET MVC4 学习系统四(视图)

    视图(Views)    在ASP.NET MVC框架中,想要返回给用户HTML的控制器操作,就要返回ActionResult类型的ViewResult实例,ActionResult知道如何渲染应答结 ...

  7. 重拾qt

    最近公司又接了一个煤矿的项目,要写个小程序摘取数据,我是公司唯一c++程序员,本来搞ios搞好好的,现在又得重拾半年没摸得qt了.呵呵...呵呵呵. 这里只记录这次小程序的一些小的总结吧.. 1.中文 ...

  8. 新安装的ubuntu系统如何设置中文输入法的方案

    本文是本人写的第一篇的linux博客,因为很菜,所以就把刚才自己安装中文输入法的过程给大家介绍一下,希望有所帮助. 1.首先,打开命令终端,两种方式,在Dash里面输入terminal然后enter, ...

  9. windows在远程桌面连接中使用命令行参数

    在此版本的 Windows 中,可以从搜索框("运行"对话框或命令行)启动远程桌面连接,而不是从「开始」菜单启动它. 从"运行"对话框启动远程桌面的步骤 依次单 ...

  10. css定义表格样式

    table.gridtable { font-family: verdana,arial,sans-serif; font-size:11px; color:#333333; border-width ...