GithubHelp home page GithubHelp logo

ryanfu / browser-android Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cliqz-oss/browser-android

0.0 2.0 0.0 11.29 MB

CLIQZ for Android

Home Page: https://cliqz.com/en/products/cliqz-for-android

License: Other

Java 35.72% HTML 9.81% JavaScript 45.52% CSS 6.02% Smarty 2.92%

browser-android's Introduction

Android Browser Icon

CLIQZ Browser for Android

The CLIQZ Browser for Android. Originally a fork of Anthony Restaino's Lightning Browser. We maintain two different repositories for the project: a private one for internal development (only accessible by CLIQZers) and a public one. The latter is updated every time we publish a new version and can be used to contribute to the project.

How to clone and start hacking

Run these commands in a shell:

$> # CLIQZers use the private repository
$> export [email protected]:cliqz/android-browser.git
$> # Contributors use the public one
$> export [email protected]:cliqz-oss/browser-android.git
$> git clone "${CLIQZ_REPO}" browser-android
$> cd browser-android

CLIQZers only: Remember to init the extension submodule with the following commands.

$> git submodule init $> git submodule update


You can compile the project using the the gradle wrapper on the command line:

```bash
$> ./gradlew :app:assembleStandardDebug

Please notice you have to have the Android SDK. On Mac OSX, the latter can be installed using brew:

$> brew install android

Then, some Android submodule must be installed by using the Android SDK Manager:

$> android

The minimal set of packets to build the project is:

  • Android SDK Tools (24.4.1+)
  • Android SDK Platform-tools (23.1+)
  • Android SDK Build-tools (23.0.2+)
  • SDK Platform (23+, Android 6.0)
  • Android Support Repository (25+)
  • Android Support Library (23.1.1+)

You need also to set an environment variable:

$> export ANDROID_HOME=<path_to_android>

Replace path_to_android with the correct Android installation path (i.e. /usr/local/opt/android-sdk/). Alternately, a file called local.properties can be created in the project root. It should contain a single line containing the sdk.dir variable declaration. Below, an example of the file content:

sdk.dir=/usr/local/opt/android-sdk/

Cliqzers Notes

The extension must be built. To do so, run the following commands:

$> cd <project_dir>/external/extension
$> npm install
$> bower install
$> CLIQZ_OUTPUT_PATH=build/search/ ./fern.js build \
> configs/mobile-prod.json --version=tag

Flavors

The project has two flavors:

  • Standard
  • XWalk

Standard

Compile the standard version that uses the phone WebView to render the navigation extension. It supports only devices from Android 5.0 (21) up. The flavor produce a small APK (almost 6MB).

Command examples

  • Build standard debug APK: $> ./gradlew :app:assembleStandardDebug
  • Build standard release APK: $> ./gradlew :app:assembleStandardRelease
  • Install the debug version on a single device connect using USB cable: $> ./gradlew :app:installStandardDebug

XWalk

Compile a version that uses the Crosswalk Project WebView to render the navigation extension. It supports devices starting from Android 4.0 (14) up. Due to the external WebView used, the generated APK is pretty big (more than 23MB) and architecture dependent (only ARM devices, no X86, no MIPS).

Command examples

  • Build XWalk debug APK: $> ./gradlew :app:assembleXwalkDebug
  • Build XWalk release APK: $> ./gradlew :app:assembleXwalkRelease
  • Install the debug version on a single device connect using USB cable: $> ./gradlew :app:installXwalkDebug

Testing

We have some unit tests implemented and few instrumentation tests too, although our preferred way to test the app is via UI automation.
We use Appium, mocha and wd to run our tests. They are written in Javascript and reside in the spec folder. To run them, you have to first install Node.js, then install mocha using npm:

$> npm install -g mocha

After that, you can configure the (download the tests dependencies) running the following commands:

$> cd <project_dir>/spec
$> npm install

Finally, you can run a test suite by running mocha <testfile.js> in the spec folder. IE:

$> mocha overflow_menu_tests.js

All tests can be run by using the star operator:

$> mocha *.js

We have an helper to test our application, it reside in tests_helper folder. Due to Appium limitations, this helper is downloaded from Internet at tests runtime using our CDN. The current version (v3) can be found here and can be compiled using the following command:

$> ./gradlew :tests_helper:zipDebug

The final zip file should be in <project_dir>/tests_helper/build/distribution.

Signing for distribution (CLIQZers only)

The APK must be signed to be published on PlayStore, for more information follow this link. To sign the app you need the CLIQZ keystore, however it is not and must not be distributed with the source code, also keystore passwords must be kept secret.
If you have the keystore and the passwords, you can configure gradle to generate the signed APK. To do so, create a gradle.properties file and add (or append to it fi already exists) the following lines:

Browser.storeFile=<key_store_path>
Browser.storePassword=<key_store_password>
Browser.keyAlias=<key_alias>
Browser.keyPassword=<key_password>

Replace <param> with the appropriate arguments, then you can compile the release APK using the usual gradle tasks (:app:assembleStandardRelease and :app:assembleXwalkRelease).

browser-android's People

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.