Because Video Kiosk was designed to be remotely managed, it supports both sending status tracking reports to a URL and receiving responses so you can integrate Video Kiosk remote devices into a management system. Video Kiosk Android examines the response to the HTTP/HTTPS POST for key value pairs that it will use to update the management interface settings. This allows your management system to receive status tracking reports from each device and for your devices to receive instructions from the management system.
A management status POST can be sent:
- based on a time interval
- based on a specific time of day
- any time using the Send Management Report button on the button bar
To set up device status tracking, follow these steps:
- If you plan to send HTTPS posts instead of HTTP posts, get an SSL certificate. For more information, see [HTTP vs HTTPS considerations] below
- In the Video Kiosk settings, Video Kiosk Settings Screen>Management configure the following:
- readable Device ID and Zone (optional settings for your convenience)
- When to report status
- URL to report status to
- Content of the Post
Video Kiosk devices will now send posts to the specified URL.
If you plan to send the Video Kiosk Device password as a means of authenticating the post, you should use HTTPS posts instead of HTTP because it is not a good idea to send password data in the clear. To use HTTPS, you must get an SSL certificate from a certificate authority that the Android OS recognizes. Video Kiosk does not support HTTPS POST to sites using self-signed certificates.
The following keys will always be included in the POST:
- The unique id of the device assigned by the Android OS.
- The unique id of the device as assigned by you. By default this is the unique id assigned by the Android OS but you can change it to be any string that you like.
- The Video Kiosk version name like 22.214.171.124529.
The following keys can be included in the POST by selecting them in the Management Settings (Video Kiosk Settings Screen>Management>Management Post Content)
- A flag that will be true if a video is playing or false otherwise. Be careful interpreting the value since it can be false if an image file is being displayed or if one video has ended and its last frame is being displayed while the next video is preparing to play but has not yet rendered its first frame.
- The name of the currently playing video or displayed image file. By default this key value pair is enabled.
- The names of all the movies and images in the currently selected media folder.
- The password assigned to the Video Kiosk using the someword.password file. You can use this to authenticate the Video Kiosk POST and should use HTTPS since its not a good idea to send the password in the clear.
- The zone of the device as assigned by you. This is assigned by you and is used to create any grouping of devices that you would like.
- A flag that will be true if a the device has been granted root access or false otherwise.
- The time, in seconds, since the last device reboot
- An array of file sizes that matches the array of file names
- An array that lists any files that are empty (usually due to a network error during file synchronization with your cloud service).
In the Video Kiosk Management settings you can:
- Change the unique device id
- Change the device zone
- Set the interval time, in minutes, at which Video Kiosk will send the POST
- Enable or disable sending the POST using the interval time
- Set the time of day, in hours and minutes, at which Video Kiosk will send a POST
- Enable or disable sending the POST using the time of day
- Configure the URL to which the POST will be sent
- Enable or disable the optional key value pairs that can be sent in the POST
Whenever you change the settings, Video Kiosk will restart the interval time. If you have enabled the time of day status POST, Video Kiosk will synchronize the interval time with the time of day when that POST is sent.
The management interface supports responses by the management system to management status POST, such that the management settings on the device can be changed by the management system.
The management system may respond with a list of key value pairs as follows:
\n means newline as defined in the PHP scripting language.
The values are encoded using the Android URLEncoder and the UTF-8 character set. PHP programmers that use $_POST variables should decode these values using the urldecode() method. PHP programmers that use $_REQUEST variables should not decode the values since they have already been decoded.
The supported key value pairs are:
reporttime=HH:MM (where 0 >= HH <= 23 and 0 >= MM <= 59)
intervaltime=NNNN (where NNNN > 0)
Its important to note that if both intervaltimeenabled and reporttimeenabled are set to false you will stop that device from reporting status. If you do that via a management POST response then management posts can only be restarted manually from the device.
If the \n characters are omitted Video Kiosk will ignore the key value pairs. You MUST include the newline character for every key value pair.
The following PHP script can be used to send an email containing status tracking POST data to whatever email account you would like. You just need to change the values of $to_email, and $from_email and then put the script on your web site in a file named something.php. If you need more information contact us and we can help you.
$to_email = ‘firstname.lastname@example.org’;
$from_email = ‘email@example.com’;
$subject = ‘VidoeKiosk Status’;
foreach ($_POST as $key => $value)
$message .= htmlspecialchars($key).” = /”.htmlspecialchars(urldecode($value)).”/\n”;
$headers = ‘From: ‘ . $from_email . “\r\n” .
‘X-Mailer: PHP/’ . phpversion();
mail($to_email, $subject, $message, $headers);