WordPress for Android
Branch: develop
Clone or download
mzorz Merge pull request #9234 from wordpress-mobile/gutenberg/9034-informa…
…tive-dialog

Gutenberg informative Dialog
Latest commit be61cc7 Feb 18, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.bundle Pin the fastlane version Nov 1, 2018
.circleci CircleCI: Use Orb for caching and storing test results Feb 14, 2019
.github Add RELEASE-NOTES.txt file to encourage adding release notes iteratively Dec 6, 2018
.idea Remove vcs.xml from git because it's still being tracked Feb 5, 2019
WordPress Introduce UNDEFINED_RES_ID and use it instead of the "-1" hard coded … Feb 18, 2019
config Fix checkstyle issues Oct 31, 2018
fastlane Code Freeze: Use release branch instead of tag for get PR list Jan 25, 2019
gradle/wrapper Update to Gradle 4.10.3/Android Gradle plugin 3.2.1 Jan 23, 2019
keystore first BUCK integration Apr 13, 2015
libs Merge pull request #9229 from wordpress-mobile/issue/9228-post-list-m… Feb 15, 2019
tools build-apk-core: Only lint the flavour that is being built Jan 17, 2019
.configure Update .configure Jan 25, 2019
.editorconfig Squashed 'libs/login/' changes from 0f85054215..3d1d5e57f6 Apr 17, 2018
.gitattributes Change merge method for RELEASE-NOTES.txt Jan 17, 2019
.gitignore Stop ignoring the GB JS bundle. File shouldn't exist. Jan 31, 2019
.gitmodules Able to load the RN view and reach the Metro server Oct 31, 2018
.ruby-version Add a .ruby-version file Feb 11, 2019
CODE-OF-CONDUCT.md Updated Code of Conduct with contact information Feb 10, 2017
CODESTYLE.md initial commit of CODESTYLE.md Jun 23, 2014
CONTRIBUTING.md Remove redundant text from drawable resources section of contributing… Nov 27, 2018
Dangerfile Add a danger rule to prevent missed release notes Feb 11, 2019
Gemfile Merge develop into release-tooling branch Nov 8, 2018
Gemfile.lock Update to release-toolkit v0.1.6 Jan 24, 2019
LICENSE.md Squashed 'libs/login/' changes from 1f2c781..6a9f1d3 Oct 17, 2017
README.md Remove TravisCI (now replaced with CircleCI) Feb 4, 2019
RELEASE-NOTES.txt Updated release notes. Feb 12, 2019
build.gradle Updated flux-c reference Feb 12, 2019
gradle.properties-example Add the first iteration of Giphy Picker Nov 23, 2018
gradlew Squashed 'libs/utils/' changes from 6f09341..452a7a9 Apr 7, 2017
gradlew.bat Squashed 'libs/utils/' changes from 6f09341..452a7a9 Apr 7, 2017
settings.gradle convert wp.BUILD_GUTENBERG_FROM_SOURCE from gradle.properties into bo… Jan 7, 2019

README.md

WordPress for Android

CircleCI

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

  1. Make sure you've installed JDK 8 and Android Studio, a Standard Setup would work.
  2. Clone this GitHub repository.
  3. Copy gradle.properties-example to gradle.properties.
  4. In Android Studio open the project from the local repository as a Gradle project (this will auto-generate local.properties with the SDK location).
  5. Make sure you have an emulation device setup in AVD Manager (Tools → Android → AVD Manager).
  6. Run.

Notes:

  • To use WordPress.com features (login to WordPress.com, access Reader and Stats, etc) you need a WordPress.com OAuth2 ID and secret. Please read the OAuth2 Authentication section.

Once installed, you can now build, install and test the project from the command line:

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

Directory structure

.
├── libs                    # dependencies used to build debug variants
├── tools                   # script collection
├── gradle.properties       # properties imported by the build script
├── WordPress
│   |-- build.gradle        # main build script
│   └── src
│       ├── androidTest     # Android test assets, resources and code
│       ├── test            # Unit tests
│       ├── main
│       │   ├── assets      # main project assets
│       │   ├── java        # main project java code
│       │   └── res         # main project resources
│       ├── debug           # debug variant
│       └── 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 ./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. Note that authenticating to WordPress.com via Google is not supported in development builds of the app, only in the official release.

Note that credentials created with our WordPress.com applications manager allow login only and not signup. New accounts must be created using the official app or on the web. Login is restricted to the WordPress.com account with which the credentials were created. Also, you will be able to interact with sites of that same WordPress.com account only. In other words, if the credentials were created with foo@email.com, you will only be able to login with foo@email.com and access foo@email.com sites. Using another account like bar@email.com will cause the Client cannot use "password" grant_type error.

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.

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.