×
Namespaces

Variants
Actions

Getting MCC, MNC and Device model in Nokia Asha Web Apps 2.0 Beta

From Nokia Developer Wiki
Jump to: navigation, search

This article explains how to obtain MCC, MNC and Device model in Nokia Asha Web Apps 2.0 Beta

Article Metadata
Code Example
Source file: Media:MCCMNC.wgt
Tested with
SDK: Nokia Web Tools 2.0 Beta
Devices(s): Nokia X3-02, Asha 311
Compatibility
Platform(s): Nokia Web Apps 2.0
Article
Created: isalento (25 Jun 2012)
Last edited: hamishwillee (09 May 2013)

Contents

Overview

One of the new interesting features of Nokia Browser 2.0 for Series 40, is ability to access Mobile Country Code (MCC), Mobile Network Code (MNC) and Device model via JavaScript API. MCC / MNC tuplet can be used to identify mobile phone carrier. MNC list can be found from Wikipedia. However, in Nokia Asha Web Apps, more likely use case is to only use MCC to detect from which country the user is coming. When country is known, locally relevant data or focused advertisements can be offered to end user. MCC does only tell the country where the user is coming, if you need to have accurate position information rely to WC3 Geolocation API. Strength of the MCC is that, there is no permission prompts and it is readily available.

MCCMNC.png

API

Nokia Browser 2.0 offers MCC, MNC and Device model information, trough extending Navigator interface.

New Properties in Navigator object in Nokia Browser 2.0

New Properties in Navigator object
deviceModel Returns device model e.g X3-02
homeCountry Returns Mobile Country Code, MCC
homeCarrier Returns Mobile Network Code, MNC

Code Example

Code below demonstrates how properties can be accessed. To see how MCC can be mapped to specific country, check out attached MCCMNC.wgt Web App.

var deviceModel = navigator.deviceModel;
var MCC = navigator.homeCountry;
var MNC = navigator.homeCarrier;
This page was last modified on 9 May 2013, at 13:36.
127 page views in the last 30 days.
×