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 ...
随机推荐
- JAVA设计模式之【模板方法模式】
模板方法模式 提高代码的复用性 把常用的基本方法放入父类中 强调一种流程步骤 角色 抽象类 抽象方法 具体方法 钩子方法 空方法 通过bool控制 具体类 看例子 1.银行模板类 package Te ...
- Objective-c 中如何重写父类的初始化方法
在我们的日常开发中我们经常会定义一些自己的子类继承一些UIKit 库中的类,那我们应该如何重写的这些初化方法呢?那我们先看看这些类有哪些初初化方法吧.(这里就用UIView为例) - (id)init ...
- linux 下的两种软件安装方式 —— 源码(编译、安装),编译好的二进制(直接安装)
我们以 GPG(加密工具)为例来说明两种安装方式的区别: 源码(Source code releases,名称中则会含有src等说明信息,tarball:source),先编译再安装 GPU 的源码地 ...
- linux 应用软件集合
史上最全面的Linux应用软件大集合 | 博客水木 1. 生产力 Linux 桌面的便利贴:Stickynotes sudo add-apt-repository ppa:umang/indicato ...
- [雅礼NOIP2018集训] day6
打满暴力好像是一种挑战,已经连续几天考试最后一个小时自闭了,因为自以为打完了暴力,然而,结果往往差强人意 大概是考试的策略有些问题 T1: 我们设$g[x]$为在x时取小于等于m个物品的最大价值,下面 ...
- Java多线程编程模式实战指南(三):Two-phase Termination模式--转载
本文由本人首次发布在infoq中文站上:http://www.infoq.com/cn/articles/java-multithreaded-programming-mode-two-phase-t ...
- CSS中元素各种居中方法(思维导图)
前言 用思维导图的方式简单总结一下各种元素的居中方法,如下图: 补充一下: table自带功能 100% 高度的 afrer before 加上 inline block优化 div 装成 table ...
- fastdfs+nginx的安装部署
原理图: fastdfs适用场景: fastdfs特别适合海量 中小文件(建议范围:4KB< file_size <500MB)为载体的在线服务. 安装系统介绍: CentOS6.6 安装 ...
- 如何取未知Json字符串 某个主键取对应的Value
需添加引用using Newtonsoft.Json; string strJon "Json 字符串"; JObject obj = JObject.Parse(strJon ...
- JS脚本代替人工输入
最近接到了个任务,对某个网页上的1000个item填写相同的text,text的内容相同. 这显然是机械动作呀,干脆写个工具,用脚本代替人工操作. 浏览器按F12,找到console,输入写好的脚本, ...