Answer the question
In order to leave comments, you need to log in
How to competently make continuous gps tracking on cordova?
as I read in the documentation so that the system does not stop the application, you need to move this case to Service.
Those. in onCreate of the main Activity, I start a Service that registers a locationListener, i.e. track and write data to the field of the Service class, it will be while the phone remains on, as long as there is enough memory, JavaScript will receive data and work with them, if the system stops the Activity, then the Service will continue tracking, and when the Activity starts again, we can get the data saved in the Service class field .
is the idea correct? please tell me how best to implement this case the
second question - how to get data from the Service from javascript? from Activity I do like this super.appView.addJavascriptInterface(this, "Activity");
as I understand it, you need to define a method in the Activity that will get the Service object, and how to get it if the Service is running and running continuously, and the Activity itself was restarted 5 times, for example
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question