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
a9999168
Commit
a9999168
authored
May 20, 2014
by
Zachary Giles
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding Iterator for headers
parent
7fc5617c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
6 deletions
+10
-6
LocationUpdateService.java
src/android/LocationUpdateService.java
+9
-5
BackgroundGeoLocation.js
www/BackgroundGeoLocation.js
+1
-1
No files found.
src/android/LocationUpdateService.java
View file @
a9999168
package
com
.
tenforwardconsulting
.
cordova
.
bgloc
;
import
java.util.List
;
import
java.util.Iterator
;
import
org.apache.http.HttpResponse
;
import
org.apache.http.client.methods.HttpPost
;
...
...
@@ -664,11 +665,14 @@ public class LocationUpdateService extends Service implements LocationListener {
StringEntity
se
=
new
StringEntity
(
params
.
toString
());
request
.
setEntity
(
se
);
for
(
String
headkey:
headers
.
keys
())
{
//request.setHeader("Accept", "application/json");
//request.setHeader("Content-type", "application/json");
Log
.
d
(
TAG
,
"Adding Header: "
+
headkey
+
" : "
+
headers
.
get
(
headkey
));
request
.
setHeader
(
headkey
,
headers
.
get
(
headkey
));
Iterator
<
String
>
headkeys
=
headers
.
keys
();
while
(
headkeys
.
hasNext
()
){
if
(
headkeys
.
next
()
!=
null
)
{
String
headkey
=
(
String
)
headkeys
.
next
();
Log
.
d
(
TAG
,
"Adding Header: "
+
headkey
+
" : "
+
(
String
)
headers
.
getString
(
headkey
));
request
.
setHeader
(
headkey
,
(
String
)
headers
.
getString
(
headkey
));
}
}
Log
.
d
(
TAG
,
"Posting to "
+
request
.
getURI
().
toString
());
HttpResponse
response
=
httpClient
.
execute
(
request
);
...
...
www/BackgroundGeoLocation.js
View file @
a9999168
...
...
@@ -14,7 +14,7 @@ module.exports = {
failure
||
function
()
{},
'
BackgroundGeoLocation
'
,
'
configure
'
,
[
params
,
url
,
stationaryRadius
,
distanceFilter
,
locationTimeout
,
desiredAccuracy
,
debug
]);
[
params
,
headers
,
url
,
stationaryRadius
,
distanceFilter
,
locationTimeout
,
desiredAccuracy
,
debug
]);
},
start
:
function
(
success
,
failure
,
config
)
{
exec
(
success
||
function
()
{},
...
...
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