Commit 0f410cf8 authored by Chris Scott's avatar Chris Scott

Migrate Android build-system to gradle. .jar file is now gone

parent 1a2eea84
...@@ -27,9 +27,9 @@ ...@@ -27,9 +27,9 @@
<!-- android --> <!-- android -->
<platform name="android"> <platform name="android">
<framework src="com.google.android.gms:play-services-location:7.3.0" /> <framework src="src/android/build.gradle" custom="true" type="gradleReference" />
<source-file src="src/android/libs/eventbus-2.4.0.jar" target-dir="libs" /> <resource-file src="src/android/libs/tslocationmanager.aar" target="src/android/libs/tslocationmanager.aar" />
<source-file src="src/android/libs/transistor-locationmanager.jar" target-dir="libs" />
<source-file src="src/android/CDVBackgroundGeolocation.java" target-dir="src/com/transistorsoft/cordova/bggeo" /> <source-file src="src/android/CDVBackgroundGeolocation.java" target-dir="src/com/transistorsoft/cordova/bggeo" />
<source-file src="src/android/BootReceiver.java" target-dir="src/com/transistorsoft/cordova/bggeo" /> <source-file src="src/android/BootReceiver.java" target-dir="src/com/transistorsoft/cordova/bggeo" />
......
...@@ -20,6 +20,7 @@ import android.app.AlertDialog; ...@@ -20,6 +20,7 @@ import android.app.AlertDialog;
import android.content.DialogInterface; import android.content.DialogInterface;
import de.greenrobot.event.EventBus; import de.greenrobot.event.EventBus;
import de.greenrobot.event.Subscribe;
import android.app.Activity; import android.app.Activity;
import android.content.Intent; import android.content.Intent;
import android.content.SharedPreferences; import android.content.SharedPreferences;
...@@ -448,6 +449,7 @@ public class CDVBackgroundGeolocation extends CordovaPlugin { ...@@ -448,6 +449,7 @@ public class CDVBackgroundGeolocation extends CordovaPlugin {
* EventBus listener for Event Bundle * EventBus listener for Event Bundle
* @param {Bundle} event * @param {Bundle} event
*/ */
@Subscribe
public void onEventMainThread(Bundle event) { public void onEventMainThread(Bundle event) {
if (event.containsKey("request")) { if (event.containsKey("request")) {
return; return;
...@@ -535,6 +537,7 @@ public class CDVBackgroundGeolocation extends CordovaPlugin { ...@@ -535,6 +537,7 @@ public class CDVBackgroundGeolocation extends CordovaPlugin {
* EventBus listener for ARS * EventBus listener for ARS
* @param {ActivityRecognitionResult} result * @param {ActivityRecognitionResult} result
*/ */
@Subscribe
public void onEventMainThread(ActivityRecognitionResult result) { public void onEventMainThread(ActivityRecognitionResult result) {
currentActivity = result.getMostProbableActivity(); currentActivity = result.getMostProbableActivity();
...@@ -554,6 +557,7 @@ public class CDVBackgroundGeolocation extends CordovaPlugin { ...@@ -554,6 +557,7 @@ public class CDVBackgroundGeolocation extends CordovaPlugin {
* EventBus listener * EventBus listener
* @param {Location} location * @param {Location} location
*/ */
@Subscribe
public void onEventMainThread(Location location) { public void onEventMainThread(Location location) {
JSONObject locationData = BackgroundGeolocationService.locationToJson(location, currentActivity, isMoving); JSONObject locationData = BackgroundGeolocationService.locationToJson(location, currentActivity, isMoving);
this.onLocationChange(locationData); this.onLocationChange(locationData);
...@@ -587,7 +591,8 @@ public class CDVBackgroundGeolocation extends CordovaPlugin { ...@@ -587,7 +591,8 @@ public class CDVBackgroundGeolocation extends CordovaPlugin {
} }
/** /**
* EventBus handler for Geofencing events * EventBus handler for Geofencing events
*/ */
@Subscribe
public void onEventMainThread(GeofencingEvent geofenceEvent) { public void onEventMainThread(GeofencingEvent geofenceEvent) {
Log.i(TAG, "- Rx GeofencingEvent: " + geofenceEvent); Log.i(TAG, "- Rx GeofencingEvent: " + geofenceEvent);
......
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
minSdkVersion 15
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
repositories{
jcenter()
flatDir{
dirs 'src/android/libs'
}
}
dependencies {
compile 'com.google.android.gms:play-services:7.5.0'
compile 'de.greenrobot:eventbus:3.0.0-beta1'
//provided 'de.greenrobot:eventbus-annotation-processor:3.0.0-beta1'
compile(name:'tslocationmanager', ext:'aar')
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment