The Application automatically detects the driving mode and allows you to contact for up to three phone numbers of emergency in case of accident.
The three numbers will be contacted by sending a text message as ( custom emergency message) with the geographical coordinates of the accident site.
I have divided this project in to three phases ,
i) Detection of driving Mode:-(Intent Service)
I'm using Google Activity Recognition API to detect the driving Mode and logic behind it is , if ( DetectedActivityType="IN_VEHICLE" && Confidence > "90") then i will consider it as driving Mode
At the moment when i detect the driving mode , i'll start taking linear_acceleration readings as ( x-axis = Sensor.event, y-axis = Sensor.event ,z-axis = Sensor.event ) and i can have the values of gravity as well (x-axis = Sensor.event, y-axis = Sensor.event ,z-axis = Sensor.event ) and net gravity is constant, but corresponding x,y,z values of gravity changes as if you tilt the phone in different direction.
Generally, standard gravity value is around = 9.8 m/s2 and its direction is always towards ground.
we have x,y,z values of gravity. so,we can calculate angle between x-axis to standard gravity,similarly we can calculate for y,z axis. say(alpha,beta & gamma)
since, x,y,z axis is fixed to the mobile, so we can calculate linear_acceleration towards ground say (a_g) with help of a (alpha,beta & gamma).
Now, i'll take threshold value as 3g ( i,e 3 * 9.8)
iii) Send Message to concerned people ;-(Service)
At the moment when i detect the impact , I will invoke this service and send text message to the concerned people with geographical coordinates of accident site with the help of GPS.
I have successfully written code for the 1st and 3rd phase , but in the second phase i'm not able to get (alpha, beta and gamma) values correctly . My Query is whether the logic can be implementable or not , if yes, then please kindly help me out to calculate the values of alpha , beta ,gamma values.
Something must be done about this. Let's start by reading this tiny ad: