I want to learn how to control hardware things like rotate a motor or sensors with android apps. Can you please suggest me how can i do that.
the question is very wide and can have many answers but, at the very end, what you need is a software-hardware interface. In other words you need "something" that interprets the software commands implemented in your App and translates them in actuations.
To this purpose I suggest to use simple and "low cost" Arduino boards that you can drive from APPs by using i.e. Bluetooth connection (Apps -> Bluetooth -> Arduino -> Hardware to be driven). Any simple Arduino (or similar) board features many analogue and digital Input and Output channels, so you can connect almost any type of physical actuator. In addition to this, on the web you can find tons of libraries ready to be used on Arduino boards. Finally, the Arduino C (like) language is very simple and can be learnt in a little time.
Of course this is only one of the possible solutions or, at least, this is the one I use
Another solution is to drive your IoT directly from the web by using a web component and an ESP8286 board (programmable by using the same Arduino IDE). This is a bit tricker, but feasible as well with a little effort at the beginning ....
I have uploaded these tutorials on this topic to this community, you may be interested in taking a look.
Arduino + Bluetooth HC-06
Arduino + Bluetooth HM-10 BLE
ESP32 - BLE (Bluetooth)
ESP32 - WiFi.
ESP32 - MQTT
ESP8266 - WiFi