@Nullable
    @SuppressWarnings({"PMD.NPathComplexity"}) // splitting up would not improve readability
    private static Geopoint[] calculateRouting(final Geopoint start, final Geopoint dest, @Nullable final ArrayList<Float> elevation) {
        final Bundle params = new Bundle();
        params.putString("trackFormat", "gpx");
        params.putDoubleArray("lats", new double[]{start.getLatitude(), dest.getLatitude()});
        params.putDoubleArray("lons", new double[]{start.getLongitude(), dest.getLongitude()});
        params.putString("v", Settings.getRoutingMode().parameterValue);
        params.putString(PROFILE_PARAMTERKEY, Settings.getRoutingProfile()); // profile filename, used only by internal routing engine

        final String gpx = routingServiceConnection == null ? null : routingServiceConnection.getTrackFromParams(params);

        if (gpx == null) {
            Log.i("brouter returned no data");
            return null;
        }

        // missing routing data?
        if (gpx.startsWith("datafile ") && gpx.endsWith(" not found")) {
            synchronized (requestedTileFiles) {
                String filename = gpx.substring(9);
                final int pos = filename.indexOf(" ");
                if (pos != -1) {
                    filename = filename.substring(0, pos);
                }
                boolean alreadyRequested = false;
                for (String f : requestedTileFiles) {
                    if (filename.equals(f)) {
                        alreadyRequested = true;
                        break;
                    }
                }
                Log.i("routing: missing file " + filename + ", alreadyRequested=" + alreadyRequested);
                if (!alreadyRequested) {
                    requestedTileFiles.add(filename);
                    if (Settings.useInternalRouting()) {
                        if (Settings.isBrouterAutoTileDownloads() && !PersistableFolder.ROUTING_TILES.isLegacy()) {
                            final Intent intent = new Intent(getContext(), DownloadConfirmationActivity.class);
                            intent.putExtra(DownloadConfirmationActivity.BUNDLE_FILENAME, filename);
                            intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                            getContext().startActivity(intent);
                        }
                    } else {
                        ActivityMixin.showApplicationToast(String.format(getContext().getString(R.string.brouter_missing_data), filename));
                    }
                }
            }
        }

        // other error
        if (!gpx.startsWith("<?xml")) {
            Log.w("brouter returned an error message: " + gpx);
            return null;
        }

        return parseGpxTrack(gpx, dest, elevation);
    }
Return a valid track (with at least two points, including the start and destination).
no caching

@param start       the starting point
@param destination the destination point
@param elevation   the variable to write elevation info to (null, if no elevation info to be returned)
@return a track with at least two points including the start and destination points
main/src/main/java/cgeo/geocaching/maps/routing/Routing.java