Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Reply
New Contributor
Posts: 9
Registered: ‎05-16-2012
My Device: 1
My Carrier: 2
Accepted Solution

Detecting device model

Hi, I need to detect the device model that my webworks app is running on. For java apps there is a deviceInfo object that you can query to get this info. Is there an equivalent for Webworks? Cheers Sab
Developer
Posts: 134
Registered: ‎05-19-2012
My Device: Torch 9800, PlayBook 64GB, Dev Alpha
My Carrier: VIVO Brazil

Re: Detecting device model

[ Edited ]

Take a look at Cordova example here, specially the deviceInfo() function:

 

function deviceInfo() {
  document.getElementById('window.device.platform').innerHTML = 'window.device.platform = ' + window.device.platform;
  document.getElementById('window.device.version').innerHTML  = 'window.device.version  = ' + window.device.version;
  document.getElementById('window.device.uuid').innerHTML     = 'window.device.uuid     = ' + window.device.uuid;
  document.getElementById('window.device.cordova').innerHTML = 'window.device.cordova = ' + window.device.cordova;
}

 



If I was helpful please like this post to support my work. :smileyhappy:

If I helped you please click the "Like" button to support my work.
My apps: CherryNotes - Bookmarked - Requests
Social Me: about.me - Twitter
Trusted Contributor
Posts: 134
Registered: ‎04-15-2012
My Device: Bold 9900
My Carrier: Vodafone

Re: Detecting device model

New Contributor
Posts: 9
Registered: ‎05-16-2012
My Device: 1
My Carrier: 2

Re: Detecting device model

Hi Zahirw, Thanks, that's what I was looking for. Add blackberry.system to the features in config and the model no is in blackberry.system.model. nathanpc, that looks to be something provided by phonegap, there's no device property on the window object when I debug my app... Cheers Sab
New Contributor
Posts: 9
Registered: ‎05-16-2012
My Device: 1
My Carrier: 2

Re: Detecting device model

God, why does this stupid forum remove all the formatting? I don't run javascript, get over it!