beta
Hello developer. Login with your existing account. New to Vodafone Developer? Register your account.

+ Login or create an account

Blog - Tag: css-media-queries

How to Calculate the Device PPI

In the mobile phones context, PPI (pixels per inch) is a measurement of the resolution of devices screens. A higher PPI means better/clearer images. PPI can also be used to identify devices.

The following Javascript code presents a method to calculate the PPI and to identify the device:


function getPPI(){
  var DOM_body = document.getElementsByTagName('body')[0];
  var DOM_div = document.createElement('div');
  DOM_div.style.width = "1in";
  DOM_div.style.visibility = "hidden";
  DOM_body.appendChild(DOM_div);
  var ppi = document.defaultView.getComputedStyle(DOM_div, null).getPropertyValue('width');
  DOM_body.removeChild(DOM_div);
  return parseInt(ppi, 10);
}

var ppi = getPPI();
var device = '';
switch(ppi) {
  case 265: device = 'Samsung ...

A JIL/W3C mobile widget can run in one of the 3 modes: full screen, floating, docked. All runtimes (Samsung, S60, Android) support the full screen mode, but the floating mode is supported only by Samsung (H1/M1) and docked mode is supported only by S60.

The floating mode is that state where the widget runs on the home screen, in a square container, the size of 4 widget/application icons. Multiple widgets can run in floating mode at the same time.

In order to enable floating mode for a widget, the following setting is required in the config.xml ...


This is the first in a series of posts that will attempt to address building mobile widgets that will scale properly between multiple devices. We will look at how we can deal with multiple screen resolutions, varying screen PPI (pixel per inch) densities, as well as gracefully switching between portrait and landscape modes.

This article is going to build on the concepts that were introduced in the “How to really cope with varying screen sizes and pixel resolutions in Vodafone Widgets”. Here we will actually build a sample widget that scales dynamically.

This post is going to set the stage ...


The Wholesale Applications Community (WAC), an alliance of telecommunications companies committed to building an open applications platform, today announced its formation as a corporate entity, as well as the organisation’s leadership and board of directors. The company also announced that it will join forces with the Joint Innovation Lab (JIL), accelerating the commercial launch of WAC-enabled application stores.

At launch, WAC will allow operators to distribute applications through their respective application storefronts and charge users through their existing phone bill.  In this model, developers will set the application price and will receive a revenue share for the transaction. The ...


Vodafone launches Mobile Clicks 2010, an international contest to find the best mobile internet startups. After last year’s success in the Netherlands and United Kingdom, this year's event will also be open to startups from Portugal. The best entrants from each country in the competition will compete for a total prize fund of 150,000 Euros! Finalists from each country will go to the PICNIC event in Amsterdam, September 24th, where the winner and runner up will be selected.

Registration for this contest will start on July 27th, 2010 and end at midnight on August 22nd, 2010. Find ...


The sizing of text and graphical elements on different displays is a fairly complex problem in Web development. It is different to what you simulate when you drag your browser window to different sizes – because it is more about the pixel's physical size. A working solution to this is built into the Vodafone Widget Manager and it's only based on standards: CSS, CSS Media Queries and JavaScript.

Pixel-Density

Displays have two obvious characteristics: The sheer physical size and the number of pixels they are made of, often called "resolution". However these two are actually combined into a third ...


Categories