How can I implement a popup overlay for an app that can be displayed over any other app. 

Facebook implemented a very similar feature called Chatheads in its new Facebook Messanger version. I was really surprised to see that this is some how possible. On the image, you see a chathead (dog on the right) over another app. 

![Facebook Messanger's Chathead over other app](https://i.stack.imgur.com/hWk4r.png)