MADAM is a novel host-based malware detection system for Android devices that analyzes features at four levels - kernel, application, user and package - to detect and prevent malicious behaviors. It detects and blocks over 96% of malware from three large datasets containing around 2,800 apps using two parallel classifiers and behavioral signatures. Extensive testing on 9,804 genuine apps showed low false alarms, negligible performance overhead and limited battery impact. The multi-level approach of MADAM allows it to dynamically detect most current Android malware on-device with low overhead, addressing limitations of previous attack-specific solutions.