Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cordova-plugin-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-plugin-background-geolocation
Commits
a8769521
Commit
a8769521
authored
Apr 02, 2014
by
Tarang Patel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update LocationUpdateService.java
parent
2d69f9e5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
5 deletions
+12
-5
LocationUpdateService.java
src/android/LocationUpdateService.java
+12
-5
No files found.
src/android/LocationUpdateService.java
View file @
a8769521
...
@@ -179,8 +179,8 @@ public class LocationUpdateService extends Service implements LocationListener {
...
@@ -179,8 +179,8 @@ public class LocationUpdateService extends Service implements LocationListener {
PendingIntent
pendingIntent
=
PendingIntent
.
getActivity
(
this
,
0
,
main
,
PendingIntent
.
FLAG_UPDATE_CURRENT
);
PendingIntent
pendingIntent
=
PendingIntent
.
getActivity
(
this
,
0
,
main
,
PendingIntent
.
FLAG_UPDATE_CURRENT
);
Notification
.
Builder
builder
=
new
Notification
.
Builder
(
this
);
Notification
.
Builder
builder
=
new
Notification
.
Builder
(
this
);
builder
.
setContentTitle
(
"
Background tracking
"
);
builder
.
setContentTitle
(
"
Eato Driver App
"
);
builder
.
setContentText
(
"
ENABLED
"
);
builder
.
setContentText
(
"
Ready
"
);
builder
.
setSmallIcon
(
android
.
R
.
drawable
.
ic_menu_mylocation
);
builder
.
setSmallIcon
(
android
.
R
.
drawable
.
ic_menu_mylocation
);
builder
.
setContentIntent
(
pendingIntent
);
builder
.
setContentIntent
(
pendingIntent
);
Notification
notification
;
Notification
notification
;
...
@@ -221,7 +221,9 @@ public class LocationUpdateService extends Service implements LocationListener {
...
@@ -221,7 +221,9 @@ public class LocationUpdateService extends Service implements LocationListener {
public
boolean
stopService
(
Intent
intent
)
{
public
boolean
stopService
(
Intent
intent
)
{
Log
.
i
(
TAG
,
"- Received stop: "
+
intent
);
Log
.
i
(
TAG
,
"- Received stop: "
+
intent
);
cleanUp
();
cleanUp
();
Toast
.
makeText
(
this
,
"Background location tracking stopped"
,
Toast
.
LENGTH_SHORT
).
show
();
if
(
isDebugging
)
{
Toast
.
makeText
(
this
,
"Background location tracking stopped"
,
Toast
.
LENGTH_SHORT
).
show
();
}
return
super
.
stopService
(
intent
);
return
super
.
stopService
(
intent
);
}
}
...
@@ -478,9 +480,14 @@ public class LocationUpdateService extends Service implements LocationListener {
...
@@ -478,9 +480,14 @@ public class LocationUpdateService extends Service implements LocationListener {
if
(
isMoving
)
{
if
(
isMoving
)
{
return
;
return
;
}
}
startTone
(
"beep"
);
if
(
isDebugging
)
{
startTone
(
"beep"
);
}
float
distance
=
location
.
distanceTo
(
stationaryLocation
)
-
stationaryLocation
.
getAccuracy
()
-
location
.
getAccuracy
();
float
distance
=
location
.
distanceTo
(
stationaryLocation
)
-
stationaryLocation
.
getAccuracy
()
-
location
.
getAccuracy
();
Toast
.
makeText
(
this
,
"Stationary exit in "
+
(
stationaryRadius
-
distance
)
+
"m"
,
Toast
.
LENGTH_LONG
).
show
();
if
(
isDebugging
)
{
Toast
.
makeText
(
this
,
"Stationary exit in "
+
(
stationaryRadius
-
distance
)
+
"m"
,
Toast
.
LENGTH_LONG
).
show
();
}
// TODO http://www.cse.buffalo.edu/~demirbas/publications/proximity.pdf
// TODO http://www.cse.buffalo.edu/~demirbas/publications/proximity.pdf
// determine if we're almost out of stationary-distance and increase monitoring-rate.
// determine if we're almost out of stationary-distance and increase monitoring-rate.
...
...
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