This paper presents the design and implementation of Android-based cascade PID controller structures to control the altitude and attitude of a quadcopter, and the sensor fusion algorithms implemented to estimate its flight dynamics. The main goal of this research is to stabilize the attitude of an unmanned aerial vehicle (UAV), such as a quadcopter, and control its altitude using exclusively the sensors and processor of a smartphone on-board. As the sensors embedded in the smartphones are not accurate enough to measure the altitude of the quadcopter, a linear Kalman filter for relative altitude estimation was designed and implemented. Here, it is described precisely the hardware that was used to build the test platform, the non-linear an linearized quadcopter model, the software structure to execute the controllers in the smartphone, the sensor fusion algorithms implemented to obtain reliable data from the smartphone sensors, and the cascade PID controllers design. Finally, the success of the proposed system is evidenced in the results of a set of experimental tests. In these tests, the quadcopter attitude was regulated after some disturbances were applied to the system and its altitude was controlled after the reference was changed.