Applied suggested changes by @jlipps by moving the methods into device.js and adding them to the iOS and Android prototype.