diff --git a/OsmAnd/src/net/osmand/plus/AppInitializer.java b/OsmAnd/src/net/osmand/plus/AppInitializer.java index 08fcb40034..48acbed4d9 100644 --- a/OsmAnd/src/net/osmand/plus/AppInitializer.java +++ b/OsmAnd/src/net/osmand/plus/AppInitializer.java @@ -10,11 +10,11 @@ import android.content.DialogInterface; import android.content.Intent; import android.content.SharedPreferences; import android.support.v7.app.AlertDialog; + import net.osmand.IProgress; import net.osmand.IndexConstants; import net.osmand.PlatformUtil; import net.osmand.aidl.OsmandAidlApi; -import net.osmand.binary.BinaryMapIndexReader; import net.osmand.map.OsmandRegions; import net.osmand.map.OsmandRegions.RegionTranslation; import net.osmand.map.WorldRegion; @@ -45,7 +45,6 @@ import net.osmand.plus.voice.MediaCommandPlayerImpl; import net.osmand.plus.voice.TTSCommandPlayerImpl; import net.osmand.render.RenderingRulesStorage; import net.osmand.router.RoutingConfiguration; -import net.osmand.search.SearchUICore; import net.osmand.util.Algorithms; import org.xmlpull.v1.XmlPullParserException; @@ -60,6 +59,7 @@ import java.util.List; import java.util.Random; import btools.routingapp.BRouterServiceConnection; + import static net.osmand.plus.liveupdates.LiveUpdatesHelper.getPendingIntent; import static net.osmand.plus.liveupdates.LiveUpdatesHelper.preferenceLastCheck; import static net.osmand.plus.liveupdates.LiveUpdatesHelper.preferenceLiveUpdatesOn; @@ -86,7 +86,7 @@ public class AppInitializer implements IProgress { private static final String VERSION_INSTALLED = "VERSION_INSTALLED"; //$NON-NLS-1$ private static final String EXCEPTION_FILE_SIZE = "EXCEPTION_FS"; //$NON-NLS-1$ - public static final String LATEST_CHANGES_URL = "http://osmand.net/blog?id=osmand-2-7-released"; + public static final String LATEST_CHANGES_URL = "https://osmand.net/blog?id=osmand-2-7-released"; // public static final String LATEST_CHANGES_URL = null; // not enough to read public static final int APP_EXIT_CODE = 4; public static final String APP_EXIT_KEY = "APP_EXIT_KEY"; diff --git a/OsmAnd/src/net/osmand/plus/OsmandSettings.java b/OsmAnd/src/net/osmand/plus/OsmandSettings.java index 3c92a9fdd3..b48bea37df 100644 --- a/OsmAnd/src/net/osmand/plus/OsmandSettings.java +++ b/OsmAnd/src/net/osmand/plus/OsmandSettings.java @@ -1128,7 +1128,7 @@ public class OsmandSettings { // this value string is synchronized with settings_pref.xml preference name public final CommonPreference LIVE_MONITORING_URL = new StringPreference("live_monitoring_url", - "http://example.com?lat={0}&lon={1}×tamp={2}&hdop={3}&altitude={4}&speed={5}").makeGlobal(); + "https://example.com?lat={0}&lon={1}×tamp={2}&hdop={3}&altitude={4}&speed={5}").makeGlobal(); public final CommonPreference GPS_STATUS_APP = new StringPreference("gps_status_app", "").makeGlobal(); diff --git a/OsmAnd/src/net/osmand/plus/Version.java b/OsmAnd/src/net/osmand/plus/Version.java index 2df490ce10..b7408d5f5a 100644 --- a/OsmAnd/src/net/osmand/plus/Version.java +++ b/OsmAnd/src/net/osmand/plus/Version.java @@ -33,7 +33,7 @@ public class Version { } else if (isGooglePlayEnabled(ctx)) { return "market://search?q=pname:"; } - return "http://osmand.net/apps?id="; + return "https://osmand.net/apps?id="; } private static boolean isAmazonEnabled(OsmandApplication ctx) { diff --git a/OsmAnd/src/net/osmand/plus/activities/HelpActivity.java b/OsmAnd/src/net/osmand/plus/activities/HelpActivity.java index 00628952ab..4cb50d9832 100644 --- a/OsmAnd/src/net/osmand/plus/activities/HelpActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/HelpActivity.java @@ -29,11 +29,11 @@ public class HelpActivity extends OsmandActionBarActivity implements AdapterView // public static final String DIALOG = "dialog"; @IdRes - public static final String OSMAND_POLL_HTML = "http://osmand.net/android-poll.html"; + public static final String OSMAND_POLL_HTML = "https://osmand.net/android-poll.html"; public static final int NULL_ID = -1; private ArrayAdapter mAdapter; - //public static final String OSMAND_MAP_LEGEND = "http://osmand.net/help/map-legend_default.png"; + //public static final String OSMAND_MAP_LEGEND = "https://osmand.net/help/map-legend_default.png"; @Override protected void onCreate(Bundle savedInstanceState) { diff --git a/OsmAnd/src/net/osmand/plus/activities/search/SearchAddressOnlineFragment.java b/OsmAnd/src/net/osmand/plus/activities/search/SearchAddressOnlineFragment.java index 11d914d16b..b07fe9b5bb 100644 --- a/OsmAnd/src/net/osmand/plus/activities/search/SearchAddressOnlineFragment.java +++ b/OsmAnd/src/net/osmand/plus/activities/search/SearchAddressOnlineFragment.java @@ -167,7 +167,7 @@ public class SearchAddressOnlineFragment extends Fragment implements SearchActiv NOMINATIM_API = "https://nominatim.openstreetmap.org/search"; } else { - NOMINATIM_API = "http://nominatim.openstreetmap.org/search"; + NOMINATIM_API = "https://nominatim.openstreetmap.org/search"; } final List places = new ArrayList(); diff --git a/OsmAnd/src/net/osmand/plus/dialogs/HelpArticleDialogFragment.java b/OsmAnd/src/net/osmand/plus/dialogs/HelpArticleDialogFragment.java index ccf25d9933..f669de9bd9 100644 --- a/OsmAnd/src/net/osmand/plus/dialogs/HelpArticleDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/dialogs/HelpArticleDialogFragment.java @@ -1,10 +1,8 @@ package net.osmand.plus.dialogs; import android.annotation.SuppressLint; -import android.content.ContentResolver; import android.content.Context; import android.os.Bundle; -import android.provider.Settings; import android.support.annotation.NonNull; import android.support.v4.app.DialogFragment; import android.support.v7.widget.Toolbar; @@ -14,6 +12,7 @@ import android.view.ViewGroup; import android.webkit.WebSettings; import android.webkit.WebView; import android.webkit.WebViewClient; + import net.osmand.PlatformUtil; import net.osmand.plus.OsmandApplication; import net.osmand.plus.OsmandSettings; @@ -104,12 +103,12 @@ public class HelpArticleDialogFragment extends DialogFragment { sb.append(fileContents); sb.append(FOOTER_INNER); - webView.loadDataWithBaseURL("http://osmand.net", sb.toString(), null, "utf-8", null); + webView.loadDataWithBaseURL("https://osmand.net", sb.toString(), null, "utf-8", null); webView.setWebViewClient(new WebViewClient() { @Override public boolean shouldOverrideUrlLoading(WebView view, String url) { - if (url.startsWith("http://osmand.net/features?id=")) { - String id = url.substring("http://osmand.net/features?id=".length()); + if (url.startsWith("https://osmand.net/features?id=")) { + String id = url.substring("https://osmand.net/features?id=".length()); dismiss(); instantiateWithAsset("feature_articles/" + id + ".html", getString(R.string.shared_string_help)) .show(getActivity().getSupportFragmentManager(), "DIALOG_HELP_ARTICLE"); diff --git a/OsmAnd/src/net/osmand/plus/download/DownloadTracker.java b/OsmAnd/src/net/osmand/plus/download/DownloadTracker.java index b612299ebd..e3ca8955c5 100644 --- a/OsmAnd/src/net/osmand/plus/download/DownloadTracker.java +++ b/OsmAnd/src/net/osmand/plus/download/DownloadTracker.java @@ -1,5 +1,14 @@ package net.osmand.plus.download; +import android.os.Build; + +import net.osmand.PlatformUtil; +import net.osmand.osm.io.NetworkUtils; +import net.osmand.plus.OsmandApplication; +import net.osmand.plus.Version; + +import org.apache.commons.logging.Log; + import java.io.File; import java.io.IOException; import java.net.HttpURLConnection; @@ -11,15 +20,6 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Random; -import net.osmand.PlatformUtil; -import net.osmand.osm.io.NetworkUtils; -import net.osmand.plus.OsmandApplication; -import net.osmand.plus.Version; - -import org.apache.commons.logging.Log; - -import android.os.Build; - public class DownloadTracker { private static final Log log = PlatformUtil.getLog(DownloadTracker.class); @@ -49,7 +49,7 @@ public class DownloadTracker { Map customVariables = getCustomVars(a); parameters.put("AnalyticsVersion", analyticsVersion); parameters.put("utmn", randomNumber()); - parameters.put("utmhn", "http://app.osmand.net"); + parameters.put("utmhn", "https://app.osmand.net"); parameters.put("utmni", "1"); parameters.put("utmt", "event"); diff --git a/OsmAnd/src/net/osmand/plus/firstusage/FirstUsageWizardFragment.java b/OsmAnd/src/net/osmand/plus/firstusage/FirstUsageWizardFragment.java index d0194127a6..b33f33311c 100644 --- a/OsmAnd/src/net/osmand/plus/firstusage/FirstUsageWizardFragment.java +++ b/OsmAnd/src/net/osmand/plus/firstusage/FirstUsageWizardFragment.java @@ -344,7 +344,7 @@ public class FirstUsageWizardFragment extends Fragment implements OsmAndLocation @Override protected String doInBackground(Void... params) { try { - return AndroidNetworkUtils.sendRequest(app, "http://osmand.net/api/geo-ip", pms, + return AndroidNetworkUtils.sendRequest(app, "https://osmand.net/api/geo-ip", pms, "Requesting location by IP...", false, false); } catch (Exception e) { diff --git a/OsmAnd/src/net/osmand/plus/helpers/DiscountHelper.java b/OsmAnd/src/net/osmand/plus/helpers/DiscountHelper.java index 97de9cc1e8..be5cc51514 100644 --- a/OsmAnd/src/net/osmand/plus/helpers/DiscountHelper.java +++ b/OsmAnd/src/net/osmand/plus/helpers/DiscountHelper.java @@ -1,9 +1,12 @@ package net.osmand.plus.helpers; -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.LinkedHashMap; -import java.util.Map; +import android.annotation.SuppressLint; +import android.content.Intent; +import android.net.Uri; +import android.os.AsyncTask; +import android.provider.Settings.Secure; +import android.util.Log; +import android.view.View; import net.osmand.AndroidNetworkUtils; import net.osmand.plus.OsmandApplication; @@ -19,13 +22,10 @@ import net.osmand.util.Algorithms; import org.json.JSONObject; -import android.annotation.SuppressLint; -import android.content.Intent; -import android.net.Uri; -import android.os.AsyncTask; -import android.provider.Settings.Secure; -import android.util.Log; -import android.view.View; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.LinkedHashMap; +import java.util.Map; public class DiscountHelper { @@ -38,7 +38,7 @@ public class DiscountHelper { private static String mIcon; private static String mUrl; private static boolean mBannerVisible; - private static final String URL = "http://osmand.net/api/motd"; + private static final String URL = "https://osmand.net/api/motd"; private static final String INAPP_PREFIX = "osmand-in-app:"; diff --git a/OsmAnd/src/net/osmand/plus/liveupdates/LiveUpdatesFragment.java b/OsmAnd/src/net/osmand/plus/liveupdates/LiveUpdatesFragment.java index 68b355f948..aa07f041d7 100644 --- a/OsmAnd/src/net/osmand/plus/liveupdates/LiveUpdatesFragment.java +++ b/OsmAnd/src/net/osmand/plus/liveupdates/LiveUpdatesFragment.java @@ -186,7 +186,7 @@ public class LiveUpdatesFragment extends BaseOsmAndFragment implements InAppList readMoreBtn.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { - Uri uri = Uri.parse("http://osmand.net/osm_live.php"); + Uri uri = Uri.parse("https://osmand.net/osm_live.php"); Intent goToOsmLive = new Intent(Intent.ACTION_VIEW, uri); startActivity(goToOsmLive); } diff --git a/OsmAnd/src/net/osmand/plus/liveupdates/ReportsFragment.java b/OsmAnd/src/net/osmand/plus/liveupdates/ReportsFragment.java index d005fbf6f8..c44d31cd67 100644 --- a/OsmAnd/src/net/osmand/plus/liveupdates/ReportsFragment.java +++ b/OsmAnd/src/net/osmand/plus/liveupdates/ReportsFragment.java @@ -51,7 +51,7 @@ public class ReportsFragment extends BaseOsmAndFragment implements CountrySelect private static final Log LOG = PlatformUtil.getLog(ReportsFragment.class); - public static final String OSM_LIVE_URL = "http://osmand.net/osm_live"; + public static final String OSM_LIVE_URL = "https://osmand.net/osm_live"; private TextView contributorsTextView; private TextView editsTextView; diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/builders/cards/ImageCard.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/builders/cards/ImageCard.java index 19fce70e93..343a875060 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/builders/cards/ImageCard.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/builders/cards/ImageCard.java @@ -410,7 +410,7 @@ public abstract class ImageCard extends AbstractCard { if (!Algorithms.isEmpty(preferredLang)) { pms.put("lang", preferredLang); } - String response = AndroidNetworkUtils.sendRequest(app, "http://osmand.net/api/cm_place.php", pms, + String response = AndroidNetworkUtils.sendRequest(app, "https://osmand.net/api/cm_place.php", pms, "Requesting location images...", false, false); if (!Algorithms.isEmpty(response)) { diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/other/ShareMenu.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/other/ShareMenu.java index 7310be1bdf..d294612639 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/other/ShareMenu.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/other/ShareMenu.java @@ -82,7 +82,7 @@ public class ShareMenu extends BaseMenuController { public void share(ShareItem item) { final int zoom = getMapActivity().getMapView().getZoom(); final String geoUrl = MapUtils.buildGeoUrl(latLon.getLatitude(), latLon.getLongitude(), zoom); - final String httpUrl = "http://osmand.net/go?lat=" + ((float) latLon.getLatitude()) + final String httpUrl = "https://osmand.net/go?lat=" + ((float) latLon.getLatitude()) + "&lon=" + ((float) latLon.getLongitude()) + "&z=" + zoom; StringBuilder sb = new StringBuilder(); if (!Algorithms.isEmpty(title)) { diff --git a/OsmAnd/src/net/osmand/plus/osmo/OsMoService.java b/OsmAnd/src/net/osmand/plus/osmo/OsMoService.java index cb491661f7..ecf61eb0e6 100644 --- a/OsmAnd/src/net/osmand/plus/osmo/OsMoService.java +++ b/OsmAnd/src/net/osmand/plus/osmo/OsMoService.java @@ -21,7 +21,6 @@ import net.osmand.PlatformUtil; import net.osmand.plus.OsmandApplication; import net.osmand.plus.R; import net.osmand.plus.Version; -import net.osmand.plus.notifications.OsmandNotification; import net.osmand.plus.notifications.OsmandNotification.NotificationType; import org.apache.commons.logging.Log; diff --git a/OsmAnd/src/net/osmand/plus/routing/RouteProvider.java b/OsmAnd/src/net/osmand/plus/routing/RouteProvider.java index 3c74776fc6..abfdbc7f80 100644 --- a/OsmAnd/src/net/osmand/plus/routing/RouteProvider.java +++ b/OsmAnd/src/net/osmand/plus/routing/RouteProvider.java @@ -972,72 +972,6 @@ public class RouteProvider { return directions; } - protected RouteCalculationResult findORSRoute(RouteCalculationParams params) throws MalformedURLException, IOException, ParserConfigurationException, FactoryConfigurationError, - SAXException { - List res = new ArrayList(); - - String rpref = "Fastest"; - if (params.mode.isDerivedRoutingFrom(ApplicationMode.PEDESTRIAN)) { - rpref = "Pedestrian"; - } else if (params.mode.isDerivedRoutingFrom(ApplicationMode.BICYCLE)) { - rpref = "Bicycle"; - // } else if (ApplicationMode.LOWTRAFFIC == mode) { - // rpref = "BicycleSafety"; - // } else if (ApplicationMode.RACEBIKE == mode) { - // rpref = "BicycleRacer"; - // } else if (ApplicationMode.TOURBIKE == mode) { - // rpref = "BicycleRoute"; - // } else if (ApplicationMode.MTBIKE == mode) { - // rpref = "BicycleMTB"; - } else if (params.mode.isDerivedRoutingFrom(ApplicationMode.CAR)) { - if (!params.fast) { - rpref = "Shortest"; - } - } else { - return applicationModeNotSupported(params); - } - - StringBuilder request = new StringBuilder(); - request.append("http://openls.geog.uni-heidelberg.de/osm/eu/routing?").append("start=").append(params.start.getLongitude()).append(',') - .append(params.start.getLatitude()).append("&end=").append(params.end.getLongitude()).append(',').append(params.end.getLatitude()) - .append("&preference=").append(rpref); - // TODO if we would get instructions from the service, we could use this language setting - // .append("&language=").append(Locale.getDefault().getLanguage()); - - log.info("URL route " + request); - URLConnection connection = NetworkUtils.getHttpURLConnection(request.toString()); - connection.setRequestProperty("User-Agent", Version.getFullVersion(params.ctx)); - - DocumentBuilder dom = DocumentBuilderFactory.newInstance().newDocumentBuilder(); - Document doc = dom.parse(new InputSource(new InputStreamReader(connection.getInputStream()))); - NodeList list = doc.getElementsByTagName("xls:RouteGeometry"); //$NON-NLS-1$ - for (int i = 0; i < list.getLength(); i++) { - NodeList poslist = ((Element) list.item(i)).getElementsByTagName("gml:pos"); //$NON-NLS-1$ - for (int j = 0; j < poslist.getLength(); j++) { - String text = poslist.item(j).getFirstChild().getNodeValue(); - int s = text.indexOf(' '); - try { - double lon = Double.parseDouble(text.substring(0, s)); - double lat = Double.parseDouble(text.substring(s + 1)); - Location l = new Location("router"); //$NON-NLS-1$ - l.setLatitude(lat); - l.setLongitude(lon); - res.add(l); - } catch (NumberFormatException nfe) { - } - } - } - if (list.getLength() == 0) { - if (doc.getChildNodes().getLength() == 1) { - Node item = doc.getChildNodes().item(0); - return new RouteCalculationResult(item.getNodeValue()); - - } - } - params.intermediates = null; - return new RouteCalculationResult(res, null, params, null, true); - } - public GPXFile createOsmandRouterGPX(RouteCalculationResult srcRoute, OsmandApplication ctx) { TargetPointsHelper helper = ctx.getTargetPointsHelper(); int currentRoute = srcRoute.currentRoute;