Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
石璀亮
/
agenew_a16_sos
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit dac8a496
authored
Apr 01, 2019
by
cuiliang.shi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【2019-4-1】添加坐标系标识,适用其他坐标系(GCJ02、BD09,不传默认为BD-09)
1 parent
84db52e3
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
6 deletions
app/src/main/java/com/agenew/location_server/application/BirdService.java
app/src/main/java/com/agenew/location_server/application/BirdService.java
View file @
dac8a49
...
@@ -37,7 +37,7 @@ import java.util.List;
...
@@ -37,7 +37,7 @@ import java.util.List;
public
class
BirdService
extends
Service
{
public
class
BirdService
extends
Service
{
public
static
int
status
=
0
;
public
static
int
status
=
0
;
private
final
static
String
DEFAULTPATH
=
"http://202.100.1
79.139:8088/api
"
;
private
final
static
String
DEFAULTPATH
=
"http://202.100.1
90.58:8090/api/cstmzPosition
"
;
private
final
static
long
DEFAULTINTERVAL
=
30
;
private
final
static
long
DEFAULTINTERVAL
=
30
;
private
String
mMobile
;
private
String
mMobile
;
private
String
mIMEIStr
;
private
String
mIMEIStr
;
...
@@ -56,7 +56,7 @@ public class BirdService extends Service {
...
@@ -56,7 +56,7 @@ public class BirdService extends Service {
private
Context
mContext
;
private
Context
mContext
;
private
String
mPath
=
""
;
private
String
mPath
=
""
;
private
int
ret_code
=
0
;
private
int
ret_code
=
0
;
private
String
ret_cfgv
=
"
0
"
;
private
String
ret_cfgv
=
"
2019031512
"
;
@Override
@Override
public
IBinder
onBind
(
Intent
intent
)
{
public
IBinder
onBind
(
Intent
intent
)
{
...
@@ -115,7 +115,7 @@ public class BirdService extends Service {
...
@@ -115,7 +115,7 @@ public class BirdService extends Service {
DevicePreferences
.
getInstance
(
this
).
putBoolean
(
"is_need_notification"
,
true
);
DevicePreferences
.
getInstance
(
this
).
putBoolean
(
"is_need_notification"
,
true
);
}
}
ret_cfgv
=
DevicePreferences
.
getInstance
(
getApplicationContext
()).
getString
(
"bird_ret_cfgv"
,
"
0
"
);
ret_cfgv
=
DevicePreferences
.
getInstance
(
getApplicationContext
()).
getString
(
"bird_ret_cfgv"
,
"
2019031512
"
);
mPath
=
DevicePreferences
.
getInstance
(
mContext
).
getString
(
"bird_location_upload_url"
,
DEFAULTPATH
);
mPath
=
DevicePreferences
.
getInstance
(
mContext
).
getString
(
"bird_location_upload_url"
,
DEFAULTPATH
);
long
temp
=
DevicePreferences
.
getInstance
(
mContext
).
getLong
(
"bird_location_upload_interval"
,
DEFAULTINTERVAL
);
long
temp
=
DevicePreferences
.
getInstance
(
mContext
).
getLong
(
"bird_location_upload_interval"
,
DEFAULTINTERVAL
);
...
@@ -164,7 +164,7 @@ public class BirdService extends Service {
...
@@ -164,7 +164,7 @@ public class BirdService extends Service {
public
void
setAlarm
(){
public
void
setAlarm
(){
Log
.
d
(
TAG
,
"setAlarm"
);
Log
.
d
(
TAG
,
"setAlarm"
);
ret_cfgv
=
DevicePreferences
.
getInstance
(
getApplicationContext
()).
getString
(
"bird_ret_cfgv"
,
"
0
"
);
ret_cfgv
=
DevicePreferences
.
getInstance
(
getApplicationContext
()).
getString
(
"bird_ret_cfgv"
,
"
2019031512
"
);
mPath
=
DevicePreferences
.
getInstance
(
mContext
).
getString
(
"bird_location_upload_url"
,
DEFAULTPATH
);
mPath
=
DevicePreferences
.
getInstance
(
mContext
).
getString
(
"bird_location_upload_url"
,
DEFAULTPATH
);
long
temp
=
DevicePreferences
.
getInstance
(
mContext
).
getLong
(
"bird_location_upload_interval"
,
DEFAULTINTERVAL
);
long
temp
=
DevicePreferences
.
getInstance
(
mContext
).
getLong
(
"bird_location_upload_interval"
,
DEFAULTINTERVAL
);
...
@@ -202,6 +202,7 @@ public class BirdService extends Service {
...
@@ -202,6 +202,7 @@ public class BirdService extends Service {
strbuf
.
append
(
"&imsi="
+
mIMSIStr
);
strbuf
.
append
(
"&imsi="
+
mIMSIStr
);
strbuf
.
append
(
"&model="
+
mModel
);
strbuf
.
append
(
"&model="
+
mModel
);
strbuf
.
append
(
"&cfgv="
+
ret_cfgv
);
strbuf
.
append
(
"&cfgv="
+
ret_cfgv
);
strbuf
.
append
(
"&gcs="
+
"GCJ02"
);
Log
.
d
(
TAG
,
"REQUEST: URL: "
+
mPath
+
", BODY:"
+
strbuf
);
Log
.
d
(
TAG
,
"REQUEST: URL: "
+
mPath
+
", BODY:"
+
strbuf
);
...
@@ -323,8 +324,9 @@ public class BirdService extends Service {
...
@@ -323,8 +324,9 @@ public class BirdService extends Service {
mIMSIStr
=
temp_imsi
.
substring
(
0
,
temp_imsi
.
length
()
-
1
);
mIMSIStr
=
temp_imsi
.
substring
(
0
,
temp_imsi
.
length
()
-
1
);
mICCIDStr
=
temp_iccid
.
substring
(
0
,
temp_iccid
.
length
()
-
1
);
mICCIDStr
=
temp_iccid
.
substring
(
0
,
temp_iccid
.
length
()
-
1
);
String
temp_model
=
Build
.
MODEL
;
// String temp_model = Build.MODEL;
mModel
=
temp_model
.
trim
().
replaceAll
(
" "
,
"_"
);
// mModel = temp_model.trim().replaceAll(" ", "_");
mModel
=
"HBA7+"
;
}
}
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment