Detect default android browser by Wurfl

370 Views Asked by At

I want to detect default browser of android inside my MVC controller. I have mobile detection right now:

public ActionResult Index()
{
    if (WurflHelper.Instance.IsMobile(Request.UserAgent))
    {
        return View("MobileView");
    }
    else
    {
        return View();
    }
}

How can i detect android default browser (not chrome). I need UserAgent parameters matches for this detection. Thanks for advice.

--------------EDIT--------------------------------------------------------------

i found this solution for client (javascript) : How to detect the stock Android browser. I need same solution for asp.net MVC

2

There are 2 best solutions below

1
शेखर On

You can use this Request.Browser to get the browser info. Below is an example

var moo = Request.Browser;
var Name =  moo.Browser;
var Version =  moo.Version; 
var Major_Version = moo.MajorVersion;
var Minor_Version =  moo.MinorVersion;
0
Elliot Fehr On

I noticed that you are already using WURFL to detect the device. You could simply use the mobile_browser or advertised_mobile_browser capability to determine the browser of the device.