Skip to content

Commit 0451819

Browse files
committed
Update README.md for gradle
1 parent a4bcfc9 commit 0451819

File tree

1 file changed

+31
-58
lines changed

1 file changed

+31
-58
lines changed

README.md

+31-58
Original file line numberDiff line numberDiff line change
@@ -4,71 +4,44 @@ Upload pictures from your Android phone/tablet to Wikimedia Commons.
44

55
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 :-)
66

7-
## Build Requirements ##
7+
## Use Android Studio or IntelliJ ##
88

9-
1. [Android SDK][1] (Level 23)
10-
2. [Maven][2]
9+
### Import and Compile Commons Android App ##
1110

12-
## Build Instructions ##
11+
[Download Android Studio][1] (recommended) or [IntelliJ][2].
1312

14-
1. Set the environment variable `ANDROID_HOME` to be the path to your Android SDK
15-
2. Run `mvn install` to build
16-
3. Run `cd commons && mvn android:deploy` to deploy to a device
13+
1. Clone the repository.
14+
2. Open Android Studio/IntelliJ. Open the project:
15+
``File`` > ``Open...``
16+
or
17+
(From Quick Start menu): ``Open an existing Android Studio project``
18+
3. Navigate to the folder in the cloned repository (named commons). Select ``OK``.
1719

18-
**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.
20+
## Build Manually ##
1921

20-
## Set Up IntelliJ or Android Studio for Commons Android App Development ##
22+
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.
2123

22-
### Import and Compile Commons Android App ##
24+
### Requirements ###
2325

24-
[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)
26+
1. [Android SDK][3] (Level 23)
27+
2. [Gradle][4]
2528

26-
1. Clone the repository.
27-
2. Open IntelliJ/Android Studio. Tick the box for the Maven Integration plugin by selecting:
28-
``File`` > ``Settings`` > ``Plugins`` > ``Maven Integration``
29-
or
30-
(From Quick Start menu): ``Configure`` > ``Plugins`` > ``Maven Integration``
31-
3. Import Project:
32-
``File`` > ``Import Project``
33-
or
34-
(From Quick Start menu): ``Import Project (Eclipse ADT, Gradle, etc.)``
35-
4. Navigate to the folder with the cloned repository (named apps-android-commons). Select ``OK``.
36-
5. Select ``Import Project from external model`` > ``Maven``. Select ``Next``.
37-
6. Tick the boxes ``Search for projects recursively`` and ``Import Maven projects automatically``. Select ``Next``.
38-
7. Select ``Next``.
39-
8. Select ``Next``.
40-
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.
41-
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.
42-
Select ``Next``.
43-
10. Select ``Next``.
44-
11. Select ``Finish``.
45-
12. Set the Module SDKs.
46-
Select the ``Dependencies`` tab on the right pane.
47-
Set the modules as follows:
48-
49-
| Name | Module SDK |
50-
|-------------------------------------------------------|---------------------------------------|
51-
| commons | Project SDK (Android API 23 Platform) |
52-
| commons-parent | Project SDK (Android API 23 Platform) |
53-
| ~apklib-com.actionbarsherlock_actionbarsherlock_4.4.0 | Maven Android API 14 Platform |
54-
| ~apklib-com.viewpagerindicator_library_2.4.1 | Maven Android API 16 Platform |
55-
56-
If certain modules are not available, install the correct API levels through the SDK manager. To do this do the following:
57-
58-
* Click ``Cancel``. Navigate to ``File`` > ``Settings`` > ``Appearance & Behaviour`` > ``System Settings`` > ``Android SDK``.
59-
* Tick the boxes for API levels ``14``, ``16``, and ``23`` (or Android ``4.0``, ``4.1.2`` and ``6.0``).
60-
* 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.
61-
13. Select ``commons``. Click the green ``+`` button on the right. Select ``JARs or directories...``. Choose the ``apps-android-commons/lib`` folder. Select ``OK``.
62-
14. Select ``OK`` to save your changes to the project structre settings.
63-
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!
29+
### Build Instructions ###
30+
31+
1. Set the environment variable `ANDROID_HOME` to be the path to your Android SDK
32+
2. Set the environment variable `JAVA_HOME` to the path to your Java SDK
33+
3. Run `gradlew.bat assembleRelease` (Windows) or `./gradlew assembleRelease` (Mac / Linux) to build an unisgned apk
34+
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)
35+
36+
There are more thorough instructions on the [Android Developers website][5]
6437

6538
## License ##
6639

67-
This software is licensed under the [Apache License][5].
40+
This software is licensed under the [Apache License 2.0][6].
6841

6942
## Bugs ##
7043

71-
Please report any bug [on Github][3].
44+
Please report any bug [on Github][7].
7245

7346
## Code Structure ##
7447

@@ -111,10 +84,10 @@ Captured files are not currently stored within the app, but are passed by conten
11184
Thumbnail images are not currently cached. (?)
11285

11386

114-
[1]: https://developer.android.com/sdk/index.html
115-
[2]: https://maven.apache.org/
116-
[3]: https://github.com/nicolas-raoul/apps-android-commons/issues
117-
[4]: http://search.maven.org/
118-
[5]: https://www.apache.org/licenses/LICENSE-2.0
119-
[6]: http://www.jetbrains.com/idea/download/index.html
120-
[7]: https://sites.google.com/a/android.com/tools/download/studio/builds/1-5-2
87+
[1]: https://developer.android.com/studio/index.html
88+
[2]: http://www.jetbrains.com/idea/download/index.html
89+
[3]: https://developer.android.com/sdk/index.html
90+
[4]: http://gradle.org/gradle-download/
91+
[5]: https://developer.android.com/studio/build/building-cmdline.html
92+
[6]: https://www.apache.org/licenses/LICENSE-2.0
93+
[7]: https://github.com/nicolas-raoul/apps-android-commons/issues

0 commit comments

Comments
 (0)