Commons app mirror
Find a file
2016-06-08 16:54:55 +01:00
assets-source Added new launcher icons 2013-07-18 17:27:51 +00:00
commons Move from src/main/java/main/java to src/main/java 2016-06-08 16:54:55 +01:00
design Google Play graphics 2015-10-15 17:15:40 +09:00
update-license-info Extract and show license key 2013-10-09 11:17:16 -07:00
.gitignore Update .gitignore 2016-06-02 20:21:55 +01:00
.gitreview Add .gitreview 2013-06-17 10:44:28 +00:00
CHANGELOG.md More detailed changelog 2016-06-03 11:57:49 +12:00
COPYING Relicense to Apache License 2013-04-23 21:16:43 +05:30
CREDITS Updated credits 2016-01-28 13:22:09 +13:00
disable-campaigns.patch Modified namespace so that app can be published on Google Play 2015-09-08 10:08:34 +09:00
find-broken-strings-variables.sh Implemented script to find resources syntax bugs 2016-02-18 16:16:23 +09:00
README.md Update README.md 2016-06-06 08:29:13 +01:00
RELEASE-CHECKLIST.md Update RELEASE-CHECKLIST 2013-04-27 00:58:19 +05:30
sign.sh Prepare for Google Play release 2015-09-08 10:10:04 +09:00
upload-to-commons.patch Modified namespace so that app can be published on Google Play 2015-09-08 10:08:34 +09:00

Upload to Commons

Upload pictures from your Android phone/tablet to Wikimedia Commons.

Initially started by the Wikimedia Foundation, this app is now maintained by volunteers. Anyone is welcome to improve it, just choose among the open issues and send us a pull request :-)

Use Android Studio or IntelliJ

Import and Compile Commons Android App

Download Android Studio (recommended) or IntelliJ.

  1. Clone the repository.
  2. Open Android Studio/IntelliJ. Open the project: File > Open...
    or
    (From Quick Start menu): Open an existing Android Studio project
  3. Navigate to the folder in the cloned repository (named commons). Select OK.
  4. Disable Instant Run. To do this untick the box at:
    File > Settings > Build, Execution, Deployment > Instant Run > Enable Instant Run to hot swap code/resource changes on deploy

Build Manually

Note: It is much harder to build manually. We reccomend you use Android Studio or IntelliJ IDEA, which both have gradle and all the android tools built in.

Requirements

  1. Android SDK (Level 23)
  2. Gradle

Build Instructions

  1. Set the environment variable ANDROID_HOME to be the path to your Android SDK
  2. Set the environment variable JAVA_HOME to the path to your Java SDK
  3. Run gradlew.bat assembleRelease (Windows) or ./gradlew assembleRelease (Mac / Linux) to build an unisgned apk
  4. From your Android SDK's /tools directory run adb install path/to/app.apk (Emulator) or adb -d install path/to/app.apk (USB debugging)

There are more thorough instructions on the Android Developers website

License

This software is licensed under the Apache License 2.0.

Bugs

Please report any bug on Github.

Code Structure

Key breakdowns:

Activities started within the UI:

  • ContributionsActivity (ContributionsListFragment, MediaDetailPagerFragment, MediaDetailFragment) - main "my uploads" list and detail view
  • LoginActivity - login screen when setting up an account
  • SettingsActivity - settings screen
  • AboutActivity - about screen

Activities receiving intents:

  • ShareActivity (SingleUploadFragment, CategorizationFragment) - handles receiving a file from another app, accepting a title/desc, and slating it for upload
  • MultipleShareActivity (MultipleUploadListFragment, CategorizationFragment) - handles receiving a batch of multiple files from another app, accepting a title/desc, and slating them for upload

Services:

  • WikiAccountAuthenticatorService - authentication service
  • UploadService - performs actual file uploads in background
  • ContributionsSyncService - polls for updated contributions list from server
  • ModificationsSyncService - pushes category additions up to server

Content providers:

  • ContributionsContentProvider - private storage for local copy of user's contribution list
  • ModificationsContentProvider - private storage for pending category and template modifications
  • CategoryContentProvider - private storage for recently used categories

On-Device Storage

Account credentials are encapsulated in an account provider. Currently only one Wikimedia Commons account is supported at a time. (Question: what is the actual storage for credentials?)

Preferences are stored in Android's SharedPreferences.

Information about past and pending uploads is stored in the Contributions content provider, which uses an SQLite database on the backend.

A list of recently-used categories is stored in the Categories content provider, which uses an SQLite database on the backend.

Captured files are not currently stored within the app, but are passed by content: or file: URI from other apps.

Thumbnail images are not currently cached. (?)