A Methodology for Reliable Detection of Anomalous Behavior in Smartphones