Accident prevention systems have recently been a part of many modern cars to reduce injuries and casualties on the road. However, the high cost of components and equipment have limited such safety systems to higher-end and luxury vehicles. This paper proposes an economical method of using a smartphone application for real-time lane detection and rear-end collision warning system for drivers on the road. The Android-based application uses image-processing algorithms coupled with the monoscopic camera on the smartphone as the main sensor to perform lane and vehicle detections. The novelty of this work lies in the use of the monocular vision of the camera to estimate the distance with the vehicle up ahead. The system is able to distinguish unintentional lane departure and if the driver is traveling too close to the vehicle ahead. An acoustic warning will notify the driver of a potential accident.