Take a tip from app developers and game designers to commit to a new habit.