mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 20:33:53 +01:00
Update README.md for gradle
This commit is contained in:
parent
a4bcfc93f8
commit
0451819e49
1 changed files with 31 additions and 58 deletions
87
README.md
87
README.md
|
|
@ -4,71 +4,44 @@ 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](https://github.com/nicolas-raoul/apps-android-commons/issues) and send us a pull request :-)
|
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](https://github.com/nicolas-raoul/apps-android-commons/issues) and send us a pull request :-)
|
||||||
|
|
||||||
## Build Requirements ##
|
## Use Android Studio or IntelliJ ##
|
||||||
|
|
||||||
1. [Android SDK][1] (Level 23)
|
|
||||||
2. [Maven][2]
|
|
||||||
|
|
||||||
## Build Instructions ##
|
|
||||||
|
|
||||||
1. Set the environment variable `ANDROID_HOME` to be the path to your Android SDK
|
|
||||||
2. Run `mvn install` to build
|
|
||||||
3. Run `cd commons && mvn android:deploy` to deploy to a device
|
|
||||||
|
|
||||||
**Note**: Currently uses a bunch of dependencies that are staged at `yuvi.in/blog/maven`. Will be migrated to either [Maven Central][4] or a Wikimedia staging server soon.
|
|
||||||
|
|
||||||
## Set Up IntelliJ or Android Studio for Commons Android App Development ##
|
|
||||||
|
|
||||||
### Import and Compile Commons Android App ##
|
### Import and Compile Commons Android App ##
|
||||||
|
|
||||||
[Download IntelliJ][6] or [Download Android Studio 1.5.2][7]. (Note: The steps below currently only work on Android Studio 1.5.2 and below)
|
[Download Android Studio][1] (recommended) or [IntelliJ][2].
|
||||||
|
|
||||||
1. Clone the repository.
|
1. Clone the repository.
|
||||||
2. Open IntelliJ/Android Studio. Tick the box for the Maven Integration plugin by selecting:
|
2. Open Android Studio/IntelliJ. Open the project:
|
||||||
``File`` > ``Settings`` > ``Plugins`` > ``Maven Integration``
|
``File`` > ``Open...``
|
||||||
or
|
or
|
||||||
(From Quick Start menu): ``Configure`` > ``Plugins`` > ``Maven Integration``
|
(From Quick Start menu): ``Open an existing Android Studio project``
|
||||||
3. Import Project:
|
3. Navigate to the folder in the cloned repository (named commons). Select ``OK``.
|
||||||
``File`` > ``Import Project``
|
|
||||||
or
|
|
||||||
(From Quick Start menu): ``Import Project (Eclipse ADT, Gradle, etc.)``
|
|
||||||
4. Navigate to the folder with the cloned repository (named apps-android-commons). Select ``OK``.
|
|
||||||
5. Select ``Import Project from external model`` > ``Maven``. Select ``Next``.
|
|
||||||
6. Tick the boxes ``Search for projects recursively`` and ``Import Maven projects automatically``. Select ``Next``.
|
|
||||||
7. Select ``Next``.
|
|
||||||
8. Select ``Next``.
|
|
||||||
9. Click ``Maven Android API 23 Platform`` or ``Android API 23 Platform`` in the sidebar. Make sure the ``Android SDK home path`` points to the ``/Android/Sdk`` folder. Make sure the ``Java SDK`` is set to 1.8 or higher.
|
|
||||||
If there are no options for the ``Java SDK``, click the ``+`` button above the sidebar and select 'JDK'. Navigate to your JDK folder, select it, and hit ``OK``, and then select the newly added JDK.
|
|
||||||
Select ``Next``.
|
|
||||||
10. Select ``Next``.
|
|
||||||
11. Select ``Finish``.
|
|
||||||
12. Set the Module SDKs.
|
|
||||||
Select the ``Dependencies`` tab on the right pane.
|
|
||||||
Set the modules as follows:
|
|
||||||
|
|
||||||
| Name | Module SDK |
|
## Build Manually ##
|
||||||
|-------------------------------------------------------|---------------------------------------|
|
|
||||||
| commons | Project SDK (Android API 23 Platform) |
|
|
||||||
| commons-parent | Project SDK (Android API 23 Platform) |
|
|
||||||
| ~apklib-com.actionbarsherlock_actionbarsherlock_4.4.0 | Maven Android API 14 Platform |
|
|
||||||
| ~apklib-com.viewpagerindicator_library_2.4.1 | Maven Android API 16 Platform |
|
|
||||||
|
|
||||||
If certain modules are not available, install the correct API levels through the SDK manager. To do this do the following:
|
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.
|
||||||
|
|
||||||
* Click ``Cancel``. Navigate to ``File`` > ``Settings`` > ``Appearance & Behaviour`` > ``System Settings`` > ``Android SDK``.
|
### Requirements ###
|
||||||
* Tick the boxes for API levels ``14``, ``16``, and ``23`` (or Android ``4.0``, ``4.1.2`` and ``6.0``).
|
|
||||||
* Then click ``OK``, and allow it to download the new APIs. Once it has finished, click ``File`` > ``Project Structure`` > ``Project Settings`` > ``Modules``, and repeat step 15.
|
1. [Android SDK][3] (Level 23)
|
||||||
13. Select ``commons``. Click the green ``+`` button on the right. Select ``JARs or directories...``. Choose the ``apps-android-commons/lib`` folder. Select ``OK``.
|
2. [Gradle][4]
|
||||||
14. Select ``OK`` to save your changes to the project structre settings.
|
|
||||||
15. To test it worked, check if it builds (Select ``commons`` on the projects panel. Select ``Build`` > ``Make Module 'commons'``). If there are no errors (warnings are OK) you're set!
|
### 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][5]
|
||||||
|
|
||||||
## License ##
|
## License ##
|
||||||
|
|
||||||
This software is licensed under the [Apache License][5].
|
This software is licensed under the [Apache License 2.0][6].
|
||||||
|
|
||||||
## Bugs ##
|
## Bugs ##
|
||||||
|
|
||||||
Please report any bug [on Github][3].
|
Please report any bug [on Github][7].
|
||||||
|
|
||||||
## Code Structure ##
|
## Code Structure ##
|
||||||
|
|
||||||
|
|
@ -111,10 +84,10 @@ Captured files are not currently stored within the app, but are passed by conten
|
||||||
Thumbnail images are not currently cached. (?)
|
Thumbnail images are not currently cached. (?)
|
||||||
|
|
||||||
|
|
||||||
[1]: https://developer.android.com/sdk/index.html
|
[1]: https://developer.android.com/studio/index.html
|
||||||
[2]: https://maven.apache.org/
|
[2]: http://www.jetbrains.com/idea/download/index.html
|
||||||
[3]: https://github.com/nicolas-raoul/apps-android-commons/issues
|
[3]: https://developer.android.com/sdk/index.html
|
||||||
[4]: http://search.maven.org/
|
[4]: http://gradle.org/gradle-download/
|
||||||
[5]: https://www.apache.org/licenses/LICENSE-2.0
|
[5]: https://developer.android.com/studio/build/building-cmdline.html
|
||||||
[6]: http://www.jetbrains.com/idea/download/index.html
|
[6]: https://www.apache.org/licenses/LICENSE-2.0
|
||||||
[7]: https://sites.google.com/a/android.com/tools/download/studio/builds/1-5-2
|
[7]: https://github.com/nicolas-raoul/apps-android-commons/issues
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue