move the polling logic into a Service so as to not block the Main thread

move the polling logic into a Service so as to not block the Main thread