Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

What would be the best approach to reset a mobile app's content/settings?

Lets say the app is cross platform: apple/android using javascript/phonegap. The current way this is designed is to have an admin area that can see mobile devices (users which have logged in). The admin has the ability to flag a device for reset.

The app regularly polls the server to see if it should be reset. Resetting will be rare, but the polling is not. The polling doesn't cause any performance issues but it seems off to constantly be asking the server whether or not to blow up the app.

A push rather than a pull method would be nice but I'm not sure what this would look like.

Does anyone have any alternative design suggestions? Are there any drawbacks to the current design?

share|improve this question
1  
Is this a design pattern question? –  JeffO Apr 10 '13 at 15:35
2  
Why do you think that a design pattern (Factory, Flyweight, Iterator, Facade, etc...) would help solve this problem? Not everything is a design pattern. –  MichaelT Apr 10 '13 at 15:41
    
Thanks for the correction. I meant best practice as was fixed by Caleb. –  coder Apr 10 '13 at 16:37

1 Answer 1

up vote 5 down vote accepted

Both Android and iOS support some form of push notifications. You should absolutely take advantage of those to deliver your reset messages rather than polling. Running radios unnecessarily can be a huge battery drain, and shifting the responsibility for delivering the reset message to the operating system will be a significant improvement.

If you aren't able or don't want to set up the necessary server side of the push notification equation, there are third parties like Urban Airship and OpenMarket that will be happy to do it for you (for a fee, naturally).

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.