CitizenReporter is an easy to use Android app for citizen journalists, to help them record video / photo / audio reports from the field. Demo is available here: http://citizenreporter.codeforafrica.net/
Java HTML JavaScript PLpgSQL Python CSS Other
Pull request Compare This branch is 475 commits ahead, 13496 commits behind wordpress-mobile:develop.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.github
WordPress
cq-configs/checkstyle
gradle/wrapper
keystore
libs
tools
.gitattributes
.gitignore
.travis.yml
BUCK
CODESTYLE.md
CONTRIBUTING.md
LICENSE.md
README.md
build.gradle
gradle.properties-example
gradlew
gradlew.bat
hs_err_pid10456.log
hs_err_pid13300.log
hs_err_pid22316.log
hs_err_pid25911.log
hs_err_pid26311.log
manifest-merger-eNCA-release-report.txt
settings.gradle
setup.sh

README.md

CitizenReporter

CitizenReporter is an open source mobile app for citizen journalists, to help them record video / photo / audio reports from the field.

The app is a project of Code for Africa, and is built on Wordpress Android.

If you're simply looking to download and install CitizenReporter on your phone, go to Google Play.

If you're a developer wanting to contribute, or if you're a media organisation who wants to deploy their own customised and branded version of the app, read on.

Build Instructions

The gradle build system will fetch all dependencies and generate the files you need to build the project. 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. The easiest way is to copy our example:

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

Note: this is the default ./WordPress/gradle.properties file. If you want to use WordPress.com functions (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.

The previous command creates a libs/ directory and clones all dependencies needed by the main WordPress for Android project. 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
        `-- zbetagroup      # beta 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.

Alternative Build Instructions

WordPress-Android can be compiled with Buck, an alternative to Gradle, that makes the build process much faster. Due to current Buck limitation, you need to bootstrap the project by running the following command:

$ ./tools/fetch_buck_dependencies.py extlibs

This command will fetch all dependencies (.aar and .jar) needed to build the project. Then you can run buck to build the apk:

$ buck build wpandroid

You can build, install and run the project if you have a device or an emulator connected by running the following:

$ buck install --run wpandroid

It's recommended to install watchman to take advantage of the Buck daemon: buckd.

FAQ

  • Q: I can't build/test/package the project because of a PermGen space error.
  • A: Create a build.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.