use of net.osmand.plus.monitoring.OsmandMonitoringPlugin in project Osmand by osmandapp.
the class GpxNotification method init.
@Override
public void init() {
app.registerReceiver(new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
final OsmandMonitoringPlugin plugin = OsmandPlugin.getEnabledPlugin(OsmandMonitoringPlugin.class);
if (plugin != null) {
plugin.saveCurrentTrack();
if (!app.getSettings().SAVE_GLOBAL_TRACK_TO_GPX.get()) {
plugin.stopRecording();
}
}
}
}, new IntentFilter(OSMAND_SAVE_GPX_SERVICE_ACTION));
app.registerReceiver(new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
final OsmandMonitoringPlugin plugin = OsmandPlugin.getEnabledPlugin(OsmandMonitoringPlugin.class);
if (plugin != null) {
plugin.startGPXMonitoring(null);
plugin.updateControl();
}
}
}, new IntentFilter(OSMAND_START_GPX_SERVICE_ACTION));
app.registerReceiver(new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
final OsmandMonitoringPlugin plugin = OsmandPlugin.getEnabledPlugin(OsmandMonitoringPlugin.class);
if (plugin != null) {
plugin.stopRecording();
plugin.updateControl();
}
}
}, new IntentFilter(OSMAND_STOP_GPX_SERVICE_ACTION));
}
use of net.osmand.plus.monitoring.OsmandMonitoringPlugin in project Osmand by osmandapp.
the class OsmandPlugin method initPlugins.
public static void initPlugins(OsmandApplication app) {
OsmandSettings settings = app.getSettings();
Set<String> enabledPlugins = settings.getEnabledPlugins();
allPlugins.add(new MapillaryPlugin(app));
enabledPlugins.add(MapillaryPlugin.ID);
allPlugins.add(new OsmandRasterMapsPlugin(app));
allPlugins.add(new OsmandMonitoringPlugin(app));
checkMarketPlugin(app, new SRTMPlugin(app), true, SRTM_PLUGIN_COMPONENT_PAID, SRTM_PLUGIN_COMPONENT);
// ? questionable - definitely not market plugin
// checkMarketPlugin(app, new TouringViewPlugin(app), false, TouringViewPlugin.COMPONENT, null);
checkMarketPlugin(app, new NauticalMapsPlugin(app), false, NauticalMapsPlugin.COMPONENT, null);
checkMarketPlugin(app, new SkiMapsPlugin(app), false, SkiMapsPlugin.COMPONENT, null);
allPlugins.add(new AudioVideoNotesPlugin(app));
checkMarketPlugin(app, new ParkingPositionPlugin(app), false, ParkingPositionPlugin.PARKING_PLUGIN_COMPONENT, null);
allPlugins.add(new AccessibilityPlugin(app));
allPlugins.add(new OsmEditingPlugin(app));
allPlugins.add(new OsmandDevelopmentPlugin(app));
activatePlugins(app, enabledPlugins);
}
Aggregations