Search in sources :

Example 6 with AudioVideoNotesPlugin

use of net.osmand.plus.audionotes.AudioVideoNotesPlugin in project Osmand by osmandapp.

the class OsmandAidlApi method registerStartVideoRecordingReceiver.

private void registerStartVideoRecordingReceiver(final MapActivity mapActivity) {
    startVideoRecordingReceiver = new BroadcastReceiver() {

        @Override
        public void onReceive(Context context, Intent intent) {
            final AudioVideoNotesPlugin plugin = OsmandPlugin.getEnabledPlugin(AudioVideoNotesPlugin.class);
            if (plugin != null) {
                double lat = intent.getDoubleExtra(AIDL_LATITUDE, Double.NaN);
                double lon = intent.getDoubleExtra(AIDL_LONGITUDE, Double.NaN);
                plugin.recordVideo(lat, lon, mapActivity, true);
            }
        }
    };
    mapActivity.registerReceiver(startVideoRecordingReceiver, new IntentFilter(AIDL_START_VIDEO_RECORDING));
}
Also used : Context(android.content.Context) IntentFilter(android.content.IntentFilter) AudioVideoNotesPlugin(net.osmand.plus.audionotes.AudioVideoNotesPlugin) Intent(android.content.Intent) BroadcastReceiver(android.content.BroadcastReceiver)

Aggregations

AudioVideoNotesPlugin (net.osmand.plus.audionotes.AudioVideoNotesPlugin)6 Intent (android.content.Intent)5 BroadcastReceiver (android.content.BroadcastReceiver)4 Context (android.content.Context)4 IntentFilter (android.content.IntentFilter)4 OsmandMonitoringPlugin (net.osmand.plus.monitoring.OsmandMonitoringPlugin)2 DialogInterface (android.content.DialogInterface)1 Uri (android.net.Uri)1 ParcelFileDescriptor (android.os.ParcelFileDescriptor)1 AlertDialog (android.support.v7.app.AlertDialog)1 ByteArrayInputStream (java.io.ByteArrayInputStream)1 File (java.io.File)1 FileDescriptor (java.io.FileDescriptor)1 FileInputStream (java.io.FileInputStream)1 Location (net.osmand.Location)1 AccessibilityPlugin (net.osmand.access.AccessibilityPlugin)1 FavouritePoint (net.osmand.data.FavouritePoint)1 LatLon (net.osmand.data.LatLon)1 PointDescription (net.osmand.data.PointDescription)1 ApplicationMode (net.osmand.plus.ApplicationMode)1