So exactly how do you build spyware into your apps?

Developers have to answer a lot of questions when building apps but one question that doesn’t have a clear answer is how do you build spyware into your apps?