NetTalk Central

Author Topic: How to detect Android  (Read 2346 times)

John Fligg

  • Sr. Member
  • ****
  • Posts: 361
    • View Profile
    • Ambrit Software
    • Email
How to detect Android
« on: February 25, 2012, 08:39:28 AM »
I know Bruce has put some new code in to test the screen size and want to use this in conjunctions with something else.

I have clients using Samsung Galaxy tablets which operate using Android. So when the app starts it is in mobile mode with the black screens.

I need to switch this to "normal" non mobile mode.

So whilst I can detect the screen size, is there a way to also detect if it is Android that is the OS?

This only seems to be a problem with Android and I think Bruce confirmed that NT6 assumes Android to be "mobile".

Thanks

John

Rob de Jager

  • Jr. Member
  • **
  • Posts: 54
    • View Profile
Re: How to detect Android
« Reply #1 on: February 25, 2012, 09:27:19 AM »
The user agent (server side) typically will display something like the following:
User-Agent: Opera/9.80 (Android 2.3.4; Linux; Opera Mobi/ADR-1202011015; U; en) Presto/2.9.201 Version/11.50

So "look" in the p_web._UserAgent property, and set the p_web.mobile property accordingly.

Cheers

Rob