Constraint-Aware Data Analysis on Mobile Devices: An Application to Human Activity Recognition on Smartphones. An Application to Human Activity Recognition on Smartphones