Key things to remember:
- Don't install apps just because they promise you something "for free". E.g. many apps access your Contacts list when they don't need to, simply because many people agree to it without thinking about the danger.
- Check the permissions you give to any apps you do install and switch off anything that you don't think they ought to have. On Android phones: Settings > Application Manager > Select the app > Permissions > then switch off anything you don't think the app deserves to have or needs to function. In the above case, the apps presumably use the microphone, so switching that off will stop the ultrasonic tracking.
- For other general privacy tips for iPhone and Android (and other systems), you can go to advice given by DuckDuckGo, the privacy-oriented search engine creators: https://spreadprivacy.com/privacy-tips/home