Click here to Skip to main content
13,054,329 members (122,210 online)
Rate this:
Please Sign up or sign in to vote.

Is there a way to detect BlackBerry Model in,

I have made some search on the net but i have not find a solution

I try to use userAgent information , but it seem's that the format change from one version to another,

for exemple for BlackBerry 8900 ,
Request.UserAgent = "BlackBerry8900/ Profile/MIDP-2.1 Configuration/CLDC-1.1 VendorID/-1"

for BlackBerry Torche :
Request.UserAgent = "Mozilla/5.0 (BlackBerry; U; BlackBerry 9800; en-GB) AppleWebKit/534.1+ (KHTML, like Gecko) Version/ Mobile Safari/534.1+"

Thank's in advance for your Help
Posted 4-Jan-11 5:56am
Updated 4-Jan-11 6:00am
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

You can just use string.Contains to see if the agent has 'Blackberry' within it

Something like..

string agent = Request.UserAgent;
if (agent.ToLower().Contains("blackberry"))
    // whatever

This should tell you that the client is using a blackberry device, but nothing more specific than that. Is that what you wanted?

Edit after Comment:

Possibly look into the 51degrees mobile device detection project which uses the WURFL device database[^][^]

This should allow you to determine device models without having to add lots of string parsing
mouadh trabelsi 4-Jan-11 12:07pm
My problem is how to detect BlackBerry Model, not to detect if the device connected is Blackberry
Dylan Morley 4-Jan-11 12:17pm
Please see my updated answer
Manfred R. Bihy 4-Jan-11 12:36pm
Good one! 5+
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

This is really an issue of the browser running on the BlackBerry. You would need to know what browsers are available for BlackBerrys and research there.

May we all know why you need the exact model description?
mouadh trabelsi 4-Jan-11 12:09pm
I need blackberry model, because in my mobile application , the page layout and CSS must be updated from one model to another
Manfred R. Bihy 4-Jan-11 12:28pm
I see, that is what I had suspected. Look at Manas answer on this page, it looks promising. Cheers!
Rate this: bad
Please Sign up or sign in to vote.

Solution 3

Manfred R. Bihy 4-Jan-11 12:37pm
Good one!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web01 | 2.8.170713.1 | Last Updated 4 Jan 2011
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100