How to detect if the device is android mobile or tablet

I know how to detect if a device is iOS or Android, but how could we know if it’s a tablet or mobile?
I have the same doubt for iOS.

http://ralphbarbagallo.com/2012/08/10/detecting-android-tablets-and-phones-in-unity3d/

Maybe this can do something for you.

This is the search it came from.

https://www.google.co.uk/search?q=unity+android+detect+phone&ie=utf-8&oe=utf-8&gws_rd=cr&ei=3KONVc-aM-ud7gbV666AAw

Try SystemInfo.deviceModel.

I’m not aware of any function that will directly tell you if a device a tablet or mobile. SystemInfo.deviceType will only tell you if the device is a handheld or not.