Classification of Blackberry devices by using useragent
Asked Answered
J

1

0

I need to classify blackberry devices based on OS version.

if BB5 and BB6 then {do this}

if BB7 and above then {do this}

I knew, BB 5 useragent looks like this :

BlackBerry9700/5.x.x.x Profile/MIDP-2.1 Configuration/CLDC-1.1 VendorID/229

BB 6 onward useragent is :

Mozilla/5.0 (BlackBerry; U; BlackBerry 9800; zh-TW) AppleWebKit/534.1+ (KHTML, like Gecko) Version/6.x.x.x Mobile Safari/534.1+

So, How can i classify 5&6 and 7&above?

Jackfruit answered 14/5, 2012 at 4:53 Comment(1)
I've come back to this Question to follow up on. If my answer here is satisfactory, please Accept this answer so this question is resolved. Thanks!Abrasive
A
2

The open source Detect Mobile Browsers script may be what your looking for.

When visiting that webpage, which also contains the links to download the script in a plethora of formats, it will show you the relevant information via a live example.

On my desktop PC which isn't a mobile device, I receive this info:

No mobile browser detected.
Mozilla/5.0 (Windows NT 5.1; rv:12.0) Gecko/20100101 Firefox/12.0

http://detectmobilebrowsers.com/

P.S. If you do use that script note Boolean true or false on the variable is to be used (i.e., use !! before variable name to test for false).

Here is jsfiddle example that I completed so you can test with your Blackberry Device.

http://jsfiddle.net/sPBrL/4/

Abrasive answered 14/5, 2012 at 5:14 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.