Click here to Skip to main content
12,403,130 members (69,419 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: C# ASP.NET Mobile Blackberry , +
Hi,

Is there a way to detect BlackBerry Model in asp.net,

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/5.0.0.681 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/6.0.0.141 Mobile Safari/534.1+"

Thank's in advance for your Help
Posted 4-Jan-11 5:56am
Updated 4-Jan-11 6:00am
v2
Rate this: bad
 
good
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

http://51degrees.codeplex.com/releases/view/50532[^]

http://51degrees.codeplex.com/documentation[^]

This should allow you to determine device models without having to add lots of string parsing
  Permalink  
v3
Comments
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
 
good
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?
  Permalink  
v2
Comments
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!
mouadh trabelsi 4-Jan-11 12:09pm
   
I need blackberry model, because in my asp.net mobile application , the page layout and CSS must be updated from one model to another
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 3

  Permalink  
Comments
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
Web02 | 2.8.160721.1 | Last Updated 4 Jan 2011
Copyright © CodeProject, 1999-2016
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