Activity recognition using onboard sensors in a smartphone