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 24a0da5c
authored
Jun 28, 2019
by
cuiliang.shi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
0.1
1 parent
07fe885c
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
12 additions
and
4 deletions
app/release/LocationServer_0.1.apk
app/src/main/java/com/toscl/location/hengfeng/LocationService.java
app/src/main/java/com/toscl/location/hengfeng/activity/ServiceSettingActivity.java
app/src/main/java/com/toscl/location/hengfeng/activity/ServiceStopActivity.java
app/src/main/java/com/toscl/location/hengfeng/util/PhoneUtils.java
app/src/main/res/values/strings.xml
app/src/main/源码包.zip
app/release/LocationServer_0.1.apk
View file @
24a0da5
No preview for this file type
app/src/main/java/com/toscl/location/hengfeng/LocationService.java
View file @
24a0da5
...
@@ -313,6 +313,8 @@ public class LocationService extends Service {
...
@@ -313,6 +313,8 @@ public class LocationService extends Service {
manger
.
setExact
(
AlarmManager
.
ELAPSED_REALTIME_WAKEUP
,
manger
.
setExact
(
AlarmManager
.
ELAPSED_REALTIME_WAKEUP
,
SystemClock
.
elapsedRealtime
()
+
frequency
*
60
*
1000
+
10
,
SystemClock
.
elapsedRealtime
()
+
frequency
*
60
*
1000
+
10
,
alarmReceiverPendingIntent
);
alarmReceiverPendingIntent
);
}
else
{
PreferencesUtil
.
getInstance
(
getApplicationContext
()).
putBoolean
(
PreferencesUtil
.
HENG_FENG_IS_OEPN
,
false
);
}
}
}
}
...
@@ -336,7 +338,6 @@ public class LocationService extends Service {
...
@@ -336,7 +338,6 @@ public class LocationService extends Service {
x
.
printStackTrace
();
x
.
printStackTrace
();
}
}
IotApi
.
hengfeng_service_post
(
jsonBody
,
new
IotNetApiCallback
()
{
IotApi
.
hengfeng_service_post
(
jsonBody
,
new
IotNetApiCallback
()
{
@Override
@Override
...
...
app/src/main/java/com/toscl/location/hengfeng/activity/ServiceSettingActivity.java
View file @
24a0da5
...
@@ -143,6 +143,9 @@ public class ServiceSettingActivity extends Activity implements View.OnClickList
...
@@ -143,6 +143,9 @@ public class ServiceSettingActivity extends Activity implements View.OnClickList
PreferencesUtil
.
getInstance
(
getApplicationContext
())
PreferencesUtil
.
getInstance
(
getApplicationContext
())
.
putInt
(
PreferencesUtil
.
HENG_FENG_FREQUENCY
,
frequency
);
.
putInt
(
PreferencesUtil
.
HENG_FENG_FREQUENCY
,
frequency
);
PreferencesUtil
.
getInstance
(
getApplicationContext
())
.
putBoolean
(
PreferencesUtil
.
HENG_FENG_IS_OEPN
,
true
);
cancelPreviousAlarmService
();
cancelPreviousAlarmService
();
sendBroadcastForNextStartService
();
sendBroadcastForNextStartService
();
Toast
.
makeText
(
ServiceSettingActivity
.
this
,
getString
(
R
.
string
.
setting_tips_success
),
Toast
.
LENGTH_SHORT
).
show
();
Toast
.
makeText
(
ServiceSettingActivity
.
this
,
getString
(
R
.
string
.
setting_tips_success
),
Toast
.
LENGTH_SHORT
).
show
();
...
...
app/src/main/java/com/toscl/location/hengfeng/activity/ServiceStopActivity.java
View file @
24a0da5
...
@@ -88,15 +88,18 @@ public class ServiceStopActivity extends Activity implements View.OnClickListene
...
@@ -88,15 +88,18 @@ public class ServiceStopActivity extends Activity implements View.OnClickListene
PreferencesUtil
.
getInstance
(
getApplicationContext
()).
putBoolean
(
PreferencesUtil
.
HENG_FENG_IS_OEPN
,
false
);
PreferencesUtil
.
getInstance
(
getApplicationContext
()).
putBoolean
(
PreferencesUtil
.
HENG_FENG_IS_OEPN
,
false
);
cancelPreviousAlarmService
();
cancelPreviousAlarmService
();
Toast
.
makeText
(
getApplicationContext
(),
getString
(
R
.
string
.
stop_service_tips
),
Toast
.
LENGTH_SHORT
).
show
();
finish
();
finish
();
}
else
{
Toast
.
makeText
(
getApplicationContext
(),
msg
,
Toast
.
LENGTH_SHORT
).
show
();
}
}
Toast
.
makeText
(
getApplicationContext
(),
msg
,
Toast
.
LENGTH_SHORT
).
show
();
}
}
@Override
@Override
public
void
onFailed
(
Exception
e
)
{
public
void
onFailed
(
Exception
e
)
{
Toast
.
makeText
(
getApplicationContext
(),
Toast
.
makeText
(
getApplicationContext
(),
get
Resources
().
get
String
(
R
.
string
.
toast_tips_server_unavailable
),
Toast
.
LENGTH_SHORT
).
show
();
getString
(
R
.
string
.
toast_tips_server_unavailable
),
Toast
.
LENGTH_SHORT
).
show
();
}
}
});
});
}
}
...
...
app/src/main/java/com/toscl/location/hengfeng/util/PhoneUtils.java
View file @
24a0da5
...
@@ -315,7 +315,7 @@ public class PhoneUtils {
...
@@ -315,7 +315,7 @@ public class PhoneUtils {
.
getInt
(
PreferencesUtil
.
HENG_FENG_BEGIN
,
PreferencesUtil
.
HENG_FENG_DEFAULT_BEGIN
);
.
getInt
(
PreferencesUtil
.
HENG_FENG_BEGIN
,
PreferencesUtil
.
HENG_FENG_DEFAULT_BEGIN
);
int
end
=
PreferencesUtil
.
getInstance
(
context
)
int
end
=
PreferencesUtil
.
getInstance
(
context
)
.
getInt
(
PreferencesUtil
.
HENG_FENG_
BEGIN
,
PreferencesUtil
.
HENG_FENG_DEFAULT_END
);
.
getInt
(
PreferencesUtil
.
HENG_FENG_
END
,
PreferencesUtil
.
HENG_FENG_DEFAULT_END
);
Date
startTime
=
new
SimpleDateFormat
(
format
).
parse
(
begin
+
":00:00"
);
Date
startTime
=
new
SimpleDateFormat
(
format
).
parse
(
begin
+
":00:00"
);
Date
endTime
=
new
SimpleDateFormat
(
format
).
parse
(
end
+
":00:00"
);
Date
endTime
=
new
SimpleDateFormat
(
format
).
parse
(
end
+
":00:00"
);
...
...
app/src/main/res/values/strings.xml
View file @
24a0da5
...
@@ -42,4 +42,5 @@
...
@@ -42,4 +42,5 @@
<string
name=
"apply_tips_success"
translatable=
"false"
>
申请开通成功
</string>
<string
name=
"apply_tips_success"
translatable=
"false"
>
申请开通成功
</string>
<string
name=
"setting_tips_success"
translatable=
"false"
>
设置成功
</string>
<string
name=
"setting_tips_success"
translatable=
"false"
>
设置成功
</string>
<string
name=
"location_server_unavailable"
translatable=
"false"
>
定位失败,当前服务不在有效期内
</string>
<string
name=
"location_server_unavailable"
translatable=
"false"
>
定位失败,当前服务不在有效期内
</string>
<string
name=
"stop_service_tips"
>
已停止服务
</string>
</resources>
</resources>
app/src/main/源码包.zip
0 → 100644
View file @
24a0da5
No preview for this file type
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