tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

README.md (18462B)


Android components

![chat.mozilla.org](https://chat.mozilla.org/#/room/#android-components:mozilla.org)

A collection of Android libraries to build browsers or browser-like applications.

ℹ️ For more information [see the website](https://mozac.org/).

A fully-featured reference browser implementation based on the components can be found in the reference-browser repository.

Getting Involved

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.

Maven repository

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

Nightly builds are created every day from the main branch and published on nightly.maven.mozilla.org.

Components

Browser

High-level components for building browser(-like) apps.

Concept

API contracts and abstraction layers for browser components.

Feature

Combined components to implement feature-specific use cases.

UI

Generic low-level UI components for building apps.

Compose

Compose UI components for building apps.

Service

Components and libraries to interact with backend services.

Support

Supporting components with generic helper code.

Standalone libraries

Tooling

Sample apps

Sample apps using various components.

Building #

Command line ##

$ hg clone https://hg.mozilla.org/mozilla-central/
$ cd mozilla-central/mobile/android/android-components
$ ./gradlew assemble

Android Studio ##

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:

  1. **Toolbar** - An app demoing multiple customized toolbars using the **browser-toolbar** component.
  2. **Toolbar** - An app demoing multiple customized toolbars using the **browser-toolbar** component.
  3. **Toolbar** - An app demoing multiple customized toolbars using the **browser-toolbar** component.
  4. **Toolbar** - An app demoing multiple customized toolbars using the **browser-toolbar** component.
  5. **Toolbar** - An app demoing multiple customized toolbars using the **browser-toolbar** component.

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.

Coding Standards #

Style ##

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

Documentation ##

We use README.md files for each component.

If you fix a bug or change an API, you should update docs/changelog.md.

Testing ##

You are expected to both add tests for code that you write and make sure that your changes do not cause 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.

Accessibility ##

If your code has user-facing changes, follow Android accessibility best practices.

License

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/