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

Native Development

Posts: 188
Registered: ‎07-19-2012
My Device: Z10 LE
My Carrier: Three

Get device model identifier


I'm currently developing a twitter client as a way of learning Cascades development. To help get a feel for how the user would interact with cascades, and because I much prefer developing for a physical device, I've installed Blackberry 10.0.06 on my Playbook by, shall we say, warranty-voiding means.


However, this means the playbook handles web links differently to the simulator due to it keeping the older Playbook browser. The playbook won't recognise the navigator_invoke() for PIN-based authentication with Twitter (whereas the Simulator does), while the simulator won't allow direct OAuth authentication via a WebView. This means that while both can authenticate with Twitter, the two different devices need to do it in separate ways.


Is there a way of finding the model name or identifier for the device the app is running on? If I can use this information in an if statement then it'll make authentication a lot easier.

Did this post help you? If so, please make sure to "like" it!
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: Get device model identifier

What about using environment variables? On the Dev Alpha, you could see PLATFORM=Colt, or perhaps extract something from uname_m=OMAP4460_ES1.1_HS_Colt_Rev:06. I can only assume that, having put 10.0.6 on the PB, it's not going to report identical information for the latter, in any case, since it has a different CPU.

There are other ways, but since this is a temporary hack this should suffice, and it's short and sweet.

Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!