Baco or My Error

I’m using this code to prevent the Mobile can use a web project, but Android passes, while ipad and iphone are sent back to the home page

Function DektopTrue() As boolean

  Select Case Session.Browser
    
  Case WebSession.BrowserType.Android
    MsgBox("Web application is not compatible with the mobile Andorid, Ios, Windows ... only for PC and portable dektop.")
    return false
  Case WebSession.BrowserType.Blackberry
    MsgBox("Web application is not compatible with the mobile Andorid, Ios, Windows ... only for PC and portable dektop.")
    return false
  Case WebSession.BrowserType.Chrome
    
  Case WebSession.BrowserType.ChromeOS
    MsgBox("Web application is not compatible with the mobile Andorid, Ios, Windows ... only for PC and portable dektop.")
    return false
  Case WebSession.BrowserType.Firefox
    
  Case WebSession.BrowserType.InternetExplorer
    
  Case WebSession.BrowserType.Opera
    
  Case WebSession.BrowserType.OperaMini
    MsgBox("Web application is not compatible with the mobile Andorid, Ios, Windows ... only for PC and portable dektop.")
    return false
  Case WebSession.BrowserType.Safari
    
  Case WebSession.BrowserType.SafariMobile
    MsgBox("Web application is not compatible with the mobile Andorid, Ios, Windows ... only for PC and portable dektop.")
    return false
  Case WebSession.BrowserType.Unknown
    MsgBox("Web application is not compatible with the mobile Andorid, Ios, Windows ... only for PC and portable dektop.")
    return false
  End Select
  
  return true

End Function

It is a bug. Session.Browser is not Android.

Use instead

Instr(Session.Header("user-agent"), "Android") > 0

I filed a report

40760 - Web Session.Browser does not detect Android

Michel Bujardet Today at 5:42 PM
OS: OS X 10.11.0

Xojo: Xojo 2015r2.4

Steps: The Session.Browser does not detect adequately Android browsers (tested with native and Chrome browsers). It shows 2, just the same as Mac.

<https://xojo.com/issue/40760>

perfect!!