From 45038e51ac2d3e5834ef98930e224cfdddfa6814 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Thu, 17 Mar 2016 10:03:12 +0100 Subject: [PATCH] Revert changes --- OsmAnd-java/.gitignore | 1 - .../net/osmand/util/GeoPointParserUtil.java | 10 +- OsmAnd-java/test_turn_lanes.json | 160 +------- OsmAnd/res/layout/osmo_groups_list_header.xml | 30 +- OsmAnd/res/values-be/strings.xml | 16 +- OsmAnd/res/values-de/strings.xml | 9 +- OsmAnd/res/values-eo/strings.xml | 10 +- OsmAnd/res/values-it/strings.xml | 9 +- OsmAnd/res/values-ja/strings.xml | 49 +-- OsmAnd/res/values-pl/strings.xml | 6 +- OsmAnd/res/values-tr/strings.xml | 9 +- OsmAnd/res/values-zh-rTW/strings.xml | 1 - .../src/net/osmand/plus/osmo/OsMoGroups.java | 2 +- .../osmand/plus/osmo/OsMoGroupsActivity.java | 2 +- .../src/net/osmand/plus/osmo/OsMoTracker.java | 103 ++--- api-test/.gitignore | 1 - api-test/build.gradle | 27 -- api-test/proguard-rules.pro | 17 - api-test/src/main/AndroidManifest.xml | 23 -- .../osmand/osmandapitestapp/MainActivity.java | 353 ------------------ .../src/main/res/layout/activity_main.xml | 165 -------- .../src/main/res/mipmap-hdpi/ic_launcher.png | Bin 3418 -> 0 bytes .../src/main/res/mipmap-mdpi/ic_launcher.png | Bin 2206 -> 0 bytes .../src/main/res/mipmap-xhdpi/ic_launcher.png | Bin 4842 -> 0 bytes .../main/res/mipmap-xxhdpi/ic_launcher.png | Bin 7718 -> 0 bytes .../main/res/mipmap-xxxhdpi/ic_launcher.png | Bin 10486 -> 0 bytes api-test/src/main/res/values-v21/styles.xml | 9 - .../src/main/res/values-w820dp/dimens.xml | 6 - api-test/src/main/res/values/colors.xml | 5 - api-test/src/main/res/values/dimens.xml | 6 - api-test/src/main/res/values/strings.xml | 4 - api-test/src/main/res/values/styles.xml | 19 - 32 files changed, 107 insertions(+), 945 deletions(-) delete mode 100644 api-test/.gitignore delete mode 100644 api-test/build.gradle delete mode 100644 api-test/proguard-rules.pro delete mode 100644 api-test/src/main/AndroidManifest.xml delete mode 100644 api-test/src/main/java/net/osmand/osmandapitestapp/MainActivity.java delete mode 100644 api-test/src/main/res/layout/activity_main.xml delete mode 100644 api-test/src/main/res/mipmap-hdpi/ic_launcher.png delete mode 100644 api-test/src/main/res/mipmap-mdpi/ic_launcher.png delete mode 100644 api-test/src/main/res/mipmap-xhdpi/ic_launcher.png delete mode 100644 api-test/src/main/res/mipmap-xxhdpi/ic_launcher.png delete mode 100644 api-test/src/main/res/mipmap-xxxhdpi/ic_launcher.png delete mode 100644 api-test/src/main/res/values-v21/styles.xml delete mode 100644 api-test/src/main/res/values-w820dp/dimens.xml delete mode 100644 api-test/src/main/res/values/colors.xml delete mode 100644 api-test/src/main/res/values/dimens.xml delete mode 100644 api-test/src/main/res/values/strings.xml delete mode 100644 api-test/src/main/res/values/styles.xml diff --git a/OsmAnd-java/.gitignore b/OsmAnd-java/.gitignore index 2d0ecbd161..215b1c906a 100644 --- a/OsmAnd-java/.gitignore +++ b/OsmAnd-java/.gitignore @@ -4,7 +4,6 @@ OsmAnd-core.jar protobuf-src/com OsmAnd-core-android.jar src/net/osmand/core/jni/* -result.* # Android Studio /.idea diff --git a/OsmAnd-java/src/net/osmand/util/GeoPointParserUtil.java b/OsmAnd-java/src/net/osmand/util/GeoPointParserUtil.java index 7ba30a7c83..5511156f8c 100644 --- a/OsmAnd-java/src/net/osmand/util/GeoPointParserUtil.java +++ b/OsmAnd-java/src/net/osmand/util/GeoPointParserUtil.java @@ -423,14 +423,6 @@ public class GeoPointParserUtil { actual = GeoPointParserUtil.parse(url); assertGeoPoint(actual, new GeoParsedPoint(dlat, dlon, z)); - // whatsapp - // https://maps.google.com/maps?q=loc:34.99393,-106.61568 (USER NAME) - z = GeoParsedPoint.NO_ZOOM; - url = "https://maps.google.com/maps?q=loc:" + dlat + "," + dlon + " (+55 99 99999-9999)"; - System.out.println("url: " + url); - actual = GeoPointParserUtil.parse(url); - assertGeoPoint(actual, new GeoParsedPoint(dlat, dlon, z)); - // whatsapp // https://www.google.com/maps/search/34.99393,-106.61568/data=!4m4!2m3!3m1!2s-23.2776,-45.8443128!4b1 url = "https://maps.google.com/maps?q=loc:" + dlat + "," + dlon + "/data=!4m4!2m3!3m1!2s-23.2776,-45.8443128!4b1"; @@ -980,7 +972,7 @@ public class GeoPointParserUtil { if(opath.contains(pref)) { opath = opath.substring(opath.lastIndexOf(pref) + pref.length()); } - final String postf = "\\s\\((\\p{L}|\\p{M}|\\p{Z}|\\p{S}|\\p{N}|\\p{P}|\\p{C})*\\)$"; + final String postf = "\\s\\((\\p{L}|\\s)*\\)$"; opath = opath.replaceAll(postf, ""); System.out.println("opath=" + opath); return parseGoogleMapsPath(opath, params); diff --git a/OsmAnd-java/test_turn_lanes.json b/OsmAnd-java/test_turn_lanes.json index 8d1ead9c18..5f440230f4 100644 --- a/OsmAnd-java/test_turn_lanes.json +++ b/OsmAnd-java/test_turn_lanes.json @@ -1,162 +1,34 @@ [ { - "testName": "1.Preston road TR Lorimar drive", + "testName": "Amstelveenseweg", "startPoint": { - "latitude": 45.69539, - "longitude": 35.43936 + "longitude": 35.51630312204361, + "latitude": 45.6971206184178 }, "endPoint": { - "latitude": 45.69567, - "longitude": 35.440113 - }, - "expectedResults": { - "-8827": "TL, C, C, C, +TR" - } - }, - { - "testName": "1.2.Preston road TL Lorimar drive", - "startPoint": { - "latitude": 45.69716379996895, - "longitude": 35.43819894718172 - }, - "endPoint": { - "latitude": 45.69602851362186, - "longitude": 35.44070949481966 - }, - "expectedResults": { - "-9105": "+TL, C, C, C, TR", - "-8512": "+TL, C, C, C", - "-8827": "TL, +C, +C" - } - }, - { - "testName": "1.3.Baywater drive TR Preston road", - "startPoint": { - "latitude": 45.6960514631203, - "longitude": 35.43735606299879 - }, - "endPoint": { - "latitude": 45.695624319890825, - "longitude": 35.438198276629464 - }, - "expectedResults": { - "-8644": "TL, C, C, +TR" - } - }, - { - "testName": "2.Valley View Lane TU Highway 161 Service Road", - "startPoint": { - "latitude": 45.694859388262195, - "longitude": 35.467755138874054 - }, - "endPoint": { - "latitude": 45.694132477954575, - "longitude": 35.46842032670975 - }, - "expectedResults": { - "-41125": "+TU, +TL, +C;TL, C, C;TR" - } - }, - { - "testName": "3.Motorway link from Ringweg Zuid TL Amstelveenseweg", - "startPoint": { - "latitude": 45.6971206184178, - "longitude": 35.51630312204361 - }, - "endPoint": { - "latitude": 45.6952846638807, - "longitude": 35.51303619146347 + "longitude": 35.51303619146347, + "latitude": 45.6952846638807 }, "expectedResults": { + "-94361": "TL, TL, TL, C, TR, TR", + "-96062": "+TL, +TL, +TL, +C, TR, TR", "-96063": "+TL, +TL, +TL, +C, TR, TR" } }, { - "testName": "4.Martinistraße TL Wilhelm-Kaisen-Brücke", + "testName": "Amstelveenseweg2", "startPoint": { - "latitude": 45.700375542702446, - "longitude": 35.538462191820145 + "longitude": 35.51630312204361, + "latitude": 45.6971206184178 }, "endPoint": { - "latitude": 45.70025377916235, - "longitude": 35.539058312773705 + "longitude": 35.51303619146347, + "latitude": 45.6952846638807 }, "expectedResults": { - "-62200": "TL, +C" + "-96061": "+TL, +TL, +TL, +C, TR, TR", + "-96062": "+TL, +TL, +TL, C, TR, TR", + "-96063": "+TL, +TL, +TL, +C, TR, TR" } - }, - { - "testName": "5.1.Fritz-Foerster-Platz (S 172) TR Bergstraße (B 170)", - "startPoint": { - "latitude": 45.69942484339974, - "longitude": 35.552937403321266 - }, - "endPoint": { - "latitude": 45.698372030432985, - "longitude": 35.553747430443764 - }, - "expectedResults": { - "-68071": "C, C, +TR, +TR" - } - }, - { - "testName": "5.2.Zellescher Weg (S 172) TL Bergstraße (B 170)", - "startPoint": { - "latitude": 45.69887876939763, - "longitude": 35.55432008206844 - }, - "endPoint": { - "latitude": 45.69869143574982, - "longitude": 35.553684398531914 - }, - "expectedResults": { - "-68128": "+TL, +TL, C, C;TR", - "-68107": "+TL, +TL, C, C", - "-68071": "TL, +C, +C" - } - }, - { - "testName": "6.Platz der Vereinten Nationen TR Platz der Vereinten Nationen", - "startPoint": { - "latitude": 45.69942016011204, - "longitude": 35.568235382437706 - }, - "endPoint": { - "latitude": 45.70020132709422, - "longitude": 35.56931899487972 - }, - "expectedResults": { - "-71975": "TL, C, +TR;C" - } - }, - { - "testName": "7.1.Spindlersfelder Straße TR Oberspreestraße", - "startPoint": { - "latitude": 45.699817301524455, - "longitude": 35.58391557633877 - }, - "endPoint": { - "latitude": 45.69793647478804, - "longitude": 35.58106707036495 - }, - "expectedResults": { - "-77184": "TL, +TR;TL" - } - }, - { - "testName": "7.2.Spindlersfelder Straße TL Oberspreestraße", - "startPoint": { - "latitude": 45.699817301524455, - "longitude": 35.58391557633877 - }, - "endPoint": { - "latitude": 45.69657639532305, - "longitude": 35.586447581 - }, - "expectedResults": { - "-77187": "+TL, TL;TR", - "-77197": "TL, +C, +C" - } } - -] \ No newline at end of file +] diff --git a/OsmAnd/res/layout/osmo_groups_list_header.xml b/OsmAnd/res/layout/osmo_groups_list_header.xml index 64cc4a97ee..dbd5df8380 100644 --- a/OsmAnd/res/layout/osmo_groups_list_header.xml +++ b/OsmAnd/res/layout/osmo_groups_list_header.xml @@ -10,33 +10,33 @@ android:layout_width="fill_parent" android:layout_height="wrap_content" android:minHeight="@dimen/list_item_height" - android:orientation="horizontal"> + android:orientation="horizontal" > + android:layout_gravity="center_vertical" + android:src="@drawable/mon_osmo_conn_small" /> + android:textColor="@color/color_white" /> + android:id="@+id/share_my_location_layout" + android:orientation="horizontal" > + android:src="@drawable/ic_action_gshare_dark" /> + /> - - - + android:visibility="gone" /> + \ No newline at end of file diff --git a/OsmAnd/res/values-be/strings.xml b/OsmAnd/res/values-be/strings.xml index dc9593e460..0e0112d0df 100644 --- a/OsmAnd/res/values-be/strings.xml +++ b/OsmAnd/res/values-be/strings.xml @@ -1283,7 +1283,7 @@ Упадабанае адаслана праз OsmAnd Разлічыць маршрут паміж кропкамі - Аўтаматычна пачынаць падарожжа і перадачу месцазнаходжаньня пасьля старту праграмы + Аўтаматычна пачынаць запіс сьледу і перадачу месцазнаходжаньня пасьля старту праграмы Аўтаматычна пачынаць падарожжа ID трэкера Націсніце, каб паглядзець ідэнтыфікатар трэкера @@ -1521,7 +1521,7 @@ Прыстасаваньне ня знойдзена Ананімны карыстальнік Вы ўвайшлі як %1$s - Сэрвіс OsMo не даступны:\n- Праверце Інтэрнэт-злучэньне;\n- Праверце налады;\n- Праверце наш Twitter: https://twitter.com/OsMomobi + Сэрвіс OsMo не даступны:\n- Праверце злучэньне;\n- Праверце налады;\n- Праверце наш Twitter: https://twitter.com/OsMomobi Ананімнаму карыстальніку недаступныя:\n- Стварэньне груп;\n- Сінхранізацыя груп і прыстасаваньняў з серверам;\n- Кіраваньне групамі і прыстасаваньнямі ў асабістым кабінеце. Налады мапы Паблізу ад @@ -2164,16 +2164,4 @@ Вы можаце адаслаць Вашу OSM заўвагу ананімна, калі вы выкарыстоўваеце свой профіль OpenStreetMap.org. Адаслаць OSM заўвагу Справаздача - " • OSM Live. Падтрымка аўтараў і распрацоўнікаў мапаў і атрыманьне штогадзінных абнаўленьняў мапы.\n\n• Маркеры. Новы спосаб для хуткага выбару месцаў на мапе.\n\n• Больш падрабязныя OSM мапы са спэцыфічнымі дарожнымі знакамі краін і з вялікай колькасьцю новых функцый.\n\n• Палепшаны вонкавы выгляд і падрыхтоўка маршруту.\n\n• Мноства паляпшэньняў у кантэкстным мэню мапы такіх як пошук адрасу.\n\nІ шматлікае іншае... " - Перамясьціць угару - Перамясьціць уніз - Завяршыць навігацыю - Пазьбягаць дарог - Верхняя панэль - Правак: %1$s, ранг: %2$s, усяго правак: %3$s - Рэйтынг картографаў OSM - Публічнае імя - Падтрымоўваны рэгіён - Калі ласка ўвядзіце імя - Абярыце маркеры diff --git a/OsmAnd/res/values-de/strings.xml b/OsmAnd/res/values-de/strings.xml index 2af2a2c266..732caf6ea8 100644 --- a/OsmAnd/res/values-de/strings.xml +++ b/OsmAnd/res/values-de/strings.xml @@ -1469,8 +1469,7 @@ Für Hilfe mit der OsmAnd-App kontaktieren Sie bitte unser Support-Team unter su Anmeldung fehlgeschlagen Fehler bei der OsMo-Anmeldung: %1$s.\n Möglicherweise ist der Dienst nicht verfügbar oder Ihre Anmeldung ist abgelaufen.\n Fortsetzen mit einer neuen Registrierung? Auf Einladung beitreten - " - Zum Erstellen einer Gruppe bitte Namen und Beschreibung angeben\n - Die App legt nur Gruppen vom Typ \"einfache Gruppe\" an, mehr dazu auf der Website https://osmo.mobi/g/new -\n - Auf der Webseite kann man die Gruppe bearbeiten um Orte, Strecken und Punkte hinzuzufügen\n - Wir empfehlen es keine Gruppen mit nur einem Nutzer zu erstellen, wenn es keine POI Gruppe ist\n - Private Gruppen sind auf 8 Personen beschränkt\n - Detaillierte Vertragsbedingungen sind auf der Webseite OsMo.mobi zu finden\n - Wenn besondere Bedürfnisse bestehen, bitte den Support kontaktieren: osmo.mobi@gmail.com " + " - Alle angelegten Gruppen sind öffentlich! Für eine anonyme Verbindung bitte direkt mittels Tracker-ID verbinden.\n - In einer privaten Gruppe können sich bis zu 8 Mitglieder anmelden.\n - Bei Inaktivität oder nur einem einzigen Mitglied über 2 Wochen wird die Gruppe gelöscht.\n - Der Zugang zu einer Gruppe kann beschränkt werden: \"nur auf Einladung\". Zur Steuerung der Gruppe benötigt man Zugang zur Admin-Konsole.\n - Zum Erstellen einer Gruppe mit abweichenden Bedingungen bitte Kontakt aufnehmen unter http://osmo.mobi" Bitte vor dem Erstellen von Gruppen beachten! OsMo-Anmeldung fehlgeschlagen OsMo-Punkte %1$s heruntergeladen. @@ -1549,7 +1548,7 @@ Für Hilfe mit der OsmAnd-App kontaktieren Sie bitte unser Support-Team unter su Toleranz für Tempolimit Schwellenwert für Warnung bei Überschreiten der Höchstgeschwindigkeit. Gerät wurde nicht gefunden - Keine Verbindung zum OsMo Server:\n- bitte Verbindung prüfen;\n- bitte Einstellungen prüfen;\n- ggf. Meldung auf Twitter prüfen: https://twitter.com/OsMomobi + OsMo-Dienst ist nicht verfügbar:\n- bitte Verbindung prüfen;\n- bitte Einstellungen prüfen;\n- ggf. Meldung auf Twitter: https://twitter.com/OsMomobi Anonymer Benutzer Angemeldet als %1$s Anonyme Benutzer können keine:\n- Gruppen bilden;\n- Gruppen und Geräte mit dem Server synchronisieren;\n- Gruppen und Geräte im Privatbereich verwalten. @@ -2117,7 +2116,7 @@ Für Hilfe mit der OsmAnd-App kontaktieren Sie bitte unser Support-Team unter su Straßen vermeiden Der momentan gewählte Speicherort ist schreibgeschützt. Es wurde vorübergehend zum internen Speicher gewechselt. Bitte einen gültigen Speicherort wählen. Gemeinsamer Speicher - " • OSM Live. Unterstütze Karten-Mitwirkende und Entwickler und erhalte stündliche Karten Aktualisierungen.\n\n • Kartenmarkierung. Eine neue Methode Orte auf der Karte schnell auszuwählen.\n\n • Detailliertere OSM Karten mit länderspezifischen Straßenschildern und vielen neuen Kartenmerkmalen.\n\n • Verbessertes Aussehen und Verhalten der Routenerstellung.\n\n • Viele Verbesserungen im Kontextmenü der Karte, wie beispielsweise kontextabhängige Adresssuche. + " • OSM Live. Unterstütze Karten-Mitwirkende und Entwickler und erhalte stündliche Karten Aktualisierungen.\n\n • Karten Markierungen. Ein neuer Weg um schnell ausgewählte Plätze auf der Karte auszuwählen.\n\n • Detailliertere OSM Karten mit länderspezifischen Straßenschildern und einer Menge weitere Funktionalitäten.\n\n • Verbessertes Aussehen und Gefühl der Routen Vorbereitung.\n\n • Viele Verbesserungen der Karten Kontextmenüs, wie beispielsweise kontextabhängige Adresssuche. \n\n und mehr… " Vollständiger Report OpenStreetMap Zugang und Passwort @@ -2127,5 +2126,5 @@ Für Hilfe mit der OsmAnd-App kontaktieren Sie bitte unser Support-Team unter su Die Anwendung darf nun auf den externen Speicher schreiben. Ein manueller Neustart der Anwendung ist nötig. Hoch bewegen Runter bewegen - Datenname beinhaltet nicht erlaubte Zeichen + Datenname beinhaltet nicht erlaubt Zeichen diff --git a/OsmAnd/res/values-eo/strings.xml b/OsmAnd/res/values-eo/strings.xml index 9e1d41faf1..36fdc9569b 100644 --- a/OsmAnd/res/values-eo/strings.xml +++ b/OsmAnd/res/values-eo/strings.xml @@ -674,13 +674,5 @@ Nivelkurba kromprogramo OsmAnd-kromprogramo por desegni nivelkurbojn eksterrete Nivelkurboj - "Tiu ĉi kromprogramo ebligas vidigi kaj tavolon de nivelkurboj kaj tavolon de nivel-ombrumo (reliefo) supre normaj OsmAnd-mapoj. Tiu ĉi ebleco estas dezirata de atletoj, migrantoj, turistoj, kaj ĉiuj scivolaj en reliefa strukturo de lando.\n\nLa mondaj datumoj (inter 70-a norda kaj 70-a suda grado de latitudo) estas bazitaj sur mezuroj de la SRTM (Shuttle Radar Topography Mission) kaj de la ASTER (Advanced Spaceborne Thermal Emission and Reflection Radiometer), bildiga aparato en la Terra - ĉefa sputniko de Sistemo de Tera Observado de NASA. ASTER estas kunlaboraĵo de NASA, de Japana Ministerio pri Ekonomio, Komerco kaj Industrio (METI) kaj de Japanaj Spacaj Sistemoj (J-spacesystems). " - "Tiu ĉi kromprogramo ebligas vidigi kaj tavolon de nivelkurboj kaj tavolon de nivel-ombrumo (reliefo) supre normaj OsmAnd-mapoj. Tiu ĉi ebleco estas dezirata de atletoj, migrantoj, turistoj, kaj ĉiuj scivolaj en reliefa strukturo de lando.\n\nLa mondaj datumoj (inter 70-a norda kaj 70-a suda grado de latitudo) estas bazitaj sur mezuroj de la SRTM (Shuttle Radar Topography Mission) kaj de la ASTER (Advanced Spaceborne Thermal Emission and Reflection Radiometer), bildiga aparato en la Terra - ĉefa sputniko de Sistemo de Tera Observado de NASA. ASTER estas kunlaboraĵo de NASA, de Japana Ministerio pri Ekonomio, Komerco kaj Industrio (METI) kaj de Japanaj Spacaj Sistemoj (J-spacesystems). " - Elŝutado de trovita, bonvolu kontroli vian retkonekton. - Trovis nenion. Se vi ne povas trovi vian regionon, vi povas fari ĝin mem (rigardu na http://osmand.net). - Nenia GPX-dosiero elektita. Por elekti bonvolu premteni disponeblan kurson. - Elektu por montri - Divid-intervalo - Ordigi laŭ distanco - Ordigi laŭ nomo + "Tiu ĉi kromprogramo ebligas vidigi kaj tavolon de nivelkurboj kaj tavolon de nivel-ombrumo (reliefo) supre normaj OsmAnd-mapoj. Tiu ĉi ebleco estas dezirata de atletoj, migrantoj, turistoj, kaj ĉiuj scivolaj en reliefa strukturo de lando. " diff --git a/OsmAnd/res/values-it/strings.xml b/OsmAnd/res/values-it/strings.xml index a82fcd4083..ad790ee17a 100644 --- a/OsmAnd/res/values-it/strings.xml +++ b/OsmAnd/res/values-it/strings.xml @@ -1951,7 +1951,7 @@ Esecuzione in backgroung Specifica l\'unità di misura della velocità Misurazione della velocità - nmi + nm Miglia nautiche Chilometri all\'ora Miglia per ora @@ -1959,7 +1959,7 @@ Minuti al chilometro Minuti per miglia Miglia nautiche per ora (knot) - nmi/h + nmh min/m min/km m/s @@ -2216,7 +2216,4 @@ La carella di memorizzazione selezionata è in sola lettura. La cartella di memorizzazione sarà temporaneamente cambiata nella memoria interna. Per favore scegliere una cartella di destinazione valida. Rapporto Ora l\'applicazione ha i permessi per scrivere sulla memoria esterna. È necessario riavviare l\'applicazione. - Rapporto completo - Nome utente e password OpenStreetMap - Il nome del file contiene caratteri non ammessi - + diff --git a/OsmAnd/res/values-ja/strings.xml b/OsmAnd/res/values-ja/strings.xml index db9e860dc6..973b3fcd70 100644 --- a/OsmAnd/res/values-ja/strings.xml +++ b/OsmAnd/res/values-ja/strings.xml @@ -1,4 +1,4 @@ - + 新しいデータを展開中… オンライン経路案内を使用しようとしていますが インターネット接続されていません。 @@ -1744,7 +1744,7 @@ POIの更新は利用できません バイパスが見つかりません 要求時に経路を保存 HTTPプロキシを使用 - すべてのネットワーク要求に使用されるプロキシの設定を行います + 有効にした場合すべてのネットワーク接続に使用されるので設定をする必要があります プロキシホスト プロキシのホスト名を設定します(例:127.0.0.1) プロキシポート @@ -1864,8 +1864,8 @@ POIの更新は利用できません ルート上で通行可能な車両の高さを指定します スマートなルート再計算 経路が長い場合、最初の部分のみ再計算します -白色 - 黒色 +ライト + ダーク ピエモンテ語 ベンガル語 タガログ語 @@ -2135,45 +2135,4 @@ POIの更新は利用できません タイプ 出発地 無選択 - レポート - 外部ストレージへの書き込みが許可されました。手動でアプリケーションを再起動してください。 - " ・ OSM Live. 地図作成者と開発者をサポートする機能と時間毎の地図更新。\n\n・ マップマーカー. マップ上の場所を選択する新しい方法。\n\n・ より詳細なOSMマップと国または地域別の道路標識とマップの新しい機能\n\n・ 改良された見て分かりやすいルート準備\n\n・ 住所検索などコンテキストメニューの大幅改良\n\n・ 等々… " - 上に移動 - 下に移動 - ナビゲーションの終了 - 使用しない道路 - 現在選択されているデータ保存フォルダーは読み取り専用です。保存フォルダーは一時的に内部メモリに設定されました。書き込み可能なストレージのフォルダを選択してください。 - 共有メモリ - 完全なレポート - ルートの再計算 - OpenStreetMapのログイン名とパスワード - 寄付 - 編集 %1$s, ランク %2$s, 総編集数 %3$s - OSM編集者ランキング - パブリック名 - レポートに自分の名前を表示しない - サポート地域 - 月間コスト - 毎月の支払額 - アクティブ - 非アクティブ - 有効な電子メールアドレスを入力してください - パブリック名を入力してください - ライブ更新を購読いただきありがとうございます! - あなたの寄付の一部がその地域のマップ更新に貢献したユーザーへ還元されます - マップマーカーの選択 - その他のマーカー - 匿名でアップロード - 透過タイプシークバーを表示 - 空き容量が足りません! 一時ファイルの置き場に {3}MB、維持のため {1}MBが必要で、現在利用可能なのは {2}MBです。 - {0}個のファイルを本当にダウンロードしますか? 一時的に {3}MB 維持のために {1}MB が必要です。現在利用可能なのは {2}MBです。 - OpenStreetMap.orgプロファイルを使用する場合は、OSMメモを匿名でアップロードできます。 - OSMメモをアップロード - 最初のマップマーカー - 2番目のマップマーカー - ツールバー - ウィジェット - マップマーカーにすべての地点を追加しますか? - マップマーカーに追加 - マップマーカーを選択 diff --git a/OsmAnd/res/values-pl/strings.xml b/OsmAnd/res/values-pl/strings.xml index 0f0521f308..114ca8b68e 100644 --- a/OsmAnd/res/values-pl/strings.xml +++ b/OsmAnd/res/values-pl/strings.xml @@ -641,7 +641,7 @@ Umożliwia wprowadzanie zmian w zasobach OSM, takich jak dodawanie lub modyfikowanie obiektów POI, zgłaszanie i komentowanie błędów oraz wysyłanie zarejestrowanych plików GPX. OSM jest publicznym projektem tworzenia map przez społeczność. Więcej szczegółów pod adresem http://openstreetmap.org. Aktywny udział jest mile widziany, modyfikacji można dokonywać bezpośrednio z poziomu programu po wprowadzeniu danych uwierzytelniających OSM. Mapy wektorowe mogą wyświetlać się szybciej. Może nie działać dobrze na niektórych urządzeniach. - Odtwarza komunikaty wybranym głosem nawigatora + Odtwórz komendy w wybranym głosie Rozwój OsmAnd Renderowanie natywne @@ -649,7 +649,7 @@ Wysłać pliki GPX do OSM? Widoczność - Etykiety + Tagi Opis Proszę podać nazwę użytkownika OSM oraz hasło aby wysłać pliki GPX. Wsparcie @@ -1920,7 +1920,7 @@ m/s Nagrywanie trasy - Symuluje lokalizację za pomocą wyznaczonej trasy lub zarejestrowanego śladu GPX + Symuluj używając wyliczonej trasy lub nagranej trasy GPX pozostało %1$s pobrań Regiony diff --git a/OsmAnd/res/values-tr/strings.xml b/OsmAnd/res/values-tr/strings.xml index 8f25ca7527..6c2aa167d7 100644 --- a/OsmAnd/res/values-tr/strings.xml +++ b/OsmAnd/res/values-tr/strings.xml @@ -1921,8 +1921,8 @@ Diğer harita özellikleri Kalan unsurlar Yakınında - Sunucu OSMO bağlanamıyor:\n- Internet bağlantınızı kontrol;\n- Ayarlarını kontrol;\n- Check out bizim Twitter: https://twitter.com/OsMomobi - Bir anonim kullanıcı olamaz:\n- Grupları oluşturmak;\n- Sunucuyla grupları ve cihazları senkronize;\n- Web sitesinde kişisel pano grupları ve aygıtları yönetmek. + Osmo hizmeti kullanılabilir değil:\n- Bağlantısını kontrol edin;\n- Ayarları kontrol edin;\n- Check out bizim Twitter: https://twitter.com/OsMomobi + Bir anonim kullanıcı olamaz:\n- Grupları oluşturmak;\n- Sunucuyla grupları ve cihazları senkronize;\n- Özel ofiste grupları ve aygıtları yönetmek. Anonim Kullanıcı %1$s olarak giriş Bir sesli uyarı alırsınız yukarıda seç hız limiti tolerans marjı. @@ -1965,7 +1965,7 @@ Haritaya göz at Binalar türüne göre renk kodu Grup %1$s ayrılmak istiyor musunuz? - Lütfen belirtin + Lütfen kimlik belirtin Devam et Harita üzerinde etiket için tercih edilen dil (yerel adlarıyla İngilizce veya geçecektir mevcut değilse) Harita Tercih dili @@ -1988,7 +1988,7 @@ Döngüsü yolları göster Yetkilendirme başarısız oldu OsMo yetkilendirme hata oluştu: %1$s.\nAşağı bir geçici olarak hizmet olabilir veya kayıt süresi.\nYeni kayıt devam etmek istiyor musunuz? - " -Bir grup oluşturma ona bir isim vermek ve açıklama doldurunuz\n- Uygulama grubundan, sadece Basit türü ile oluşturulan web sitesinde daha fazla okumak https://osmo.mobi/g/new\n  - Bir grup yönetebilecek bir web sitesi aracılığıyla, parça ve mevcut tüm noktalarını yerleştirmek için\n  - Bu POI grubu değilse Biz grubun yalnızca bir kullanıcı kullanımını uygun bulmuyorum\n  - Özel gruplar 8 kişilik sınırlıdır\n  - Detaylı şartları her zaman OsMo.mobi web sitesinde bir var\n  Eğer özel şartları gerekiyorsa - - irtibata geçiniz desteği: osmo.mobi@gmail.com " + " -Tüm oluşturulan grupları genel! Anonim olmak istiyorsan, izci kimlikleri üzerinden doğrudan aygıtlarını bağlayın.\n-Özel gruplar için 8 kişi sınırlıdır\nHareketsizlik ya da 2 hafta için sadece 1 kişi faaliyet-grup-ecek var olmak silmek.\n-Sadece davet, ama kontrol grubuna yönetici konsolu için gitmek gerekir gibi grup giriş, sınırlayabilirsiniz.\n-Bir grup oluşturun, ancak diğer koşulları ile lütfen http://osmo.mobi başvurun gerekiyorsa" Bütün Güncellemler Sadece WiFi üzerinden İndir Canlı güncelleştirme @@ -2107,5 +2107,4 @@ Paylaşılan bellek Topbar Rota yeniden hesaplama - Rapor diff --git a/OsmAnd/res/values-zh-rTW/strings.xml b/OsmAnd/res/values-zh-rTW/strings.xml index d55ba5325e..5e2051158e 100644 --- a/OsmAnd/res/values-zh-rTW/strings.xml +++ b/OsmAnd/res/values-zh-rTW/strings.xml @@ -2153,5 +2153,4 @@ 報告 檔案名稱含有違反規則的字符 現在應用程式允許寫入外部記憶體。應用程式需要手動重新啟動。 - " • OSM實況。支援地圖貢獻者和開發者和每小時獲得地圖更新。\n\n• 地圖標記。一種新的方式以快速在地圖上選擇地點。\n\n• 更詳細的 OSM 地圖與國家具體的公路標誌和許多新的地圖功能。\n\n• 改善外觀和感覺的路線準備。\n\n• 在地圖下拉選單中有許多改善,如下拉地址查找。\n\n以及更多… " diff --git a/OsmAnd/src/net/osmand/plus/osmo/OsMoGroups.java b/OsmAnd/src/net/osmand/plus/osmo/OsMoGroups.java index d8a291fca9..f6612d39d0 100644 --- a/OsmAnd/src/net/osmand/plus/osmo/OsMoGroups.java +++ b/OsmAnd/src/net/osmand/plus/osmo/OsMoGroups.java @@ -193,8 +193,8 @@ public class OsMoGroups implements OsMoReactor, OsmoTrackerListener { disconnectAllGroupUsers(group); disableGroupTracks(group, group.groupTracks); disableGroupTracks(group, Collections.singleton(group.name + " points.gpx")); + processed = true; } - processed = true; } } else if (command.equalsIgnoreCase("GROUP_CONNECT")) { group = storage.getGroup(gid); diff --git a/OsmAnd/src/net/osmand/plus/osmo/OsMoGroupsActivity.java b/OsmAnd/src/net/osmand/plus/osmo/OsMoGroupsActivity.java index 47cf79b397..429535889a 100644 --- a/OsmAnd/src/net/osmand/plus/osmo/OsMoGroupsActivity.java +++ b/OsmAnd/src/net/osmand/plus/osmo/OsMoGroupsActivity.java @@ -1043,7 +1043,7 @@ public class OsMoGroupsActivity extends OsmandExpandableListActivity implements @Override public void run() { String top = OsMoGroupsActivity.this.operation; - if (operation != null && operation.equals(top)) { + if (top.equals(operation) || (operation != null && operation.equals(top))) { hideProgressBar(); } if (joinGroup && (operation != null && operation.startsWith("GROUP_CONNECT"))) { diff --git a/OsmAnd/src/net/osmand/plus/osmo/OsMoTracker.java b/OsmAnd/src/net/osmand/plus/osmo/OsMoTracker.java index df640712fe..407eb2e0b7 100644 --- a/OsmAnd/src/net/osmand/plus/osmo/OsMoTracker.java +++ b/OsmAnd/src/net/osmand/plus/osmo/OsMoTracker.java @@ -29,7 +29,7 @@ public class OsMoTracker implements OsMoReactor { integerFormat.setDecimalFormatSymbols(symbols); } - private ConcurrentLinkedQueue bufferOfLocations = new ConcurrentLinkedQueue<>(); + private ConcurrentLinkedQueue bufferOfLocations = new ConcurrentLinkedQueue(); private OsMoService service; private int locationsSent = 0; private OsmoTrackerListener trackerListener = null; @@ -37,14 +37,16 @@ public class OsMoTracker implements OsMoReactor { private Location lastBufferLocation; private OsmandPreference pref; private String sessionURL; - private Map trackingDevices = new java.util.concurrent.ConcurrentHashMap<>(); + private Map trackingDevices = new java.util.concurrent.ConcurrentHashMap(); private OsmandPreference stateSendLocation; protected static final Log LOG = PlatformUtil.getLog(OsMoTracker.class); public interface OsmoTrackerListener { - void locationChange(String trackerId, Location location); + + public void locationChange(String trackerId, Location location); } + public OsMoTracker(OsMoService service, OsmandPreference interval, OsmandPreference stateSendLocation) { this.service = service; @@ -129,7 +131,7 @@ public class OsMoTracker implements OsMoReactor { cmd.append("C"); integerFormat.format(loc.getBearing(), cmd, new FieldPosition(cmd.length())); } - if (loc.getTime() != 0) { + if ((System.currentTimeMillis() - loc.getTime()) > 30000 && loc.getTime() != 0) { cmd.append("T"); integerFormat.format(loc.getTime(), cmd, new FieldPosition(cmd.length())); } @@ -178,56 +180,55 @@ public class OsMoTracker implements OsMoReactor { @Override public boolean acceptCommand(String command, String tid, String data, JSONObject obj, OsMoThread thread) { - switch (command) { - case "LISTEN": - return true; - case "UNLISTEN": - return true; - case "TRACKER_SESSION_CLOSE": - return true; - case "TRACKER_SESSION_OPEN": - try { - sessionURL = obj.getString("url"); - } catch (JSONException e) { - service.showErrorMessage(e.getMessage()); - e.printStackTrace(); - } - return true; - case "LT": - double lat = 0; - double lon = 0; - double speed = 0; - int k = 0; - for (int i = 1; i <= data.length(); i++) { - boolean separator = i == data.length() || - !(Character.isDigit(data.charAt(i)) || - data.charAt(i) == ':' || data.charAt(i) == '.' || data.charAt(i) == '-'); - if (separator) { - char ch = data.charAt(k); - String vl = data.substring(k + 1, i); - if (ch == 'L') { - int l = vl.indexOf(":"); - lat = Double.parseDouble(vl.substring(0, l)); - lon = Double.parseDouble(vl.substring(l + 1)); - } else if (ch == 'S') { - speed = Double.parseDouble(vl); - } - k = i; + if (command.equals("LISTEN")) { + return true; + } else if (command.equals("UNLISTEN")) { + return true; + } else if (command.equals("TRACKER_SESSION_CLOSE")) { + return true; + } else if (command.equals("TRACKER_SESSION_OPEN")) { + try { + sessionURL = obj.getString("url"); + } catch (JSONException e) { + service.showErrorMessage(e.getMessage()); + e.printStackTrace(); + } + return true; + } else if (command.equals("LT")) { + double lat = 0; + double lon = 0; + double speed = 0; + int k = 0; + for (int i = 1; i <= data.length(); i++) { + boolean separator = i == data.length() || + !(Character.isDigit(data.charAt(i)) || + data.charAt(i) == ':' || data.charAt(i) == '.' || data.charAt(i) == '-'); + if (separator) { + char ch = data.charAt(k); + String vl = data.substring(k + 1, i); + if (ch == 'L') { + int l = vl.indexOf(":"); + lat = Double.parseDouble(vl.substring(0, l)); + lon = Double.parseDouble(vl.substring(l + 1)); + } else if (ch == 'S') { + speed = Double.parseDouble(vl); } + k = i; } - if (lat != 0 || lon != 0) { - Location loc = new Location("osmo"); - loc.setTime(System.currentTimeMillis()); - loc.setLatitude(lat); - loc.setLongitude(lon); - if (speed > 0) { - loc.setSpeed((float) speed); - } - if (trackerListener != null) { - trackerListener.locationChange(tid, loc); - } + } + if (lat != 0 || lon != 0) { + Location loc = new Location("osmo"); + loc.setTime(System.currentTimeMillis()); + loc.setLatitude(lat); + loc.setLongitude(lon); + if (speed > 0) { + loc.setSpeed((float) speed); } - return true; + if (trackerListener != null) { + trackerListener.locationChange(tid, loc); + } + } + return true; } return false; } diff --git a/api-test/.gitignore b/api-test/.gitignore deleted file mode 100644 index 796b96d1c4..0000000000 --- a/api-test/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/build diff --git a/api-test/build.gradle b/api-test/build.gradle deleted file mode 100644 index 5067b9c24c..0000000000 --- a/api-test/build.gradle +++ /dev/null @@ -1,27 +0,0 @@ -apply plugin: 'com.android.application' - -android { - compileSdkVersion 23 - buildToolsVersion "23.0.1" - - defaultConfig { - applicationId "net.osmand.osmandapitestapp" - minSdkVersion 9 - targetSdkVersion 23 - versionCode 1 - versionName "1.0" - } - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' - } - } -} - -dependencies { - compile fileTree(dir: 'libs', include: ['*.jar']) - testCompile 'junit:junit:4.12' - compile 'com.android.support:appcompat-v7:23.2.1' - compile 'com.android.support:design:23.2.1' -} diff --git a/api-test/proguard-rules.pro b/api-test/proguard-rules.pro deleted file mode 100644 index 9c83bcbf25..0000000000 --- a/api-test/proguard-rules.pro +++ /dev/null @@ -1,17 +0,0 @@ -# Add project specific ProGuard rules here. -# By default, the flags in this file are appended to flags specified -# in /Users/admin/Library/Android/sdk/tools/proguard/proguard-android.txt -# You can edit the include path and order by changing the proguardFiles -# directive in build.gradle. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - -# Add any project specific keep options here: - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} diff --git a/api-test/src/main/AndroidManifest.xml b/api-test/src/main/AndroidManifest.xml deleted file mode 100644 index fbbd848db3..0000000000 --- a/api-test/src/main/AndroidManifest.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - diff --git a/api-test/src/main/java/net/osmand/osmandapitestapp/MainActivity.java b/api-test/src/main/java/net/osmand/osmandapitestapp/MainActivity.java deleted file mode 100644 index dff6c7778a..0000000000 --- a/api-test/src/main/java/net/osmand/osmandapitestapp/MainActivity.java +++ /dev/null @@ -1,353 +0,0 @@ -package net.osmand.osmandapitestapp; - -import android.content.Intent; -import android.net.Uri; -import android.os.Bundle; -import android.support.v7.app.AlertDialog; -import android.support.v7.app.AppCompatActivity; -import android.support.v7.widget.Toolbar; -import android.util.Log; -import android.view.View; -import android.widget.Button; - -public class MainActivity extends AppCompatActivity { - - public static final int REQUEST_OSMAND_API = 101; - - public static final String API_CMD_SHOW_GPX = "show_gpx"; - public static final String API_CMD_NAVIGATE_GPX = "navigate_gpx"; - - public static final String API_CMD_NAVIGATE = "navigate"; - - public static final String API_CMD_RECORD_AUDIO = "record_audio"; - public static final String API_CMD_RECORD_VIDEO = "record_video"; - public static final String API_CMD_RECORD_PHOTO = "record_photo"; - public static final String API_CMD_STOP_AV_REC = "stop_av_rec"; - - public static final String API_CMD_GET_INFO = "get_info"; - - public static final String API_CMD_ADD_FAVORITE = "add_favorite"; - public static final String API_CMD_ADD_MAP_MARKER = "add_map_marker"; - - public static final String API_CMD_START_GPX_REC = "start_gpx_rec"; - public static final String API_CMD_STOP_GPX_REC = "stop_gpx_rec"; - - public static final String API_CMD_SUBSCRIBE_VOICE_NOTIFICATIONS = "subscribe_voice_notifications"; - - public static final String PARAM_NAME = "name"; - public static final String PARAM_DESC = "desc"; - public static final String PARAM_CATEGORY = "category"; - public static final String PARAM_LAT = "lat"; - public static final String PARAM_LON = "lon"; - public static final String PARAM_COLOR = "color"; - public static final String PARAM_VISIBLE = "visible"; - - public static final String PARAM_PATH = "path"; - public static final String PARAM_DATA = "data"; - public static final String PARAM_FORCE = "force"; - - public static final String PARAM_START_NAME = "start_name"; - public static final String PARAM_DEST_NAME = "dest_name"; - public static final String PARAM_START_LAT = "start_lat"; - public static final String PARAM_START_LON = "start_lon"; - public static final String PARAM_DEST_LAT = "dest_lat"; - public static final String PARAM_DEST_LON = "dest_lon"; - public static final String PARAM_PROFILE = "profile"; - - public static final String PARAM_ETA = "eta"; - public static final String PARAM_TIME_LEFT = "time_left"; - public static final String PARAM_DISTANCE_LEFT = "time_distance_left"; - - public static final int RESULT_CODE_OK = 0; - public static final int RESULT_CODE_ERROR_UNKNOWN = -1; - public static final int RESULT_CODE_ERROR_NOT_IMPLEMENTED = -2; - public static final int RESULT_CODE_ERROR_PLUGIN_INACTIVE = 10; - public static final int RESULT_CODE_ERROR_GPX_NOT_FOUND = 20; - public static final int RESULT_CODE_ERROR_INVALID_PROFILE = 30; - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_main); - Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); - setSupportActionBar(toolbar); - - Button btn = (Button) findViewById(R.id.btn_add_favorite); - if (btn != null) { - btn.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - exec(API_CMD_ADD_FAVORITE); - } - }); - } - - btn = (Button) findViewById(R.id.btn_add_map_marker); - if (btn != null) { - btn.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - exec(API_CMD_ADD_MAP_MARKER); - } - }); - } - - btn = (Button) findViewById(R.id.btn_start_audio_rec); - if (btn != null) { - btn.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - exec(API_CMD_RECORD_AUDIO); - } - }); - } - - btn = (Button) findViewById(R.id.btn_start_video_rec); - if (btn != null) { - btn.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - exec(API_CMD_RECORD_VIDEO); - } - }); - } - - btn = (Button) findViewById(R.id.btn_stop_rec); - if (btn != null) { - btn.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - exec(API_CMD_STOP_AV_REC); - } - }); - } - - btn = (Button) findViewById(R.id.btn_take_photo); - if (btn != null) { - btn.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - exec(API_CMD_RECORD_PHOTO); - } - }); - } - - btn = (Button) findViewById(R.id.btn_start_gpx_rec); - if (btn != null) { - btn.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - exec(API_CMD_START_GPX_REC); - } - }); - } - - btn = (Button) findViewById(R.id.btn_stop_gpx_rec); - if (btn != null) { - btn.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - exec(API_CMD_STOP_GPX_REC); - } - }); - } - - btn = (Button) findViewById(R.id.btn_show_gpx); - if (btn != null) { - btn.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - exec(API_CMD_SHOW_GPX); - } - }); - } - - btn = (Button) findViewById(R.id.btn_navigate_gpx); - if (btn != null) { - btn.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - exec(API_CMD_NAVIGATE_GPX); - } - }); - } - - btn = (Button) findViewById(R.id.btn_navigate); - if (btn != null) { - btn.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - exec(API_CMD_NAVIGATE); - } - }); - } - - btn = (Button) findViewById(R.id.btn_get_info); - if (btn != null) { - btn.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - exec(API_CMD_GET_INFO); - } - }); - } - } - - public void exec(String command) { - Uri uri = null; - Intent intent = null; - - String lat = "44.98062"; - String lon = "34.09258"; - String destLat = "44.97799"; - String destLon = "34.10286"; - String gpxName = "xxx.gpx"; - - try { - - if (API_CMD_GET_INFO.equals(command)) { - uri = Uri.parse("osmand.api://get_info"); - } - - if (API_CMD_NAVIGATE.equals(command)) { - // test navigate - uri = Uri.parse("osmand.api://navigate" + - "?start_lat=" + lat + "&start_lon=" + lon + "&start_name=Start" + - "&dest_lat=" + destLat + "&dest_lon=" + destLon + "&dest_name=Finish" + - "&profile=bicycle"); - } - - if (API_CMD_RECORD_AUDIO.equals(command)) { - // test record audio - uri = Uri.parse("osmand.api://record_audio?lat=" + lat + "&lon=" + lon); - } - if (API_CMD_RECORD_VIDEO.equals(command)) { - // test record video - uri = Uri.parse("osmand.api://record_video?lat=" + lat + "&lon=" + lon); - } - if (API_CMD_RECORD_PHOTO.equals(command)) { - // test take photo - uri = Uri.parse("osmand.api://record_photo?lat=" + lat + "&lon=" + lon); - } - if (API_CMD_STOP_AV_REC.equals(command)) { - // test record video - uri = Uri.parse("osmand.api://stop_av_rec"); - } - - if (API_CMD_ADD_MAP_MARKER.equals(command)) { - // test marker - uri = Uri.parse("osmand.api://add_map_marker?lat=" + lat + "&lon=" + lon + "&name=Marker"); - } - - if (API_CMD_ADD_FAVORITE.equals(command)) { - // test favorite - uri = Uri.parse("osmand.api://add_favorite?lat=" + lat + "&lon=" + lon + "&name=Favorite&desc=Description&category=test2&color=red&visible=true"); - } - - if (API_CMD_START_GPX_REC.equals(command)) { - // test start gpx recording - uri = Uri.parse("osmand.api://start_gpx_rec"); - } - - if (API_CMD_STOP_GPX_REC.equals(command)) { - // test stop gpx recording - uri = Uri.parse("osmand.api://stop_gpx_rec"); - } - - if (API_CMD_SHOW_GPX.equals(command)) { - // test show gpx (path) - //File gpx = new File(app.getAppPath(IndexConstants.GPX_INDEX_DIR), gpxName); - //uri = Uri.parse("osmand.api://show_gpx?path=" + URLEncoder.encode(gpx.getAbsolutePath(), "UTF-8")); - - // test show gpx (data) - uri = Uri.parse("osmand.api://show_gpx"); - intent = new Intent(Intent.ACTION_VIEW, uri); - //intent.putExtra("data", AndroidUtils.getFileAsString( - // new File(app.getAppPath(IndexConstants.GPX_INDEX_DIR), gpxName))); - } - - if (API_CMD_NAVIGATE_GPX.equals(command)) { - // test navigate gpx (path) - //File gpx = new File(app.getAppPath(IndexConstants.GPX_INDEX_DIR), gpxName); - //uri = Uri.parse("osmand.api://navigate_gpx?force=true&path=" + URLEncoder.encode(gpx.getAbsolutePath(), "UTF-8")); - - // test navigate gpx (data) - uri = Uri.parse("osmand.api://navigate_gpx?force=true"); - intent = new Intent(Intent.ACTION_VIEW, uri); - //intent.putExtra("data", AndroidUtils.getFileAsString( - // new File(app.getAppPath(IndexConstants.GPX_INDEX_DIR), gpxName))); - } - - if (intent == null && uri != null) { - intent = new Intent(Intent.ACTION_VIEW, uri); - } - - if (intent != null) { - startActivityForResult(intent, REQUEST_OSMAND_API); - /* - // setup the Intent to deep link into Android Market - Uri marketUri = Uri.parse("market://search?q=pname:net.osmand"); - Intent marketIntent = new Intent(Intent.ACTION_VIEW).setData(marketUri); - - PackageManager pm = getPackageManager(); - startActivity(pm.queryIntentActivities(intent, 0).size() == 0 ? - intent : marketIntent); - */ - } - - } catch (Exception e) { - Log.e("Osmand API", "Error", e); - } - } - - /* - Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG) - .setAction("Action", null).show(); - */ - - @Override - protected void onActivityResult(int requestCode, int resultCode, Intent data) { - if (requestCode == REQUEST_OSMAND_API) { - View view = findViewById(R.id.main_view); - if (view != null) { - StringBuilder sb = new StringBuilder(); - sb.append("ResultCode=").append(resultCodeStr(resultCode)); - Bundle extras = data.getExtras(); - if (extras != null && extras.size() > 0) { - for (String key : data.getExtras().keySet()) { - Object val = extras.get(key); - if (sb.length() > 0) { - sb.append("\n"); - } - sb.append(key).append("=").append(val); - } - } - - AlertDialog.Builder builder = new AlertDialog.Builder(this); - builder.setMessage(sb.toString()); - builder.setPositiveButton("OK", null); - builder.create().show(); - } - } else { - super.onActivityResult(requestCode, resultCode, data); - } - } - - private String resultCodeStr(int resultCode) { - switch (resultCode) { - case RESULT_CODE_OK: - return "OK"; - case RESULT_CODE_ERROR_UNKNOWN: - return "Unknown error"; - case RESULT_CODE_ERROR_NOT_IMPLEMENTED: - return "Feature is not implemented"; - case RESULT_CODE_ERROR_GPX_NOT_FOUND: - return "GPX not found"; - case RESULT_CODE_ERROR_INVALID_PROFILE: - return "Invalid profile"; - case RESULT_CODE_ERROR_PLUGIN_INACTIVE: - return "Plugin inactive"; - } - return "" + resultCode; - } -} diff --git a/api-test/src/main/res/layout/activity_main.xml b/api-test/src/main/res/layout/activity_main.xml deleted file mode 100644 index 297fce6ba5..0000000000 --- a/api-test/src/main/res/layout/activity_main.xml +++ /dev/null @@ -1,165 +0,0 @@ - - - - - - - - - - - - - - - - - -