Real-Time Safety Alerts Using Smartphone Sensors