Android chromium 1
Java Resources on Android
OverviewChrome for Android uses certain resources in Java code (e.g. Android layouts and associated strings or images). These resources are stored according to Android's resource directory structure within a Java root folder.
Java code can reference these resources in the normal way using a generated R class, being sure to qualify it with the correct package name.
// Use a resource from content setImageResource( org.chromium.content.R.drawable.globe_favicon); // Use a resource from chrome
setContentView( org.chromium.chrome.R.layout.month_picker ); How resources are packagedWhile compiling the Java code in content, an R.java file is generated based on the Java resources in content. This R.java contains non-final constants and is used only while compiling content (and any non-APK target that depends on content) but is not included in the content jar.
When building an APK target, such as content_shell_apk, resources are merged from content, any other dependencies, and from content shell itself. These merged resources are processed and included in the APK. Based on these resources, a new R.java is generated with the correct resource -> ID mappings. This R.java is copied into the R packages needed by each dependency (e.g. org.chromium.content.R and org.chromium.content_shell.R), and all these copies are included in the APK.
This process closely follows Android's handling of resources in library projects, where content and chrome are the "libraries", though we don't use the SDK to compile our "libraries". Hence some of the same caveats apply. In particular, two resources with the same ID cannot coexist. The resource highest in the dependency chain (e.g. in content shell) will override the others (e.g. in content).
Supporting resources in gypTo add resources to another Java root folder, add the variables has_java_resources, R_package, and R_package_relpath to the gyp target that builds that Java code. For example:
{ 'target_name': 'content_java', 'type': 'none', 'dependencies': [ ... ], 'variables': { 'package_name': 'content', 'java_in_dir': '../content/public/android/java', # Support Java resources in content 'has_java_resources': 1, 'R_package': 'org.chromium.content', 'R_package_relpath': 'org/chromium/content', }, 'includes': [ '../build/java.gypi' ], }, |
Android chromium 1的更多相关文章
- Android Chromium WebView学习启动篇
Android从4.4起提供基于Chromium实现的WebView.此前WebView基于WebKit实现.WebKit提供网页解析.布局和绘制以及JS执行等基础功能.Chromium在WebKit ...
- Android chromium 2
Overview JNI (Java Native Interface) is the mechanism that enables Java code to call native function ...
- 35 Top Open Source Companies
https://www.datamation.com/open-source/35-top-open-source-companies-1.html If you think of open sour ...
- DevTools 实现原理与性能分析实战
一.引言 从 2008 年 Google 释放出第一版的 Chrome 后,整个 Web 开发领域仿佛被注入了一股新鲜血液,渐渐打破了 IE 一家独大的时代.Chrome 和 Firefox 是 W3 ...
- Ubuntu下编译Chromium for Android
转自:http://blog.csdn.net/fsz521/article/details/18036835 下源码git clone https://chromium.googlesource.c ...
- 理解WebKit和Chromium: 调试Android系统上的Chromium
转载请注明原文地址:http://blog.csdn.net/milado_nju 1. Android上的调试技术 在Android系统上,开发人员能够使用两种不同的语言来开发应用程序,一种是Jav ...
- chromium for android v34 2dcanvas硬件渲染实现分析
这篇接着上一篇2dcanvas硬件绘制,分析保存绘制结果的texture被合成到on screen framebuffer上的过程. 1.webkit为canvas元素相应的render树节点Rend ...
- Chromium on Android: Android在系统Chromium为了实现主消息循环分析
总结:刚开始接触一个Chromium on Android时间.很好奇Chromium主消息循环是如何整合Android应用. 为Android计划,一旦启动,主线程将具有Java消息层循环处理系统事 ...
- 理解WebKit和Chromium: Android 4.4 上的Chromium WebView
转载请注明原文地址:http://blog.csdn.net/milado_nju ## 概述 相信读者已经注意到了,在最新的Android 4.4 Kitkat版本中,原本基于Android Web ...
随机推荐
- zzuoj--10424--无聊的课(简单几何)
10424: 无聊的课 Time Limit: 1 Sec Memory Limit: 128 MB Submit: 81 Solved: 16 [Submit][Status][Web Boar ...
- Python入门机器学习
如何通过Python入门机器学习 我们都知道机器学习是一门综合性极强的研究课题,对数学知识要求很高.因此,对于非学术研究专业的程序员,如果希望能入门机器学习,最好的方向还是从实践触发. 我了解到Pyt ...
- javascript系列-Class1.JavaScript基础
欢迎加入前端交流群来py:749539640 转载请标明出处! JavaScript概述 一个页面分成三个部分,结构,样式,行为. HTML代表了页面的结 ...
- BZOJ 1283 费用流
思路: 最大费用最大流 i->i+1 连边k 费用0 i->i+m (大于n的时候就连到汇) 连边1 费用a[i] //By SiriusRen #include <queue> ...
- python 3.x 学习笔记12 (反射 and 异常)
1.反射通过字符串映射或修改程序运行时的状态.属性.方法 getattr(obj,name_str): 根据字符串name_str去获取obj对象里的对应的方法的内存地址 hasttr(obj,na ...
- Oracle数据库to_date函数注意事项
使用PL/SQL连接到Oracle数据库服务器,执行一条update语句: update pjnl set transtime = to_date('2015-05-14 12:13:20','yyy ...
- Android TextView加下划线的几种方式
如果是在资源文件里: <resources> <</u></string> <string name="app_name">M ...
- cmd 与 网卡(netsh 命令)
1. 通过命令提示符(cmd)命令连接 Wi-Fi 1.1 连接曾经连接过的 Wi-Fi :: 查看配置的列表(::表示注释) netsh wlan show profile :: 连接 netsh ...
- Swift 4.0:访问级别(访问控制)
基础篇 注: 下文中所提及的类和类型为Class, Enum和Struct Swift中的访问级别有以下五种: open: 公开权限, 最高的权限, 可以被其他模块访问, 继承及复写. public: ...
- json转换成Map
1.如果转换的是Map.或者是简单的对象 package com.gc.action; import java.util.Map; import net.sf.json.JSONObject; /** ...