• Stars
    star
    2,971
  • Rank 15,235 (Top 0.4 %)
  • Language
    Kotlin
  • License
    GNU General Publi...
  • Created over 11 years ago
  • Updated 27 days ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

WordPress for Android

WordPress for Android

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 Android Studio.
  2. Install npm using Node Version Manager(nvm), as described in step one from the Block Editor Quickstart guide
  3. cd WordPress-Android to enter the working directory.
  4. cp gradle.properties-example gradle.properties to set up the sample app credentials file.
  5. In Android Studio, open the project from the local repository. This will auto-generate local.properties with the SDK location.
  6. Recommended: The CI uses JDK11 to build the app and run the tests. Some tests won't pass on the JDK embedded in Android Studio (JDK8). You might want to set JAVA_HOME and JDK location in Android Studio to JDK11.
  7. Go to Tools → AVD Manager and create an emulated device.
  8. 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.
  • While loading/building the app in Android Studio ignore the prompt to update the gradle plugin version as that will probably introduce build errors. On the other hand, feel free to update if you are planning to work on ensuring the compatibility of the newer version.

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 "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. 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. In other words, if the credentials were created with [email protected], you will only be able to login with [email protected]. Using another account like [email protected] will cause the Client cannot use "password" grant_type error.

For security reasons, some account-related actions aren't supported for development builds when using a WordPress.com account with 2-factor authentication enabled.

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

Build and Test

To build, install, and test the project from the command line:

$ ./gradlew assembleWordPressVanillaDebug                        # assemble the debug .apk
$ ./gradlew installWordPressVanillaDebug                         # install the debug .apk if you have an
                                                                 # emulator or an Android device connected
$ ./gradlew :WordPress:testWordPressVanillaDebugUnitTest         # assemble, install and run unit tests
$ ./gradlew :WordPress:connectedWordPressVanillaDebugAndroidTest # 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

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.

Contributing

Read our Contributing Guide to learn about reporting issues, contributing code, and more ways to contribute.

Security

If you happen to find a security vulnerability, we would appreciate you letting us know at https://hackerone.com/automattic and allowing us to respond before disclosing the issue publicly.

Getting in Touch

If you have questions or just want to say hi, join the WordPress Slack and drop a message on the #mobile channel.

Documentation

Please read the docs for more.

Resources

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.

More Repositories

1

WordPress-iOS

WordPress for iOS - Official repository
Swift
3,686
star
2

WordPress-Editor-iOS

⛔️ [DEPRECATED] A reusable iOS rich text editor component.
JavaScript
1,061
star
3

AztecEditor-Android

A reusable native Android rich text editor component.
Kotlin
698
star
4

AztecEditor-iOS

A reusable native iOS visual HTML text editor component.
Swift
615
star
5

PasscodeLock-Android

Android Library that provides passcode lock to your app
Java
353
star
6

gutenberg-mobile

Mobile version of Gutenberg - native iOS and Android
JavaScript
254
star
7

WordPress-Editor-Android

⛔️ [DEPRECATED] A reusable Android rich text editor component.
Java
188
star
8

MediaPicker-iOS

WPMediaPicker is an iOS controller that allows capture and picking of media assets.
Objective-C
110
star
9

wpxmlrpc

A lightweight XML-RPC encoder/decoder for iOS, OS X, and tvOS
Objective-C
88
star
10

WordPress-API-iOS

A library to connect to WordPress sites using XML-RPC or the WordPress.com REST API
Objective-C
66
star
11

WordPress-FluxC-Android

WordPress Network and Persistence layer based on the Flux architecture
Kotlin
57
star
12

MediaEditor-iOS

Easy add image editing features to your iOS app! 🖼️
Swift
49
star
13

EmailChecker

Email checking library for Android and iOS
C++
46
star
14

WordPressKit-iOS

WordPressKit offers a clean and simple WordPress.com and WordPress.org network API.
Swift
42
star
15

swift-style-guide

Swift Style Guide
35
star
16

WordPress-Utils-Android

Common utilities used by WordPress-Android.
Java
33
star
17

release-toolkit

Shared tools used in release automation
Ruby
31
star
18

react-native-aztec

Wrapping Aztec Android and Aztec iOS in a React Native component
Java
29
star
19

cocoapods-repo-update

A CocoaPods plugin that updates your specs repos on pod install if needed.
Ruby
28
star
20

WordCamp-Android

WordCamp for Android
Java
24
star
21

WordPress-WindowsPhone

WordPress for WindowsPhone
C#
20
star
22

NSObject-SafeExpectations

No more crashes getting unexpected values from a NSDictionary
Objective-C
19
star
23

MediaPicker-Android

MediaPicker is an Android Fragment that allows capture and selection of media assets from a variety of sources.
Java
19
star
24

WordPress-iOS-Shared

Shared components used in building the WordPress iOS apps and other library components
Objective-C
18
star
25

WordPressAuthenticator-iOS

Swift
17
star
26

NSURL-IDN

Support for IDN (punycode) in NSURL
Objective-C
14
star
27

WordPress-Login-Flow-Android

Pluggable WordPress login flow for Android
Java
14
star
28

objective-c-style-guide

Objective-C Style Guide
12
star
29

test-cases

Test case repository for Gutenberg editor used in the WordPress mobile app
11
star
30

WordPressCom-Stats-iOS

⛔️ [DEPRECATED] Reusable component for displaying WordPress.com site stats in an iOS application
Objective-C
10
star
31

WordPressFlux-iOS

WordPressFlux
Swift
8
star
32

WordPressCom-Analytics-iOS

⛔️ [DEPRECATED] Library for handling Analytics tracking in WPiOS
Objective-C
8
star
33

WordPress-Networking-Android

Networking library used by WordPress-Android and other WordPress-*-Android components
Java
7
star
34

PersistentEditText-Android

Android EditText subclass with persistence
Java
7
star
35

WordPressUI-iOS

Swift
7
star
36

WordPress-BlackBerry-Legacy

WordPress for BlackBerry OS 7.1 and earlier.
Java
5
star
37

release-toolkit-gutenberg-mobile

Automation Scripts for Releasing Gutenberg-Mobile Updates to the WordPress Mobile Apps.
Go
5
star
38

circleci-orbs

The source code for some CircleCI orbs published by wordpress-mobile
Shell
5
star
39

GutenbergKit

Swift
5
star
40

WordPress-Analytics-Android

⛔️ [DEPRECATED] Library for handling Analytics tracking in WordPress Android.
Java
4
star
41

cocoapods-specs

Our internal CocoaPods spec repository for Automattic's internal pods
Ruby
4
star
42

WordPress-BlackBerry

WordPress for BlackBerry 10
C++
4
star
43

EmailChecker-Android

Email checking library for Android
Kotlin
3
star
44

WordCamp-iOS

WordCamp for iOS
3
star
45

WordPress-Editor-Common

Common code of Android and iOS rich text editor component.
JavaScript
3
star
46

WordPress-Android-Libraries-Gradle-Plugin

Gradle Plugin for WordPress Android library development setup
Groovy
3
star
47

test-case-reminder-bot

GitHub bot that drops a comment to the PR about what to test when a specific file changes in gutenberg repo. Test cases and configurations live in gutenberg-tests repo.
Ruby
3
star
48

WordPress-MediaPicker-Android

Kotlin
2
star
49

editor-test-ios

Objective-C
2
star
50

docker-glotpress-linter

A docker image that lints files before they're uploaded to GlotPress
PHP
2
star
51

WordPress-Ratings-iOS

Library for handling App Ratings Logic
Objective-C
2
star
52

WordPressMocks

Network mocking for testing the WordPress mobile apps
Java
2
star
53

app-secrets-management-ios

Files related to iOS application secrets management.
Shell
2
star
54

react-native-libraries-publisher

Shell
1
star
55

WordPress-Lint-Android

Pluggable lint module for WordPress-Android
Kotlin
1
star
56

automatization-scripts

Shell
1
star
57

docker-gb-mobile-image

Dockerfile
1
star
58

gutenberg-plugin-hello-world

JavaScript
1
star
59

WordPress-HealthCheck-iOS

Health check for common iOS problems
Shell
1
star
60

app-blocking-plugins

This repository contains a list of plugins that cause problems with WordPress Apps connecting correctly.
1
star
61

Pioupiou

Micro blogging app using your WordPress site as backend.
Java
1
star
62

WordPress-HealthCheck-Common

Health-Check cross-platform test cases
HTML
1
star