PhoneGap: Improved automatic device detection