Package com.unitech.api.clock
Class ClockCtrl
java.lang.Object
com.unitech.api.clock.ClockCtrl
The type Clock ctrl.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionBundleGet manual time.BundleGet ntp server.BundleGet time format bundle.BundleGet time mode.BundleGet time zone bundle.BundleGet time zone mode bundle.BundlesetManualDate(String date) Set manual date.BundlesetManualTime(String time) Set manual time.BundlesetNTPServer(String NTPServerURL) Set ntp server .BundlesetTimeFormat(int timeFormat) Set time format bundle.BundlesetTimeMode(int mode) Set time mode.BundlesetTimeZone(String timeZone) Set time zone bundle.BundlesetTimeZoneMode(int mode) Set time zone mode.
-
Field Details
-
BUNDLE_ERROR_CODE
- See Also:
-
BUNDLE_ERROR_MSG
- See Also:
-
RESULT_CODE_ERROR
public static final int RESULT_CODE_ERROR- See Also:
-
RESULT_CODE_SUCCESS
public static final int RESULT_CODE_SUCCESS- See Also:
-
-
Constructor Details
-
ClockCtrl
public ClockCtrl(Context context) Instantiates a new Clock ctrl.- Parameters:
context- the context
-
-
Method Details
-
setNTPServer
Set ntp server .- Parameters:
NTPServerURL- the ntp server url (String)- Returns:
- A bundle contains the error code and message
int errorCode = bundle.getInt("errorCode"), (error:1, success=0)
String errorMsg = bundle.getString("errorMsg");
-
getNTPServer
public Bundle getNTPServer()Get ntp server.- Returns:
- A bundle contains the error code and message
int errorCode = bundle.getInt("errorCode"), (error:1, success=0)
String errorMsg = bundle.getString("errorMsg");
String ntpServerUrl = bundle.getString("NtpServer");
-
setTimeMode
public Bundle setTimeMode(int mode) Set time mode.- Parameters:
mode- , 0 : manual mode, 1 : auto mode (int)- Returns:
- A bundle contains the error code and message
int errorCode = bundle.getInt("errorCode"), (error:1, success=0)
String errorMsg = bundle.getString("errorMsg");
-
getTimeMode
public Bundle getTimeMode()Get time mode.- Returns:
- A bundle contains the error code and message
int errorCode = bundle.getInt("errorCode"), (error:1, success=0)
String errorMsg = bundle.getString("errorMsg");
int timeMode = bundle.getInt(" TimeMode ")
0 : manual mode
1 : auto mode
-
setManualDate
Set manual date.- Parameters:
date- the date, String, ex: 31/12/2019 (day/month/year)- Returns:
- A bundle contains the error code and message
int errorCode = bundle.getInt("errorCode"), (error:1, success=0)
String errorMsg = bundle.getString("errorMsg");
-
setManualTime
Set manual time.- Parameters:
time- the time , String, ex: 23:59 (hour/minute) or 23:59:59 (hour/minute/second, with DMService ver1.2.7 after)- Returns:
- A bundle contains the error code and message
int errorCode = bundle.getInt("errorCode"), (error:1, success=0)
String errorMsg = bundle.getString("errorMsg");
-
getManualTime
public Bundle getManualTime()Get manual time.- Returns:
- A bundle contains the error code and message
int errorCode = bundle.getInt("errorCode"), (error:1, success=0)
String errorMsg = bundle.getString("errorMsg");
String manualTime= bundle.getString("ManualTime");
timeformat: dd/MM/yyyy HH:mm (or HH:mm:ss with DMService 1.2.7 after)
-
setTimeZoneMode
public Bundle setTimeZoneMode(int mode) Set time zone mode.- Parameters:
mode- 0 : manual mode, 1 : auto mode (int)- Returns:
- A bundle contains the error code and message
int errorCode = bundle.getInt("errorCode"), (error:1, success=0)
String errorMsg = bundle.getString("errorMsg");
-
getTimeZoneMode
public Bundle getTimeZoneMode()Get time zone mode bundle.- Returns:
- A bundle contains the error code and message
int errorCode = bundle.getInt("errorCode"), (error:1, success=0)
String errorMsg = bundle.getString("errorMsg");
int timeZoneMode = bundle.getInt("TimeZoneMode");
0 : manual mode
1 : auto mode
-
setTimeZone
Set time zone bundle.- Parameters:
timeZone- the time zone (String)- Returns:
- A bundle contains the error code and message
int errorCode = bundle.getInt("errorCode"), (error:1, success=0)
String errorMsg = bundle.getString("errorMsg");
-
getTimeZone
public Bundle getTimeZone()Get time zone bundle.- Returns:
- A bundle contains the error code and message
int errorCode = bundle.getInt("errorCode"), (error:1, success=0)
String errorMsg = bundle.getString("errorMsg");
String timeZone = bundle.getString("TimeZone");
-
setTimeFormat
public Bundle setTimeFormat(int timeFormat) Set time format bundle.- Parameters:
timeFormat- the time format , 24 or 12 (int)- Returns:
- A bundle contains the error code and message
int errorCode = bundle.getInt("errorCode"), (error:1, success=0)
String errorMsg = bundle.getString("errorMsg");
-
getTimeFormat
public Bundle getTimeFormat()Get time format bundle.- Returns:
- A bundle contains the error code and message
int errorCode = bundle.getInt("errorCode"), (error:1, success=0)
String errorMsg = bundle.getString("errorMsg");
int timeFormat = bundle.getInt("TimeFormat"); (12 or 24)
-