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 ...
随机推荐
- mvc架构的简单登录系统,jsp
文件结构 三个jsp文件负责前段界面的实现 login.jsp <%@ page language="java" import="java.util.*" ...
- 神经网络预测mnist时候如果不归一化,则准确率仅仅10%下文作者svm也遇到了。
转自:http://blog.csdn.net/jeryjeryjery/article/details/72649320 这两天用Python来实现手写数字识别,刚开始用原始数据进行训练,结果预测结 ...
- github上下载开源项目
1.首先获取到设置信息 2.找到克隆的路径(本步骤不包含下载.zip的方法) 3.打开 Git Shell ->输入: cd ../../ ->输入: cd 想要安装的路径 ->输 ...
- RXjava的简介
API 介绍和原理简析 1. 概念:扩展的观察者模式 观察者模式面向的需求是:举一个例子,警察在小偷实施作案的时候实施抓捕,在这一个例子中警察是观察者,小偷是被观察者.但是程序的观察者模式和这个还是有 ...
- Analysis of the Facebook.app for iOS
Analysis of the Facebook.app for iOS Posted Oct 18, 2016 Did you ever wonder why the Facebook.app fo ...
- sqlserver 恢复模式及避免日志爆满的方法
recovery simple 循环日志,空间自动回收,不可备份日志,恢复时仅能恢复到数据库备份时间点: 用于落地数据或测试环境或OLAP,不推荐用于生产OLTP 有时候distribution过大也 ...
- 搭建python3环境
将Python2.7通过控制面板卸载,然后从网站下载python的安装包,安装即可. 安装beatifulsoup4库.在命令行下, pip install beautifulsoup4 千万不能在p ...
- CSS3———linear-gradient() 线性渐变
线性渐变linear-gradient() 遇到了这样的css样式 body { height: 100%; background-color: #ffffff; background-image: ...
- Spring Boot基础教程》 第1节工具的安装和使用
<Spring Boot基础教程> 第1节 工具的安装和使用 Spring Boot文档 https://qbgbook.gitbooks.io/spring-boot-reference ...
- 关于__str__的介绍
在python语言里,__str__一般是格式是这样的. class A: def __str__(self): return "this is in str" 事实上,__str ...