Is that possible to get phone model in WRT widget? Seems the User-Agent doens't work, it's Safari.
Is that possible to get phone model in WRT widget? Seems the User-Agent doens't work, it's Safari.
Hi,
You may find the name of the device in JS's 'navigator.userAgent'. My simple widget shows on N95-8GB: "Mozilla/5.0 (SymbianOS/9.2; Series60/3.1 NokiaN95_8GB/15.0.015; Profile/MIDP-2.0 Configuration/CLDC-1.1 U; ) AppleWebKit/413 (KHTML, like Gecko) Safari/413" (similar results you get on 3rd ed. FP2 and 5th ed. emulators). When you know the pattern, you only need to parse this string.
Weird things comes when you check 'navigator.appName' string ('Netscape') and 'navigator.appVersion' ('7' on 3rd. ed. FP2, '5' on 5th ed. emulator)
BTW, there's always a way to access almost everything... you may write a simple local server (e.g. in C++ or Python) that will provide such type of information and then access it from your widget e.g. via HTTP and your own protocol.
BR,
Jacek
Last edited by jack44; 2008-12-09 at 15:27. Reason: after some testing...
Hi,
You can use Platform Services to retrieve device information.
code snippet:
var so = device.getServiceObject("Service.SysInfo","ISysInfo");
var criteria = {
Entity: Device,
Key: PhoneModel
};
var result = so.ISysInfo.GetInfo(criteria);
if( result.ErrorCode == 0 )
var phoneModel = result.ReturnValue;
refer http://library.forum.nokia.com/index...6BF_cover.html
~AJ