We started with Android Studio
In order to achieve communication with the Bluetooth component class in which the device information associated with our phone was represented I was used, as we observe the classes dispositivosBT work with APIs and created for the BT connection, which through methods of the system as onResume are where we extract the list of connected devices, onItemClic in this event will make the connection of a device by clicking on its name, and we have a method that allows us to check the status of dispoditivo that we want to connect
In the second class, will handle the system interface our robot, here the results that occur in the execution system such as the distance from the robot and the distance is sent to the engines represent the main operation lies in the method main onCreate in which the first step is to load our file loggia difuza one you see echo this proceed to retrieve the values of the distance sensor from the BT module arduino, with the value obtained evaluate the rules and get the value of speed again I will be back to arduino to control the motors.