Assistance Required for Android and Arduino Bluetooth Interface

Hi, I am working on a car for school project(due April 7) that uses Servo for Steering and Motor (with L298N Motor Driver) for Acceleration/Deceleration.

I made an App on Android and I was successful on interfacing Android with Arduino, I can send in data from Android, and Arduino is able to read those values.

I wanted to know how should i setup so that when I tilt my screen left or right(Accelerator) my Servo will steer left/right and if I use SeekBar, then my motor will accelerate/decelerate. What kind of values should i send it from Android and how should I use the value received in Arduino. An example would be very helpful.

Here is a preview of how my App currently looks like:
http://s15.postimg.org/8nxm6qhff/Screenshot_2014_04_05_20_13_59.png

Thanks Alot!

SiL3NTK0D3R:
What kind of values should i send it from Android and how should I use the value received in Arduino.

You have a completely free choice - just make sure you implement the same protocol on the sender (Android) and receiver (Arduino).

What kind of values should i send it from Android and how should I use the value received in Arduino.

Well, that depends on the code you are currently using on the arduino to perform the operations. Always useful to post your current code.

Hi, this is my code for the Android that sends the Data

public void writeData(String data)
	{
		try
		{
			outStream = btSocket.getOutputStream();
		}
		catch(IOException e)
		{
			Log.d("silentcoder", "[BEFORE] could not send data");
		}
		
		String message = data;
		byte[] msgBuffer = message.getBytes();
		
		try
		{
			outStream.write(msgBuffer);
		}
		catch(IOException e)
		{
			Log.d("silentcoder", "could not send data", e);
		}
	}

Here is how i send the servo data using the method

writeData(data + "\n");

Here is how i receive the data in Arduino

void loop()
{ 
  // if there's any serial available, read it:
  while (Serial.available() > 0) {
    
    // look for the next valid integer in the incoming serial stream:
    motor = Serial.parseInt();
   
    // do it again:
    pos = Serial.parseInt();
  
    // look for the newline. That's the end of your  sentence:
    if (Serial.read() == '\n') {
              
       myservo.write(pos);              // tell servo to go to position in variable 'pos'
       delay(15);                       // waits 15ms for the servo to reach the position
      
    }
  }
}

Is there any efficient way to send/receive the data?

Thanks