How to detect incoming phone calls and get number?

Hello, I have already posted a question here please check it out. Question