Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# ASP.NET 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 6:56am
Edited 4-Jan-11 7: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 at 4-Jan-11 12:07pm
   
My problem is how to detect BlackBerry Model, not to detect if the device connected is Blackberry
Dylan Morley at 4-Jan-11 12:17pm
   
Please see my updated answer
Manfred R. Bihy at 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 at 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 at 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 at 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
0 OriginalGriff 390
1 Sergey Alexandrovich Kryukov 329
2 BillWoodruff 210
3 Afzaal Ahmad Zeeshan 204
4 CPallini 185
0 OriginalGriff 5,515
1 DamithSL 4,451
2 Maciej Los 3,902
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,175


Advertise | Privacy | Mobile
Web04 | 2.8.141216.1 | Last Updated 4 Jan 2011
Copyright © CodeProject, 1999-2014
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