There are a couple of items here:
1) Having a patent does not mean you are free and clear to make or sell the app. Here is a post I wrote on this:
https://patentfile.org/your-patent-is-not-a-green-light-to-sell-a-product/2) If your goal is to just prevent others from patenting the same thing, the cheapest way to do that is to publish your app and details about it (for example you could blog about it on medium.com or github). Your public work could then be used to reject anyone else's patent if they later tried to patent the same thing.
3) I really only know about US patent strategy but my understanding is that apps are just about impossible to patent outside of the US and even in the US they are extremely hard to get approved (usually less than 30% chance of approval unless the app solves a very technical problem).