Create an app that launch when the phone rings

Hi guys,

I am working on a project that launch an app when the phone rings just like Truecaller, please how is that achievable and how can it be done.

Thanks