This sample code has been developed by Streamezzo.
Its purpose is to illustrate how to consult information from the device database provided by Streamezzo.

<%@page import="com.streamezzo.odp.connector.AdaptationTransaction" %>
<%@page import="com.streamezzo.odp.connector.StzConnectorsManager" %>
<%@page import="com.streamezzo.odp.connector.AdaptationConnector" %>
<%@page import="com.streamezzo.odp.adaptation.device.Device" %>
"
colorBits="8" lengthBits="16" resolution="2" idBits="16" scaleBits="15"
encodingType="0"/>
<%
// Get the connector using the ConnectorManager
AdaptationConnector adaptationConnector = StzConnectorsManager.getAdaptationConnector(stzRequest.getService(), 0);
// Begin a transaction for the current request.
AdaptationTransaction tx = null;
// Device info
String brand = "", model = "", inputs = "";
try {
tx = (AdaptationTransaction) adaptationConnector.beginTransaction(stzRequest, null, null);
Device device = tx.getDevice();
brand = device.getBrand();
model = device.getModel();
if (device.hasKeypad()) {
inputs += "[keypad]";
}
if (device.hasTouchscreen()) {
inputs += "[touchscreen]";
}
stzRequest.getLogger().debug("Device info:"+device.toString());
%>
" horizAlign="CENTERED"
vertAlign="MIDDLE"/>
" horizAlign="CENTERED"
vertAlign="MIDDLE"/>
"
horizAlign="CENTERED" vertAlign="MIDDLE"/>
<%
} finally {
if (tx != null) {
tx.endTransaction();
}
}
%>
| Attachment | Size |
|---|---|
| Device_information.swz | 612.11 KB |