Controlling DC motor from Android device
The short answer is "you can't." For the Arduino to do anything useful it needs to have instructions telling it what to do. In your example the Arduino's job is to do something that the Android can't – turn on and off the DC motor. You could even use a wifi or Bluetooth connection from the Android to the Arduino to make it possible to avoid the hassle of the USB cable.

Your project requires a number of small hunks of code on the Arduino to:


Listen for commands from the Android.
Validate the commands received.
Turn on or off the motor.


Roughly speaking your loop() function might look something like this:

void loop() {
  // look for a command
  // validate the command
  if (valid &amp;&amp; turn_motor_on) {
    motor_on();
  } else {
    motor_off();
  }
}


Fortunately the Arduino code can be very simple and there is a lot of example code to help you get started.