Get the type of device your program is running on. Code taken from: https://gist.github.com/Jaybles/1323251 (and some other unknown location, I forgot...) and added on to.