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 4e2f1e8b
authored
Sep 16, 2019
by
韩倩倩
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1、服务说明 修改;2、在定位信息上送接口中 添加定位方式(高德地图定义)
1 parent
0101a08a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
5 deletions
app/src/main/java/com/toscl/location/hengfeng/LocationService.java
app/src/main/java/com/toscl/location/hengfeng/util/PreferencesUtil.java
app/src/main/res/values/strings.xml
app/src/main/java/com/toscl/location/hengfeng/LocationService.java
View file @
4e2f1e8
...
@@ -40,6 +40,7 @@ import org.json.JSONObject;
...
@@ -40,6 +40,7 @@ import org.json.JSONObject;
public
class
LocationService
extends
Service
{
public
class
LocationService
extends
Service
{
private
String
TAG
=
"LocationService"
;
private
String
TAG
=
"LocationService"
;
private
String
mType
=
""
;
private
String
mLongitude
=
""
;
private
String
mLongitude
=
""
;
private
String
mLatitude
=
""
;
private
String
mLatitude
=
""
;
private
double
mWifiLatitude
=
0
;
private
double
mWifiLatitude
=
0
;
...
@@ -259,6 +260,7 @@ public class LocationService extends Service {
...
@@ -259,6 +260,7 @@ public class LocationService extends Service {
mAccuracy
=
amapLocation
.
getAccuracy
();
mAccuracy
=
amapLocation
.
getAccuracy
();
mLatitude
=
String
.
valueOf
(
amapLocation
.
getLatitude
());
mLatitude
=
String
.
valueOf
(
amapLocation
.
getLatitude
());
mLongitude
=
String
.
valueOf
(
amapLocation
.
getLongitude
());
mLongitude
=
String
.
valueOf
(
amapLocation
.
getLongitude
());
mType
=
String
.
valueOf
(
amapLocation
.
getLocationType
());
}
}
if
(
amapLocation
.
getLocationType
()
==
5
)
{
if
(
amapLocation
.
getLocationType
()
==
5
)
{
...
@@ -293,16 +295,19 @@ public class LocationService extends Service {
...
@@ -293,16 +295,19 @@ public class LocationService extends Service {
mLatitude
=
String
.
valueOf
(
mWifiLatitude
);
mLatitude
=
String
.
valueOf
(
mWifiLatitude
);
mLongitude
=
String
.
valueOf
(
mWifiLongitude
);
mLongitude
=
String
.
valueOf
(
mWifiLongitude
);
mAccuracy
=
mWifiAccuracy
;
mAccuracy
=
mWifiAccuracy
;
mType
=
String
.
valueOf
(
AMapLocation
.
LOCATION_TYPE_WIFI
);
}
else
{
}
else
{
mLatitude
=
String
.
valueOf
(
mGpsLatitude
);
mLatitude
=
String
.
valueOf
(
mGpsLatitude
);
mLongitude
=
String
.
valueOf
(
mGpsLongitude
);
mLongitude
=
String
.
valueOf
(
mGpsLongitude
);
mAccuracy
=
mGpsAccuracy
;
mAccuracy
=
mGpsAccuracy
;
mType
=
String
.
valueOf
(
AMapLocation
.
LOCATION_TYPE_GPS
);
}
}
}
}
Log
.
d
(
TAG
,
"LAST PERFECT INFO amapLocation.getLatitude(): "
+
mLatitude
Log
.
d
(
TAG
,
"LAST PERFECT INFO amapLocation.getLatitude(): "
+
mLatitude
+
", amapLocation.getLongitude(): "
+
mLongitude
+
", amapLocation.getLongitude(): "
+
mLongitude
+
", amapLocation.getAccuracy():"
+
mAccuracy
);
+
", amapLocation.getAccuracy():"
+
mAccuracy
+
", amapLocation.getLocationType():"
+
mType
);
if
(
mLocationClient
!=
null
)
{
if
(
mLocationClient
!=
null
)
{
mLocationClient
.
stopLocation
();
mLocationClient
.
stopLocation
();
...
@@ -395,6 +400,7 @@ public class LocationService extends Service {
...
@@ -395,6 +400,7 @@ public class LocationService extends Service {
jsonBody
.
put
(
PreferencesUtil
.
HENG_FENG_REQ_SERVER_LONGITUDE
,
mLongitude
);
jsonBody
.
put
(
PreferencesUtil
.
HENG_FENG_REQ_SERVER_LONGITUDE
,
mLongitude
);
jsonBody
.
put
(
PreferencesUtil
.
HENG_FENG_REQ_SERVER_LATITUDE
,
mLatitude
);
jsonBody
.
put
(
PreferencesUtil
.
HENG_FENG_REQ_SERVER_LATITUDE
,
mLatitude
);
jsonBody
.
put
(
PreferencesUtil
.
HENG_FENG_REQ_SERVER_TYPE
,
mType
);
jsonBody
.
put
(
PreferencesUtil
.
HENG_FENG_REQ_SERVER_GCS
,
2
);
jsonBody
.
put
(
PreferencesUtil
.
HENG_FENG_REQ_SERVER_GCS
,
2
);
jsonBody
.
put
(
PreferencesUtil
.
HENG_FENG_REQ_SERVER_SIGN
,
PhoneUtils
.
getHengdaSign
(
jsonBody
));
jsonBody
.
put
(
PreferencesUtil
.
HENG_FENG_REQ_SERVER_SIGN
,
PhoneUtils
.
getHengdaSign
(
jsonBody
));
}
catch
(
JSONException
x
)
{
}
catch
(
JSONException
x
)
{
...
...
app/src/main/java/com/toscl/location/hengfeng/util/PreferencesUtil.java
View file @
4e2f1e8
...
@@ -19,6 +19,7 @@ public class PreferencesUtil {
...
@@ -19,6 +19,7 @@ public class PreferencesUtil {
public
final
static
String
HENG_FENG_REQ_SERVER_TIME
=
"time"
;
public
final
static
String
HENG_FENG_REQ_SERVER_TIME
=
"time"
;
public
final
static
String
HENG_FENG_REQ_SERVER_LONGITUDE
=
"lng"
;
public
final
static
String
HENG_FENG_REQ_SERVER_LONGITUDE
=
"lng"
;
public
final
static
String
HENG_FENG_REQ_SERVER_LATITUDE
=
"lat"
;
public
final
static
String
HENG_FENG_REQ_SERVER_LATITUDE
=
"lat"
;
public
final
static
String
HENG_FENG_REQ_SERVER_TYPE
=
"type"
;
// Geographical coordinate system
// Geographical coordinate system
public
final
static
String
HENG_FENG_REQ_SERVER_GCS
=
"gcs"
;
public
final
static
String
HENG_FENG_REQ_SERVER_GCS
=
"gcs"
;
public
final
static
String
HENG_FENG_REQ_SERVER_SIGN
=
"sign"
;
public
final
static
String
HENG_FENG_REQ_SERVER_SIGN
=
"sign"
;
...
...
app/src/main/res/values/strings.xml
View file @
4e2f1e8
...
@@ -19,10 +19,8 @@
...
@@ -19,10 +19,8 @@
<string
name=
"user_tips_content"
translatable=
"false"
>
每次重启开机后均会发送定位信息,可保存后重启手机测试。
</string>
<string
name=
"user_tips_content"
translatable=
"false"
>
每次重启开机后均会发送定位信息,可保存后重启手机测试。
</string>
<string
name=
"other_tips"
translatable=
"false"
>
测试接口: http://202.100.179.139:8088/api 正式接口: http://202.100.190.58:8090/api/cstmzPosition
</string>
<string
name=
"other_tips"
translatable=
"false"
>
测试接口: http://202.100.179.139:8088/api 正式接口: http://202.100.190.58:8090/api/cstmzPosition
</string>
<!-- hengfeng -->
<!-- hengfeng -->
<string
name=
"service_info"
translatable=
"false"
>
\t本定位服务面向在通信运营商处申请开通了特定套餐的用户。\n
<string
name=
"service_info"
translatable=
"false"
>
\t当您完成了“申请开通”的操作后,即表示您同意在服务有效的时间段内授权本服务获取您的位置。服务有效时间段依据您与服务商或运营商签订的协议而定。您可查看本手机的定位信息、设置电子围栏(安全区域)范围、收取跨越电子围栏(安全区域)的报警信息、查看当日及最近30天内的定位轨迹。\n
\t当您进行了“申请开通”的操作后,即表示您在套餐服务有效的时间段内授权本服务获取您的位置。\n
\t本定位服务的定位准确性和及时性与手机性能、定位信号强度、信息上传频率、网络情况等诸多因素有关,故本定位服务只起到辅助监护作用,不承担因定位不准确或不及时导致的任何问题、事故或纠纷,特此声明。\n
</string>
\t请您下载“颐关爱”APP,绑定本台手机后,即可查看本手机的定位信息、设置电子围栏(安全区域)范围、收取跨越电子围栏(安全区域)的报警信息、查看当日及最近30天内的定位轨迹。\n
\t本定位的准确性和及时性与手机性能、定位信号强度、信息上传频率、网络情况等诸多因素有关,故本定位服务只起到辅助监护作用,不承担因定位不准确或不及时导致的任何问题、事故或纠纷,特此声明。\n
</string>
<string
name=
"title_nav"
translatable=
"false"
>
定位服务
</string>
<string
name=
"title_nav"
translatable=
"false"
>
定位服务
</string>
<string
name=
"toast_tips_unavailable"
translatable=
"false"
>
未开通定位服务
</string>
<string
name=
"toast_tips_unavailable"
translatable=
"false"
>
未开通定位服务
</string>
<string
name=
"title_server_info"
translatable=
"false"
>
服务说明
</string>
<string
name=
"title_server_info"
translatable=
"false"
>
服务说明
</string>
...
...
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