Adding preferences. Refactoring auto scan service control in MainActivity