Мне нужно отслеживать местоположения пользователей с помощью фоновой службы, а затем загружать их и показывать путь к пользователю.
Используя активность, было довольно легко получить GPS-адреса, но когда мне нужно было это сделать через службу, я столкнулся с проблемой, поскольку она работает только для потоков петлителя (или что-то в этом роде).
Как я искал в Интернете решение, я узнал, что у многих людей такая же проблема, но я не нашел рабочего решения. Некоторые люди говорят, что вам нужно использовать prepare- > loop- > quit, а некоторые говорят, что вам нужно использовать handlerThread, но все же я не могу точно определить, как это сделать.