Use of Inertial Dead Reckoning and Activity Recognition to Enable Always-On, Low-Power Contextually Aware Applications in Mobile Devices