Skip to content

Commit d7bf860

Browse files
committed
Bug: 474722 - Migrate Android Service Project to Android Studio / Gradle
Migrated Android Service to Gradle / Android Studio. Signed-off-by: James Sutton <james.sutton@uk.ibm.com>
1 parent 20327f4 commit d7bf860

143 files changed

Lines changed: 4852 additions & 5095 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,17 @@
11
#Android Service Client
22

3-
#Generate JavaDoc
4-
1. Switch directory to ```cd org.eclipse.paho.android.service```
5-
2. ```android update -p .```
6-
3. Build Android project ```ant debug```
7-
4. Documentation is in ```out\docs```
3+
The Android MQTT Service Project has been restructured to work in Android Studio and use the Gradle Build system.
84

5+
To get started, download [Android Studio](http://developer.android.com/tools/studio/index.html). You will also need to download the [Android SDK](https://developer.android.com/sdk/installing/adding-packages.html). Currently you will need the SDK for 19,21 and 22, This will hopefully be simplified soon.
6+
7+
## Running the Sample App:
8+
9+
* Open the this current directory in Android Studio (org.eclipse.paho.android.service).
10+
* In the toolbar along the top, there should be a dropdown menu. Make sure that it contains 'org.eclipse.android.sample' then click the Green 'Run' Triangle. It should now build and launch an Virtual Android Device to run the App. If you have an Android device with developer mode turned on plugged in, you will have the oppertunity to run it directly on that.
11+
* If you have any problems, check out the Android Developer Documentation for help: https://developer.android.com
12+
13+
## Building the service locally
14+
* Open a terminal and navigate to this directory (org.eclipse.paho.android.service)
15+
* Run the command ```./gradlew clean assemble exportJar``` or on Windows: ```gradlew.bat clean assemble exportJar```
16+
17+
Once it completes successfully, the service jar will be located in org.eclipse.paho.android/org.eclipse.paho.android.service/release
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// Top-level build file where you can add configuration options common to all sub-projects/modules.
2+
3+
buildscript {
4+
repositories {
5+
jcenter()
6+
}
7+
dependencies {
8+
classpath 'com.android.tools.build:gradle:1.2.3'
9+
// NOTE: Do not place your application dependencies here; they belong
10+
// in the individual module build.gradle files
11+
}
12+
}
13+
14+
allprojects {
15+
repositories {
16+
jcenter()
17+
}
18+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Project-wide Gradle settings.
2+
3+
# IDE (e.g. Android Studio) users:
4+
# Gradle settings configured through the IDE *will override*
5+
# any settings specified in this file.
6+
7+
# For more details on how to configure your build environment visit
8+
# http://www.gradle.org/docs/current/userguide/build_environment.html
9+
10+
# Specifies the JVM arguments used for the daemon process.
11+
# The setting is particularly useful for tweaking memory settings.
12+
# Default value: -Xmx10248m -XX:MaxPermSize=256m
13+
# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
14+
15+
# When configured, Gradle will run in incubating parallel mode.
16+
# This option should only be used with decoupled projects. More details, visit
17+
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
18+
# org.gradle.parallel=true

org.eclipse.paho.android.service/gradlew

Lines changed: 164 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

org.eclipse.paho.android.service/gradlew.bat

Lines changed: 90 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<module external.linked.project.id="org.eclipse.paho.android" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" external.system.module.group="" external.system.module.version="unspecified" type="JAVA_MODULE" version="4">
3+
<component name="FacetManager">
4+
<facet type="java-gradle" name="Java-Gradle">
5+
<configuration>
6+
<option name="BUILD_FOLDER_PATH" value="$MODULE_DIR$/build" />
7+
<option name="BUILDABLE" value="false" />
8+
</configuration>
9+
</facet>
10+
</component>
11+
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_6" inherit-compiler-output="true">
12+
<exclude-output />
13+
<content url="file://$MODULE_DIR$">
14+
<excludeFolder url="file://$MODULE_DIR$/.gradle" />
15+
</content>
16+
<orderEntry type="inheritedJdk" />
17+
<orderEntry type="sourceFolder" forTests="false" />
18+
</component>
19+
</module>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
apply plugin: 'com.android.application'
2+
3+
android {
4+
compileSdkVersion 21
5+
buildToolsVersion '21.1.2'
6+
7+
defaultConfig {
8+
// min and target SDK is not set in Gradle to use the version defined in the android manifest
9+
}
10+
buildTypes {
11+
release {
12+
minifyEnabled false
13+
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
14+
}
15+
}
16+
17+
lintOptions {
18+
abortOnError false
19+
}
20+
}
21+
22+
repositories {
23+
maven {
24+
url "https://repo.eclipse.org/content/repositories/paho-releases/"
25+
}
26+
}
27+
28+
dependencies {
29+
compile 'com.android.support:support-v4:22.2.1'
30+
compile (group: 'org.eclipse.paho', name: 'org.eclipse.paho.android.service', version: '1.0.2') {
31+
exclude module: 'support-v4'
32+
}
33+
34+
}

0 commit comments

Comments
 (0)