Giter VIP home page Giter VIP logo

wordpress-android's Introduction

WordPress for Android

Build Status

If you're just looking to install WordPress for Android, you can find it on Google Play. If you're a developer wanting to contribute, read on.

Build Instructions

You first need to generate the local.properties (replace YOUR_SDK_DIR with your actual android SDK directory) file and create the gradle.properties file:

$ echo "sdk.dir=YOUR_SDK_DIR" > local.properties
$ cp ./WordPress/gradle.properties-example ./WordPress/gradle.properties

Note: this is the default ./WordPress/gradle.properties file. If you want to use WordPress.com features (login to a WordPress.com account, access the Reader and Stats for example), you'll have to get a WordPress.com OAuth2 ID and secret. Please read the OAuth2 Authentication section.

You can now build, install and test the project:

$ ./gradlew assembleVanillaDebug # assemble the debug .apk
$ ./gradlew installVanillaDebug  # install the debug .apk if you have an
                                 # emulator or an Android device connected
$ ./gradlew cAT                  # assemble, install and run unit tests

You can use Android Studio by importing the project as a Gradle project.

Directory structure

|-- libs                    # dependencies used to build debug variants
|-- tools                   # script collection
`-- WordPress
    |-- build.gradle        # main build script
    |-- gradle.properties   # properties imported by the build script
    `-- src                 # android specific Java code
        |-- androidTest     # test assets, resources and code
        |-- main            #
        |   |-- assets      # main project assets
        |   |-- java        # main project java code
        |   `-- res         # main project resources
        |-- vanilla         # vanilla variant specific manifest
        `-- wasabi          # wasabi variant specific resources and manifest

OAuth2 Authentication

In order to use WordPress.com functions 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 applications manager currently requires a "redirect URL", but this isn't used for mobile apps. Just use "https://localhost".

Once you've created your application in the applications manager, you'll need to edit the ./WordPress/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.

How we work

You can read more about Code Style Guidelines we adopted, and how we're organizing branches in our repository in the Contribution Guide.

Need help to build or hack?

Say hello on our Slack channel: #mobile.

FAQ

  • Q: I can't build/test/package the project because of a PermGen space error.
  • A: Create a gradle.properties file in the project root directory with the following: org.gradle.jvmargs=-XX:MaxPermSize=1024m.

License

WordPress for 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.

wordpress-android's People

Contributors

0nko avatar aagam-shah avatar aerych avatar aforcier avatar aftontroll avatar andrew659 avatar beaucollins avatar bummytime avatar daniloercoli avatar fadils avatar hypest avatar jamesjhu avatar jjoe64 avatar khaykov avatar koke avatar kwonye avatar lauszus avatar maxme avatar mjangda avatar mzorz avatar nawabhussain avatar nbradbury avatar oguzkocer avatar rishabh7m avatar roundhill avatar sendhil avatar solinger10 avatar theck13 avatar tonyr59h avatar willnorris avatar

Watchers

 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.