CLICK THE GREEN FLAG TWICE TO START. Look inside this project, you are welcome to use the code I am using to detect your device.
I'd say, 70% of the time it is correct.