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
597faa0d
Commit
597faa0d
authored
Feb 22, 2015
by
Chris Scott
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bugs in renaming
parent
3922103d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
7 deletions
+8
-7
plugin.xml
plugin.xml
+1
-0
BackgroundGeolocationPlugin.java
src/android/BackgroundGeolocationPlugin.java
+3
-3
BackgroundGeolocationService.java
src/android/BackgroundGeolocationService.java
+4
-4
No files found.
plugin.xml
View file @
597faa0d
...
@@ -40,6 +40,7 @@
...
@@ -40,6 +40,7 @@
<uses-permission
android:name=
"android.permission.ACCESS_LOCATION_EXTRA_COMMANDS"
/>
<uses-permission
android:name=
"android.permission.ACCESS_LOCATION_EXTRA_COMMANDS"
/>
<uses-permission
android:name=
"android.permission.INTERNET"
/>
<uses-permission
android:name=
"android.permission.INTERNET"
/>
<uses-permission
android:name=
"android.permission.WAKE_LOCK"
/>
<uses-permission
android:name=
"android.permission.WAKE_LOCK"
/>
<uses-permission
android:name=
"com.google.android.gms.permission.ACTIVITY_RECOGNITION"
/>
</config-file>
</config-file>
<config-file
target=
"res/xml/config.xml"
parent=
"/*"
>
<config-file
target=
"res/xml/config.xml"
parent=
"/*"
>
<feature
name=
"BackgroundGeoLocation"
>
<feature
name=
"BackgroundGeoLocation"
>
...
...
src/android/BackgroundGeolocationPlugin.java
View file @
597faa0d
package
com
.
t
enforwardconsulting
.
cordova
.
bgloc
;
package
com
.
t
ransistorsoft
.
cordova
.
bggeo
;
import
org.apache.cordova.CallbackContext
;
import
org.apache.cordova.CallbackContext
;
import
org.apache.cordova.CordovaPlugin
;
import
org.apache.cordova.CordovaPlugin
;
...
@@ -31,7 +31,7 @@ import android.media.AudioManager;
...
@@ -31,7 +31,7 @@ import android.media.AudioManager;
import
android.media.ToneGenerator
;
import
android.media.ToneGenerator
;
public
class
BackgroundGeolocationPlugin
extends
CordovaPlugin
implements
LocationListener
,
GoogleApiClient
.
ConnectionCallbacks
,
GoogleApiClient
.
OnConnectionFailedListener
{
public
class
BackgroundGeolocationPlugin
extends
CordovaPlugin
implements
LocationListener
,
GoogleApiClient
.
ConnectionCallbacks
,
GoogleApiClient
.
OnConnectionFailedListener
{
private
static
final
String
TAG
=
"BackgroundGeo
L
ocation"
;
private
static
final
String
TAG
=
"BackgroundGeo
l
ocation"
;
public
static
final
String
ACTION_START
=
"start"
;
public
static
final
String
ACTION_START
=
"start"
;
public
static
final
String
ACTION_STOP
=
"stop"
;
public
static
final
String
ACTION_STOP
=
"stop"
;
...
@@ -88,7 +88,7 @@ public class BackgroundGeolocationPlugin extends CordovaPlugin implements Locati
...
@@ -88,7 +88,7 @@ public class BackgroundGeolocationPlugin extends CordovaPlugin implements Locati
}
}
// This is the IntentService we'll provide to google-play API.
// This is the IntentService we'll provide to google-play API.
locationUpdateService
=
PendingIntent
.
getService
(
activity
,
0
,
new
Intent
(
activity
,
L
ocationService
.
class
),
PendingIntent
.
FLAG_UPDATE_CURRENT
);
locationUpdateService
=
PendingIntent
.
getService
(
activity
,
0
,
new
Intent
(
activity
,
BackgroundGeol
ocationService
.
class
),
PendingIntent
.
FLAG_UPDATE_CURRENT
);
// Register for events fired by our IntentService "LocationService"
// Register for events fired by our IntentService "LocationService"
EventBus
.
getDefault
().
register
(
this
);
EventBus
.
getDefault
().
register
(
this
);
...
...
src/android/BackgroundGeolocationService.java
View file @
597faa0d
package
com
.
t
enforwardconsulting
.
cordova
.
bgloc
;
package
com
.
t
ransistorsoft
.
cordova
.
bggeo
;
import
de.greenrobot.event.EventBus
;
import
de.greenrobot.event.EventBus
;
...
@@ -15,7 +15,7 @@ public class BackgroundGeolocationService extends IntentService {
...
@@ -15,7 +15,7 @@ public class BackgroundGeolocationService extends IntentService {
private
static
final
String
TAG
=
"BackgroundGeolocationService"
;
private
static
final
String
TAG
=
"BackgroundGeolocationService"
;
public
L
ocationService
()
{
public
BackgroundGeol
ocationService
()
{
super
(
"com.transistorsoft.cordova.bggeo.BackgroundGeolocationService"
);
super
(
"com.transistorsoft.cordova.bggeo.BackgroundGeolocationService"
);
}
}
...
@@ -45,7 +45,7 @@ public class BackgroundGeolocationService extends IntentService {
...
@@ -45,7 +45,7 @@ public class BackgroundGeolocationService extends IntentService {
break
;
break
;
}
}
boolean
isPushPluginActive
=
BackgroundG
ps
Plugin
.
isActive
();
boolean
isPushPluginActive
=
BackgroundG
eolocation
Plugin
.
isActive
();
if
(
isMoving
&&
!
isPushPluginActive
)
{
if
(
isMoving
&&
!
isPushPluginActive
)
{
forceMainActivityReload
();
forceMainActivityReload
();
}
}
...
@@ -54,7 +54,7 @@ public class BackgroundGeolocationService extends IntentService {
...
@@ -54,7 +54,7 @@ public class BackgroundGeolocationService extends IntentService {
final
Location
location
=
intent
.
getParcelableExtra
(
FusedLocationProviderApi
.
KEY_LOCATION_CHANGED
);
final
Location
location
=
intent
.
getParcelableExtra
(
FusedLocationProviderApi
.
KEY_LOCATION_CHANGED
);
if
(
location
!=
null
)
{
if
(
location
!=
null
)
{
Log
.
i
(
TAG
,
"Location received: "
+
location
.
toString
());
Log
.
i
(
TAG
,
"Location received: "
+
location
.
toString
());
boolean
isPushPluginActive
=
BackgroundG
ps
Plugin
.
isActive
();
boolean
isPushPluginActive
=
BackgroundG
eolocation
Plugin
.
isActive
();
if
(!
isPushPluginActive
)
{
if
(!
isPushPluginActive
)
{
forceMainActivityReload
();
forceMainActivityReload
();
}
}
...
...
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