Home / Utilities
Utilities Home Alembik uaprofile2wurfl.php Gimme UAProf and I'll give you WURFL Alembik Alembik Media Transcoding Server is a Java application providing transcoding services for a variety of clients. GAIA Reply GAIA Image Trascoder Open Source library that operates image transcoding, with a special focus on mobile applications. WURFLTera Tera-WURFL Use MySQL as a WURFL-powered backend!!! WURFL Utilities mDevInf GUI to query *your* WURFL, by James McLachlan Device Thumbnails Device Thumbnails Add device thumbnails to your appliction! PHP Image Rendering Library (II) Dynamically resizing pictures in PHP (a new one) PHP Image Rendering Library Dynamically resizing pictures in PHP BeeWeeb's MWT Mobile Web Toolkit Open Source library that talks to the same publishing system as your website, but generates a mobile site. Wallify Wallify Turn a CHTML site into a WALL site. Image Server Image Server A Java Servlet (and filter) that will intercept requests to picture and resize the picture appropriately by looking at the screen size. Very Cool! Apache Filter Apache Mobile Filter is an Apache module that detects the mobile device and passes the WURFL capabilities on to the other web application as environment variables. It can also be used to resize images on the fly to adapt to the screen size of the mobile device. |
Device Thumbnails
Andre used a bunch of time to collect pictures on the internet, reducing the graphics to thumbnails with common height and size. He also renamed the pictures to use the WURFL ID. vThis would give us a way to asociate a WURFL device with it's picture. Only problem was the firmware subversion. For example: nokia_6620_ver1_sub2014 and nokia_6620_ver1
should receive the same thumbnail, but this is not straightforward, since the two devices have two different WURFL IDs. This problem has been solved by adding a new WURFL API that, given a DeviceID, will return the anchestor which is an "actual_device_root". getActualDeviceAncestor(DeviceID)The result can be seen in the following picture. Actual devices and their subversion get the same picture :
Figure 1: WURFL Browser with Thumbnails. Please note that this improvement to the WURFL Browser in the Java package is not available in the current release of the WURFL API. If you can't hold your breath for the next release, I will explain at the end of this document how to patch the WURFL API and the WURFL browser to get the good stuff right away (See "Improvement to WURFL Browser"). First, though, here is the package with the picture. The readme.txt file
reads:
The pictures in this archive have been found on the internet, resized and renamed for the purpose of the WURFL open-source project. In case, you are the copyright owner of one or more of these pictures, please notify andrevdh@ (obfuscated, but it's the Gmail thing) and the picture will be promptly removed.In other words, we don't want to steal anything from anyone ;) Download The pictures can be downloaded in one shot from this ZIP file. Contributions to Thumbnails archive Please note that we started with GSM devices, so you are unlikely to find many US and Japanese devices. If you have pictures to contribute, please contact Andre directly. At the very least you should have the picture and the model name and manufacturer. If you also complied to the following, it would be ideal, but this is not strictly necessary.
Improvement to WURFL Browser If you want to use the the thumbnails in the WURFL browser (or in other applications), here are the changes you need to make in the distribution: viewdevice.jsp
<%
String id = new String(request.getParameter("id")) ;
HashMap deviceElementsList = lm.getDeviceElementsList();
HashMap logr = lm.getListOfGroups();
WurflDevice dev = (WurflDevice) deviceElementsList.get(id);
String fb, ua, ancestor_actual_device;
fb = dev.getFallBack();
ua = dev.getUserAgent();
ancestor_actual_device = cm.getActualDeviceAncestor(id);
String model,brand;
model = cm.getCapabilityForDevice(id,"model_name");
brand = cm.getCapabilityForDevice(id,"brand_name");
%>
<table>
<tr><td>
<img src="device_pix/<%= ancestor_actual_device%>.gif">
</td><td>
Device: <b><%=id%></b><br>
User-Agent: <code><%=ua%></code><br>
<% if (!fb.equals("root")) { %>
Fall-back:
<a href="viewdevice.jsp?id=<%=fb%>"><%=fb%></a><br>
<% } %>
Brand and Model: <%=brand%>, <%=model%><br>
</td></tr>
</table>
Wurfl.java
//Get ancestor which is an actual device
public String getActualDeviceAncestor(String devID) {
if (devID == null || "generic".equals(devID) || "".equals(devID)) {
return "generic";
}
Element el = (Element)deviceElementsList.get(devID);
if ("true".equals(el.getAttributeValue("actual_device_root"))) {
return devID;
} else {
return getActualDeviceAncestor(el.getAttributeValue("fall_back"));
}
}
CapabilityMatrix.java
/**
* Given a device ID returns
*
* Device ID of ancestor which is an actual device root
*
* This is an Utility. No caching.
* This API is probably only useful if you are building
* an utility to browse the WURFL.
*/
public String getActualDeviceAncestor(String devID) {
//this is an utility. No caching
return wu.getActualDeviceAncestor(devID);
}
Enjoy! |