Search code examples
javajavafxlocationmapsgluon-mobile

java - Gluon: how to stop services in the background?


In the app we develop, we have a screen requiring a map - for this we use the GluonMaps-api.

To locate the user location we use the positionservice, which works fine. However, when the screen changes, the positionservice still runs in the background, even though the view is not shown anymore and the service not needed. How can we stop the service?

In the official documentation there is nothing written about it: http://docs.gluonhq.com/charm/javadoc/4.4.1/index.html?com/gluonhq/charm/down/package-summary.html


Solution

  • The new gluon service allows to stop the service: http://docs.gluonhq.com/charm/javadoc/5.1.0-SNAPSHOT/com/gluonhq/charm/down/plugins/PositionService.html

    Make sure that when you upgrade you add the new parameters the way you need it.