I've recently uploaded a video to my tech-channel where I explain how to use an Android device as TV Remote.
After you verified that your phone has IR sensor, the istructions are the following ones:
1. Download UniMote or similar app from the following link: LINK
2. Follow app instructions and choose "IR Mode"
3. Choose your TV brand
4. Enjoy your new remote!


