A collection of Android libraries to build browsers or browser-like applications.
A fully-featured reference browser implementation based on the components can be found in the reference-browser repository.
We encourage you to participate in this open source project. We love pull requests, bug reports, ideas, (security) code reviews or any kind of positive contribution.
Before you attempt to make a contribution please read the Community Participation Guidelines.
List of good first issues (New contributors start here!) and List of "help wanted" issues.
Matrix: android-components:mozilla.org chat room (How to connect).
Localization happens on Pontoon. Please get in touch with delphine (at) mozilla (dot) com directly for more information.
All components are getting published on maven.mozilla.org.To use them, you need to add the following to your project's top-level build file, in the allprojects
block (see e.g. the reference-browser):
repositories {
maven {
url "https://maven.mozilla.org/maven2"
}
}
Each module that uses a component needs to specify it in its build file, in the dependencies
block. For example, to use the Base
component (in the support
) collection, you need:
dependencies {
implementation 'org.mozilla.components:support-base:+'
}
Nightly builds are created every day from the main
branch and published on nightly.maven.mozilla.org.
High-level components for building browser(-like) apps.
API contracts and abstraction layers for browser components.
Combined components to implement feature-specific use cases.
Generic low-level UI components for building apps.
Components and libraries to interact with backend services.
Supporting components with generic helper code.
src/androidTest
).
src/test
).
src/test
).
Sample apps using various components.
Browser - A simple browser composed from browser components. This sample application is only a very basic browser. For a full-featured reference browser implementation see the reference-browser repository.
Crash - An app showing the integration of the lib-crash
component.
Firefox Accounts (FxA) - A simple app demoing Firefox Accounts integration.
Firefox Sync - A simple app demoing general Firefox Sync integration, with bookmarks and history.
Firefox Sync - Logins - A simple app demoing Firefox Sync (Logins) integration.
DataProtect - An app demoing how to use the Dataprotect component to load and store encrypted data in SharedPreferences
.
Glean - An app demoing how to use the Glean library to collect and send telemetry data.
Toolbar - An app demoing multiple customized toolbars using the browser-toolbar component.
$ git clone https://github.com/mozilla-mobile/android-components.git
$ cd android-components
$ ./gradlew assemble
If the environment variable JAVA_HOME
is not defined, you will need to set it. If you would like to use the JDK installed by Android Studio, here's how to find it:
JAVA_HOME
to the location. (How you set an environment variable depends on your OS.)Once the environment variable is set, you can import the project into Android Studio with the default wizard options.
If your build fails, you may find you get more instructive error messages by attempting the build at the command line.
We follow the style enforced by ktlint and detekt. See how to configure Android Studio appropriately.
To check your style, run:
./gradlew ktlint
./gradlew detekt
We use README.md
files for each component.
If you fix a bug or change an API, you should update docs/changelog.md.
You are expected to both add tests for code that you write and make sure that your changes do notcause existing tests to fail. You may find these command lines helpful:
./gradlew test # Run all tests
./gradlew :support-ktx:testdebugunittest # Run unit tests for a specified module
See also how to measure code coverage.
If your code has user-facing changes, follow Android accessibility best practices.
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/
Android Architecture Components samples A collection of samples using the Architecture Components: Room Lifecycle-aware components ViewModels LiveData Samples The Architecture Components and these sam
安卓 Material 组件(MDC-Android)可以帮助开发人员实现 Material Design 风格,由谷歌的核心工程师团队和UX设计人员开发,是模块化且可定制的。这些组件可以建立可靠的开发工作流程,以构建美观且功能强大的安卓应用。 安卓 Material 组件可以直接替换(a drop-in replacement)安卓的设计支持库。
JNI绑定 Android上的Java资源 WebView代码组织
Native.js for Android封装一条通过JS语法直接调用Native Java接口通道,通过plus.android可调用几乎所有的系统API。 方法: currentWebview: 获取当前Webview窗口对象的native层实例对象 newObject: 创建实例对象 getAttribute: 获取对象(类对象/实例对象)的属性值 setAttribute: 设置对象(类对
Android++ 是一个免费的 Visual Studio 扩展,用于支持在 Visual Studio 上开发和调试原生的 Android 应用,主要基于 NDK 的 C/C++ 应用。同时包括可订制的发布、资源管理以及集成了 Java 源码编译。
Android(安卓)是一种基于Linux内核的自由及开放源代码的操作系统,主要使用于移动设备,如智能手机和平板电脑,由美国谷歌公司和开放手机联盟领导及开发。Android操作系统最初由Andy Rubin开发,主要支持手机。2005年8月由谷歌收购注资。2007年11月,谷歌与84家硬件制造商、软件开发商及电信营运商组建开放手机联盟共同研发改良Android系统。随后谷歌以Apache许可证的授
Android(安卓)是一种基于Linux内核的自由及开放源代码的操作系统,主要使用于移动设备,如智能手机和平板电脑,由美国谷歌公司和开放手机联盟领导及开发。Android操作系统最初由Andy Rubin开发,主要支持手机。2005年8月由谷歌收购注资。2007年11月,谷歌与84家硬件制造商、软件开发商及电信营运商组建开放手机联盟共同研发改良Android系统。随后谷歌以Apache许可证的授