Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cordova-background-geolocation
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Aksimaya
cordova-background-geolocation
Commits
1af4f38b
Commit
1af4f38b
authored
Feb 22, 2015
by
Chris Scott
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bugs
parent
597faa0d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
12 deletions
+11
-12
BackgroundGeolocationPlugin.java
src/android/BackgroundGeolocationPlugin.java
+9
-9
BackgroundGeoLocation.js
www/BackgroundGeoLocation.js
+2
-3
No files found.
src/android/BackgroundGeolocationPlugin.java
View file @
1af4f38b
...
@@ -52,7 +52,7 @@ public class BackgroundGeolocationPlugin extends CordovaPlugin implements Locati
...
@@ -52,7 +52,7 @@ public class BackgroundGeolocationPlugin extends CordovaPlugin implements Locati
// Android-only config
// Android-only config
private
Integer
locationUpdateInterval
=
60000
;
private
Integer
locationUpdateInterval
=
60000
;
private
Integer
activity
Detec
tionInterval
=
60000
;
private
Integer
activity
Recogni
tionInterval
=
60000
;
private
CallbackContext
callback
;
private
CallbackContext
callback
;
...
@@ -124,13 +124,13 @@ public class BackgroundGeolocationPlugin extends CordovaPlugin implements Locati
...
@@ -124,13 +124,13 @@ public class BackgroundGeolocationPlugin extends CordovaPlugin implements Locati
JSONObject
config
=
data
.
getJSONObject
(
0
);
JSONObject
config
=
data
.
getJSONObject
(
0
);
Log
.
i
(
TAG
,
"- configure: "
+
config
.
toString
());
Log
.
i
(
TAG
,
"- configure: "
+
config
.
toString
());
this
.
stationaryRadius
=
config
.
getInt
(
"stationaryRadius"
);
stationaryRadius
=
config
.
getInt
(
"stationaryRadius"
);
this
.
distanceFilter
=
(
float
)
config
.
getInt
(
"distanceFilter"
);
distanceFilter
=
(
float
)
config
.
getInt
(
"distanceFilter"
);
this
.
desiredAccuracy
=
config
.
getInt
(
"desiredAccuracy"
);
desiredAccuracy
=
config
.
getInt
(
"desiredAccuracy"
);
this
.
locationUpdateInterval
=
config
.
getInt
(
"locationUpdateInterval"
);
locationUpdateInterval
=
config
.
getInt
(
"locationUpdateInterval"
);
this
.
activityDetectionInterval
=
config
.
getInt
(
"activityDetec
tionInterval"
);
activityRecognitionInterval
=
config
.
getInt
(
"activityRecogni
tionInterval"
);
this
.
isDebugging
=
config
.
getBoolean
(
"debug"
);
isDebugging
=
config
.
getBoolean
(
"debug"
);
this
.
stopOnTerminate
=
config
.
getBoolean
(
"stopOnTerminate"
);
stopOnTerminate
=
config
.
getBoolean
(
"stopOnTerminate"
);
this
.
callback
=
callbackContext
;
this
.
callback
=
callbackContext
;
}
catch
(
JSONException
e
)
{
}
catch
(
JSONException
e
)
{
...
@@ -274,7 +274,7 @@ public class BackgroundGeolocationPlugin extends CordovaPlugin implements Locati
...
@@ -274,7 +274,7 @@ public class BackgroundGeolocationPlugin extends CordovaPlugin implements Locati
}
}
private
void
requestActivityUpdates
()
{
private
void
requestActivityUpdates
()
{
ActivityRecognition
.
ActivityRecognitionApi
.
requestActivityUpdates
(
googleApiClient
,
activity
Detec
tionInterval
,
locationUpdateService
);
ActivityRecognition
.
ActivityRecognitionApi
.
requestActivityUpdates
(
googleApiClient
,
activity
Recogni
tionInterval
,
locationUpdateService
);
}
}
private
void
removeActivityUpdates
()
{
private
void
removeActivityUpdates
()
{
...
...
www/BackgroundGeoLocation.js
View file @
1af4f38b
...
@@ -14,11 +14,10 @@ module.exports = {
...
@@ -14,11 +14,10 @@ module.exports = {
config
.
stationaryRadius
=
(
config
.
stationaryRadius
>=
0
)
?
config
.
stationaryRadius
:
50
;
// meters
config
.
stationaryRadius
=
(
config
.
stationaryRadius
>=
0
)
?
config
.
stationaryRadius
:
50
;
// meters
config
.
distanceFilter
=
(
config
.
distanceFilter
>=
0
)
?
config
.
distanceFilter
:
500
;
// meters
config
.
distanceFilter
=
(
config
.
distanceFilter
>=
0
)
?
config
.
distanceFilter
:
500
;
// meters
config
.
locationTimeout
=
(
config
.
locationTimeout
>=
0
)
?
config
.
locationTimeout
:
60
;
// seconds
config
.
locationUpdateInterval
=
(
config
.
locationUpdateInterval
>=
0
)
?
config
.
locationUpdateInterval
:
60000
;
// ms
config
.
activityRecognitionInterval
=
(
config
.
activityRecognitionInterval
>=
0
)
?
config
.
activityRecognitionInterval
:
60000
;
// ms
config
.
desiredAccuracy
=
(
config
.
desiredAccuracy
>=
0
)
?
config
.
desiredAccuracy
:
100
;
// meters
config
.
desiredAccuracy
=
(
config
.
desiredAccuracy
>=
0
)
?
config
.
desiredAccuracy
:
100
;
// meters
config
.
debug
=
config
.
debug
||
false
;
config
.
debug
=
config
.
debug
||
false
;
config
.
notificationTitle
=
config
.
notificationTitle
||
"
Background tracking
"
;
config
.
notificationText
=
config
.
notificationText
||
"
ENABLED
"
;
config
.
activityType
=
config
.
activityType
||
"
OTHER
"
;
config
.
activityType
=
config
.
activityType
||
"
OTHER
"
;
config
.
stopOnTerminate
=
config
.
stopOnTerminate
||
false
;
config
.
stopOnTerminate
=
config
.
stopOnTerminate
||
false
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment