Git Product home page Git Product logo

woocommerce-android's Introduction

woocommerce-android

CircleCI

Jetpack-powered WooCommerce Android app codenamed Dervish.

Build Instructions

(Make sure you've installed JDK 8 and Android Studio.)

You first need to generate the gradle.properties file:

$ cp ./gradle.properties-example ./gradle.properties

Next, you'll have to get a WordPress.com OAuth2 ID and secret, for use in the gradle.properties file. Please read the OAuth2 Authentication section.

In Android Studio, don't accept any offers to upgrade the gradle plugin - this project does not support Gradle plugin 3 yet.

Running Tests

$ ./gradlew testVanillaDebug                     # Unit tests
$ ./gradlew connectedVanillaDebugAndroidTest     # UI tests

Setting up Checkstyle

The woocommerce-android project uses Checkstyle. You can run checkstyle using ./gradlew checkstyle. You can also view errors and warnings in realtime with the Checkstyle plugin. When importing the project into Android Studio, Checkstyle should be set up automatically. If it is not, follow the steps below.

You can install the CheckStyle-IDEA plugin in Android Studio here:

Android Studio > Preferences... > Plugins > CheckStyle-IDEA

Once installed, you can configure the plugin here:

Android Studio > Preferences... > Other Settings > Checkstyle

From there, add and enable the configuration file for woocommerce-android, located at config/checkstyle.xml.

Using ktlint

The woocommerce-android project uses ktlint for Kotlin linting. You can run ktlint using ./gradlew ktlint, and you can also run ./gradlew ktlintFormat for auto-formatting. There is no IDEA plugin (like Checkstyle's) at this time.

OAuth2 Authentication

You will need a client ID and a client secret key. These details will be used to authenticate your application and verify that the API calls being made are valid. You can create an application or view details for your existing applications with our WordPress.com applications manager.

When creating your application, you should select "Native client" for the application type. The "Website URL", "Redirect URLs", and "Javascript Origins" fields are required but not used for the mobile apps. Just use "https://localhost".

Once you've created your application in the applications manager, you'll need to edit the ./gradle.properties file and change the wp.oauth.app_id and wp.oauth.app_secret fields. Then you can compile and run the app on a device or an emulator and try to login with a WordPress.com account.

Read more about OAuth2 and the WordPress.com REST endpoint.

Google Configuration

Google Sign-In is only available for WordPress.com accounts through the official app. Contributors can build and run the app without issue, but Google Sign-In will always fail. Google Sign-In requires configuration files which contain client and server information that can't be shared publicly. More documentation and guides can be found on the Google Identity Platform website.

Need help?

Usage docs can be found here: docs.woocommerce.com

General usage and development questions:

License

woocommerce-android is an Open Source project covered by the GNU General Public License version 2. Note: code in the libs/ directory comes from external libraries, which might be covered by a different license compatible with the GPLv2.

woocommerce-android's People

Contributors

nbradbury avatar amandariu avatar aforcier avatar anitaa1990 avatar jkmassel avatar loremattei avatar jtreanor avatar theck13 avatar astralbodies avatar 0nko avatar oguzkocer avatar develric avatar akirk avatar

Watchers

James Cloos 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.