If I'm not mistaken, the most asked off-topic questions are about writing apps.
My suggestion is:
When a person tries submitting a question which includes the words "I'm working on an app" or anything similar to that, he should get a popup explaining that questions about writing or publishing apps, are off-topic.
Same should apply to anyone trying to dump a bunch of code into the question. That should easily be recognized by the system as a red flag.