Merge branch 'master' of github.com:osmandapp/Osmand

This commit is contained in:
Victor Shcherb 2015-11-16 00:34:14 +01:00
commit 9bdb0e5355
9 changed files with 203 additions and 117 deletions

View file

@ -360,7 +360,7 @@
<string name="poi_physiotherapist">Physiotherapeut</string> <string name="poi_physiotherapist">Physiotherapeut</string>
<string name="poi_picnic_site">Picknick</string> <string name="poi_picnic_site">Picknick</string>
<string name="poi_pier">Pier</string> <string name="poi_pier">Pier</string>
<string name="poi_pitch">Stellplatz</string> <string name="poi_pitch">Sportplatz</string>
<string name="poi_place_allotments">Kleingartensiedlung</string> <string name="poi_place_allotments">Kleingartensiedlung</string>
<string name="poi_place_farm">Farm</string> <string name="poi_place_farm">Farm</string>
<string name="poi_place_of_worship">Kultstätte</string> <string name="poi_place_of_worship">Kultstätte</string>
@ -585,7 +585,7 @@
<string name="poi_windmill">Windmühle</string> <string name="poi_windmill">Windmühle</string>
<string name="poi_window_blind">Rollvorhang</string> <string name="poi_window_blind">Rollvorhang</string>
<string name="poi_craft_window_construction">Fensterbau</string> <string name="poi_craft_window_construction">Fensterbau</string>
<string name="poi_works">Anlage</string> <string name="poi_works">Produktionsstätte</string>
<string name="poi_wreck">Schiffswrack</string> <string name="poi_wreck">Schiffswrack</string>
<string name="poi_zoo">Zoo</string> <string name="poi_zoo">Zoo</string>
<string name="poi_american_football">Amerik. Football</string> <string name="poi_american_football">Amerik. Football</string>
@ -1027,4 +1027,6 @@
<string name="poi_office_religion">Büro einer Glaubensgemeinschaft</string> <string name="poi_office_religion">Büro einer Glaubensgemeinschaft</string>
<string name="poi_financial">Finanzverwaltung</string> <string name="poi_financial">Finanzverwaltung</string>
<string name="poi_highway_steps">Treppe</string>
<string name="poi_historic_milestone">Meilenstein</string>
</resources> </resources>

View file

@ -1800,6 +1800,7 @@ Afghanistan, Ägypten, Albanien, Algerien, Andorra, Angola, Anguilla, Antigua an
<string name="dash_download_new_one">Neue Karte herunterladen</string> <string name="dash_download_new_one">Neue Karte herunterladen</string>
<string name="dash_download_manage">Karten verwalten</string> <string name="dash_download_manage">Karten verwalten</string>
<string name="rendering_attr_roadStyle_name">Straßendarstellung</string> <string name="rendering_attr_roadStyle_name">Straßendarstellung</string>
<string name="rendering_attr_roadStyle_description">Straßendarstellung</string>
<string name="rendering_value__name">Standard</string> <string name="rendering_value__name">Standard</string>
<string name="rendering_value_default_name">Standard</string> <string name="rendering_value_default_name">Standard</string>
<string name="rendering_value_orange_name">Orange</string> <string name="rendering_value_orange_name">Orange</string>
@ -1991,7 +1992,9 @@ Afghanistan, Ägypten, Albanien, Algerien, Andorra, Angola, Anguilla, Antigua an
<string name="rendering_value_default13_name">Standard (13)</string> <string name="rendering_value_default13_name">Standard (13)</string>
<string name="rendering_value_defaultTranslucentCyan_name">Standard (transparentes Cyan)</string> <string name="rendering_value_defaultTranslucentCyan_name">Standard (transparentes Cyan)</string>
<string name="rendering_attr_currentTrackColor_name">GPX-Farbe</string> <string name="rendering_attr_currentTrackColor_name">GPX-Farbe</string>
<string name="rendering_attr_currentTrackColor_description">GPX-Farbe</string>
<string name="rendering_attr_currentTrackWidth_name">GPX-Breite</string> <string name="rendering_attr_currentTrackWidth_name">GPX-Breite</string>
<string name="rendering_attr_currentTrackWidth_description">GPX-Breite</string>
<string name="rendering_value_red_name">Rot</string> <string name="rendering_value_red_name">Rot</string>
<string name="rendering_value_translucent_red_name">Transparentes Rot</string> <string name="rendering_value_translucent_red_name">Transparentes Rot</string>
<string name="rendering_value_translucent_orange_name">Transparentes Orange</string> <string name="rendering_value_translucent_orange_name">Transparentes Orange</string>

View file

@ -2111,4 +2111,6 @@ Afghanistan, Albanie, Algérie, Allemagne, Andorre, Angola, Anguilla, Antigua-et
<string name="poi_dialog_reopen">Ré-ouvrir</string> <string name="poi_dialog_reopen">Ré-ouvrir</string>
<string name="osm_edit_commented_note">Note OSM commentée</string> <string name="osm_edit_commented_note">Note OSM commentée</string>
<string name="osm_edit_modified_poi">PI OSM modifié</string>
<string name="osm_edit_deleted_poi">PI OSM supprimé</string>
</resources> </resources>

View file

@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?><resources> <?xml version='1.0' encoding='utf-8'?>
<resources>
<string name="layer_map_appearance">Configureer scherm</string> <string name="layer_map_appearance">Configureer scherm</string>
<string name="show_lanes">Toon rijstroken</string> <string name="show_lanes">Toon rijstroken</string>
@ -2199,4 +2200,20 @@ Afghanistan, Albanie, Algerije, Andorra, Angola, Anguilla, Antigua en Barbuda, A
<string name="lang_fy">Fries</string> <string name="lang_fy">Fries</string>
<string name="lang_als">Toskisch (Albanees)</string> <string name="lang_als">Toskisch (Albanees)</string>
<string name="shared_string_location">Locatie</string> <string name="shared_string_location">Locatie</string>
<string name="osm_edit_modified_poi">Gewijzigde OSM POI</string>
<string name="osm_edit_deleted_poi">Gewiste OSM POI</string>
<string name="context_menu_item_open_note">Open OSM-opmerking</string>
<string name="osm_edit_reopened_note">Heropende OSM-opmerking</string>
<string name="osm_edit_commented_note">OSM-opmerking met commentaar</string>
<string name="osm_edit_removed_note">OSM-opmerking gewist</string>
<string name="osm_edit_created_note">OSM-opmerking gemaakt</string>
<string name="osn_bug_name">OSM-opmerking</string>
<string name="osn_add_dialog_title">Maak opmerking</string>
<string name="osn_comment_dialog_title">Voeg commentaar toe</string>
<string name="osn_reopen_dialog_title">Heropen notitie</string>
<string name="osn_close_dialog_title">Sluit notitie</string>
<string name="osn_add_dialog_success">Notitie aangemaakt</string>
<string name="osn_add_dialog_error">Er was een probleem: notitie niet aangemaakt</string>
<string name="osn_close_dialog_success">Bug is gesloten</string>
<string name="osn_close_dialog_error">Er was een probleem: notitie is niet afgesloten</string>
</resources> </resources>

View file

@ -1658,4 +1658,35 @@
<string name="poi_wiki_lang_mn">Wiki in mòngolu</string> <string name="poi_wiki_lang_mn">Wiki in mòngolu</string>
<string name="poi_wiki_lang_nap">Wiki in napoletanu</string> <string name="poi_wiki_lang_nap">Wiki in napoletanu</string>
<string name="poi_industrial_oil">Casta: industria petrolìfera</string>
<string name="poi_industrial_wellsite">Casta: giassu de putzos</string>
<string name="poi_industrial_factory">Casta: fàbrica</string>
<string name="poi_industrial_gas">Casta: industria de gas</string>
<string name="poi_industrial_timber">Casta: linna</string>
<string name="poi_industrial_refinery">Casta: rafineria</string>
<string name="poi_industrial_warehouse">Casta: magasinu</string>
<string name="poi_industrial_auto_wrecker">Casta: iscontza-màchinas</string>
<string name="poi_industrial_agriculture">Casta: agricultura</string>
<string name="poi_industrial_brewery">Casta: birrifìtziu</string>
<string name="poi_industrial_depot">Casta: depòsitu</string>
<string name="poi_industrial_brickyard">Casta: fàbrica de matones</string>
<string name="poi_industrial_intermodal_freight_terminal">Casta: terminal de trasportu intermodale</string>
<string name="poi_industrial_sawmill">Casta: segheria</string>
<string name="poi_industrial_water_purification">Casta: purificatzione de sabba</string>
<string name="poi_industrial_port">Casta: portu</string>
<string name="poi_watering_place">Abbadòrgiu</string>
<string name="poi_animal_boarding">Posada pro animales</string>
<string name="poi_animal_boarding_dog">Casta de posada: pro canes</string>
<string name="poi_animal_boarding_cat">Casta de posada: pro gatos</string>
<string name="poi_animal_boarding_dog_cat">Casta de posada: pro canes e gatos</string>
<string name="poi_animal_boarding_horse">Casta de posada: pro caddos</string>
<string name="poi_historic_aircraft">Aèreu istòricu</string>
<string name="poi_honey">Butega de mele</string>
<string name="poi_elevator_yes">Cun ascensore</string>
<string name="poi_elevator_no">Chene ascensore</string>
</resources> </resources>

View file

@ -165,7 +165,7 @@
<string name="speak_cameras">Autovelox</string> <string name="speak_cameras">Autovelox</string>
<string name="speak_traffic_warnings">Avisos de tràfficu</string> <string name="speak_traffic_warnings">Avisos de tràfficu</string>
<string name="osb_author_or_password_not_specified">Pro piaghere dislinda su nùmene impitadore OSM e sa crae (password) in sas Impostaduras</string> <string name="osb_author_or_password_not_specified">Pro piaghere dislinda su nùmene impitadore OSM e sa crae (password) in sas Impostatziones</string>
<string name="clear_intermediate_points">Burra sos puntos mesanos</string> <string name="clear_intermediate_points">Burra sos puntos mesanos</string>
<string name="keep_intermediate_points">Mantènne sos puntos mesanos</string> <string name="keep_intermediate_points">Mantènne sos puntos mesanos</string>
<string name="new_directions_point_dialog">Tenes giai puntos mesanos impostaos.</string> <string name="new_directions_point_dialog">Tenes giai puntos mesanos impostaos.</string>
@ -181,7 +181,7 @@
<string name="app_mode_default">Predefinidu</string> <string name="app_mode_default">Predefinidu</string>
<string name="settings_preset">Profilu predefinidu</string> <string name="settings_preset">Profilu predefinidu</string>
<string name="settings_preset_descr">Issèbera unu profilu de impreu cun impostaduras pessonalizadas pro sa mapa e su nàvigu.</string> <string name="settings_preset_descr">Issèbera unu profilu de impreu cun impostatziones pessonalizadas pro sa mapa e su nàvigu.</string>
<string name="destination_point">Destinatzione %1$s</string> <string name="destination_point">Destinatzione %1$s</string>
<string name="context_menu_item_destination_point">Imposta comente destinatzione</string> <string name="context_menu_item_destination_point">Imposta comente destinatzione</string>
<string name="please_select_address">Issèbera in antis sa citade o sistrada</string> <string name="please_select_address">Issèbera in antis sa citade o sistrada</string>
@ -235,15 +235,15 @@
<string name="monitoring_settings">Registratzione biàgios</string> <string name="monitoring_settings">Registratzione biàgios</string>
<string name="monitoring_settings_descr">Cunfigura comente registrare sos biàgios tuos</string> <string name="monitoring_settings_descr">Cunfigura comente registrare sos biàgios tuos</string>
<string name="osmo_settings_uuid">ID ùnicu de su dispositivu</string> <string name="osmo_settings_uuid">ID ùnicu de su dispositivu</string>
<string name="osmo_settings_descr">Cunfigura sas impostaduras de compidada de su dispositivu e imposta su canale de compidada pessonale</string> <string name="osmo_settings_descr">Cunfigura sas impostatziones de compidada de su dispositivu e imposta su canale de compidada pessonale</string>
<string name="osmo_plugin_description">"Custa estensione frunit sas funtzionalidades pro impreare sa compidada avantzada in dereta OsMo, bie http://osmo.mobi. <string name="osmo_plugin_description">"Custa estensione frunit sas funtzionalidades pro impreare sa compidada avantzada in dereta OsMo, bie http://osmo.mobi.
\n\nSighi totu sos dispositivos de unu grupu in ue e comùnica cun sos àteros. Sunt disponìbiles meda impostaduras pro sarrastamentu, pro sa sessione in cursu o permanentes. \n\nSighi totu sos dispositivos de unu grupu in ue e comùnica cun sos àteros. Sunt disponìbiles meda impostatziones pro sarrastamentu, pro sa sessione in cursu o permanentes.
\n\nSos grupos anònimos podent èssere creados pro su nùmeru pretzisu de dies e bi sunt lìmites pro calicuna de sas funtziones, es. non best su controllu remotu e nemmancu samministradore de su grupu. Grupos cun totu sas funtzionalidades podent èssere creados in su giassu e petzi sos impitadores registrados podent atzèdere. "</string> \n\nSos grupos anònimos podent èssere creados pro su nùmeru pretzisu de dies e bi sunt lìmites pro calicuna de sas funtziones, es. non best su controllu remotu e nemmancu samministradore de su grupu. Grupos cun totu sas funtzionalidades podent èssere creados in su giassu e petzi sos impitadores registrados podent atzèdere. "</string>
<string name="osmo_plugin_name">OsMo (Compidada OSM)</string> <string name="osmo_plugin_name">OsMo (Compidada OSM)</string>
<string name="osmo_settings">OsMo</string> <string name="osmo_settings">OsMo</string>
<string name="osmand_background_plugin_description">Ammustrat sas impostaduras pro abilitare sarrastamentu e su nàvigu in modalidade de isfundu (ischermu istudadu) pro mèdiu de ischidaduras periòdicas de su GPS.</string> <string name="osmand_background_plugin_description">Ammustrat sas impostatziones pro abilitare sarrastamentu e su nàvigu in modalidade de isfundu (ischermu istudadu) pro mèdiu de ischidaduras periòdicas de su GPS.</string>
<string name="contribution_activity">Installa sa versione</string> <string name="contribution_activity">Installa sa versione</string>
<string name="choose_osmand_theme_descr">Issèbera su tema de saplicu</string> <string name="choose_osmand_theme_descr">Issèbera su tema de saplicu</string>
<string name="choose_osmand_theme">Tema de saplicu</string> <string name="choose_osmand_theme">Tema de saplicu</string>
@ -296,8 +296,8 @@
<string name="av_use_external_recorder_descr">Imprea su registratore de sistema pro sos videos</string> <string name="av_use_external_recorder_descr">Imprea su registratore de sistema pro sos videos</string>
<string name="av_use_external_recorder">Imprea su registratore de sistema</string> <string name="av_use_external_recorder">Imprea su registratore de sistema</string>
<string name="av_use_external_camera">Imprea sapp fotocàmera</string> <string name="av_use_external_camera">Imprea sapp fotocàmera</string>
<string name="av_settings_descr">Cunfigura sas impostaduras àudio e vìdeo</string> <string name="av_settings_descr">Cunfigura sas impostatziones àudio e vìdeo</string>
<string name="av_settings">Impostaduras àudio/vìdeo </string> <string name="av_settings">"Impostatziones àudio/vìdeo "</string>
<string name="recording_error">Errore durante sa registratzione </string> <string name="recording_error">Errore durante sa registratzione </string>
<string name="recording_camera_not_available">Sa fotocamera non est disponibile</string> <string name="recording_camera_not_available">Sa fotocamera non est disponibile</string>
<string name="recording_is_recorded">Sàudio/vìdeo istat pro èssere registrau. Pro lu firmare carca su widget AV.</string> <string name="recording_is_recorded">Sàudio/vìdeo istat pro èssere registrau. Pro lu firmare carca su widget AV.</string>
@ -353,7 +353,7 @@
<string name="rendering_attr_showRoadMaps_name">Mapas cun petzi istradas</string> <string name="rendering_attr_showRoadMaps_name">Mapas cun petzi istradas</string>
<string name="safe_mode_description">Avia saplicu in modalidade segura (impreande Android, prus lentu, imbetzes de su còdighe nativu).</string> <string name="safe_mode_description">Avia saplicu in modalidade segura (impreande Android, prus lentu, imbetzes de su còdighe nativu).</string>
<string name="safe_mode">Modalidade segura</string> <string name="safe_mode">Modalidade segura</string>
<string name="native_library_not_running">Saplicu est traballande in modalidade segura (la podes disabilitare in sas Impostaduras).</string> <string name="native_library_not_running">Saplicu est traballande in modalidade segura (la podes disabilitare in sas Impostatziones).</string>
<string name="background_service_is_enabled_question">Su servitziu OsmAnd de isfundu est galu in esecutzione. Lu boles firmare?</string> <string name="background_service_is_enabled_question">Su servitziu OsmAnd de isfundu est galu in esecutzione. Lu boles firmare?</string>
@ -364,7 +364,7 @@
<string name="map_widget_show_destination_arrow">Ammustra sa diretzione de sa destinatzione</string> <string name="map_widget_show_destination_arrow">Ammustra sa diretzione de sa destinatzione</string>
<string name="enable_plugin_monitoring_services">"Abìlita sestensione de registratzione biàgios pro impreare sos servìtzios de registratzione de sa positzione (registratzione GPX, arrastamentu in lìnia)"</string> <string name="enable_plugin_monitoring_services">"Abìlita sestensione de registratzione biàgios pro impreare sos servìtzios de registratzione de sa positzione (registratzione GPX, arrastamentu in lìnia)"</string>
<string name="non_optimal_route_calculation">Càlcula unàndala, sin casu mai fintzas non primorosa, pro sas distantzias longas</string> <string name="non_optimal_route_calculation">Càlcula unàndala, sin casu mai fintzas non primorosa, pro sas distantzias longas</string>
<string name="gps_not_available">Ativa su GPS in sas impostaduras</string> <string name="gps_not_available">Allue su GPS in sas impostatziones</string>
<string name="map_widget_monitoring_services">Servitzios de registratzione</string> <string name="map_widget_monitoring_services">Servitzios de registratzione</string>
<string name="no_route">Peruna àndala</string> <string name="no_route">Peruna àndala</string>
@ -729,7 +729,7 @@
<string name="plugins_screen">Estensiones</string> <string name="plugins_screen">Estensiones</string>
<string name="prefs_plugins_descr">Sas estensiones abìlitant funtzionalidades agiuntivas e impostaduras avantzadas</string> <string name="prefs_plugins_descr">Sas estensiones abìlitant funtzionalidades agiuntivas e impostatziones avantzadas</string>
<string name="prefs_plugins">Estensiones</string> <string name="prefs_plugins">Estensiones</string>
<string name="debugging_and_development">Isvilupu de OsmAnd</string> <string name="debugging_and_development">Isvilupu de OsmAnd</string>
<string name="native_rendering">Disinnu nativu</string> <string name="native_rendering">Disinnu nativu</string>
@ -798,13 +798,13 @@
<string name="index_name_oceania">Austràlia e Otzeània</string> <string name="index_name_oceania">Austràlia e Otzeània</string>
<string name="index_name_other">Mapas mundiales e de base</string> <string name="index_name_other">Mapas mundiales e de base</string>
<string name="amenity_type_osmwiki">Wikipedia (non in lìnia)</string> <string name="amenity_type_osmwiki">Wikipedia (non in lìnia)</string>
<string name="profile_settings">Impostaduras dislindadas de su profilu</string> <string name="profile_settings">Impostatziones dislindadas de su profilu</string>
<string name="routing_settings">Nàvigu</string> <string name="routing_settings">Nàvigu</string>
<string name="routing_settings_descr">Dislinda sas optziones de nàvigu</string> <string name="routing_settings_descr">Dislinda sas optziones de nàvigu</string>
<string name="global_settings">Impostaduras globales</string> <string name="global_settings">Impostatziones globales</string>
<string name="general_settings">Impostaduras generales</string> <string name="general_settings">Impostatziones generales</string>
<string name="general_settings_descr">Cunfigura sas impostaduras globales</string> <string name="general_settings_descr">Cunfigura sas impostatziones globales</string>
<string name="global_app_settings">Impostaduras globales de saplicu</string> <string name="global_app_settings">Impostatziones globales de saplicu</string>
<string name="user_name">Nùmene impitadore in OSM</string> <string name="user_name">Nùmene impitadore in OSM</string>
<string name="user_password">Crae (password) in OSM</string> <string name="user_password">Crae (password) in OSM</string>
@ -812,8 +812,8 @@
<string name="auto_follow_route_never">Mai (carca \'Bae\' pro aviare manualmente sa ghia)</string> <string name="auto_follow_route_never">Mai (carca \'Bae\' pro aviare manualmente sa ghia)</string>
<string name="keep_informing_never">Manualmente ebbia (carca sa fritza)</string> <string name="keep_informing_never">Manualmente ebbia (carca sa fritza)</string>
<string name="keep_informing">Torra a repìtere sas istrutziones de nàvigu</string> <string name="keep_informing">Torra a repìtere sas istrutziones de nàvigu</string>
<string name="pref_raster_map">Impostaduras de sa mitza de sa mapa</string> <string name="pref_raster_map">Impostatziones de sa mitza de sa mapa</string>
<string name="pref_vector_map">Impostaduras de sa mapa vetoriale</string> <string name="pref_vector_map">Impostatziones de sa mapa vetoriale</string>
<string name="city_type_hamlet">Bidda</string> <string name="city_type_hamlet">Bidda</string>
<string name="city_type_village">Bidditzolu</string> <string name="city_type_village">Bidditzolu</string>
<string name="city_type_town">Tzidadina</string> <string name="city_type_town">Tzidadina</string>
@ -872,10 +872,10 @@
<string name="poi_error_info_not_loaded">Informatziones relatas a su nodu non carrigadas</string> <string name="poi_error_info_not_loaded">Informatziones relatas a su nodu non carrigadas</string>
<string name="poi_error_io_error_template">Errore de I/O durante sesecutzione de satzione {0}.</string> <string name="poi_error_io_error_template">Errore de I/O durante sesecutzione de satzione {0}.</string>
<string name="poi_action_succeded_template">Atzione {0} reseddida cumpridamente.</string> <string name="poi_action_succeded_template">Atzione {0} reseddida cumpridamente.</string>
<string name="first_time_msg">Gratzias pro simpreu de OsmAnd. Pro meda de sas caraterìsticas de sàplicu tènes bisongiu de datos locales chene lìnia, chi podent èssere icarrigadas dae \'Impostaduras\'→\'Amministra sos documentos de sas mapas\'. A pustis at a èssere possìbile ammustrare mapas, chircare indirìtzos, PDI, e agatare trasportos pùblicos.</string> <string name="first_time_msg">Gratzias pro simpreu de OsmAnd. Pro meda de sas caraterìsticas de sàplicu tènes bisongiu de datos locales chene lìnia, chi podent èssere icarrigadas dae \'Impostatziones\'→\'Amministra sos documentos de sas mapas\'. A pustis at a èssere possìbile ammustrare mapas, chircare indirìtzos, PDI, e agatare trasportos pùblicos.</string>
<string name="basemap_was_selected_to_download">Sa mapa de base est netzessària pro su funtzionamentu curretu de sàplicu e est istada ischertada pro siscarrigamentu.</string> <string name="basemap_was_selected_to_download">Sa mapa de base est netzessària pro su funtzionamentu curretu de sàplicu e est istada ischertada pro siscarrigamentu.</string>
<string name="osmand_development_plugin_description">Custa estensione ammustrat sas impostaduras pro funtzionalidades pro isvilupu e debug comente sa simulatzione de su nàvigu, sa visualizatzione de sa prestatzione de su rèndering, o s\'interfàtzia vocale. Custas impostaduras sunt pensadas pro sos isvilupadores e non sunt netzessàrias pro sos àteros impitadores.</string> <string name="osmand_development_plugin_description">Custa estensione ammustrat sas impostatziones pro funtzionalidades pro isvilupu e debug comente sa simulatzione de su nàvigu, sa visualizatzione de sa prestatzione de su rèndering, o s\'interfàtzia vocale. Custas impostatziones sunt pensadas pro sos isvilupadores e non sunt netzessàrias pro sos àteros impitadores.</string>
<string name="vector_maps_may_display_faster_on_some_devices">Sas mapas vetoriales diat dèpere apàrrere in manera prus lestra. In carchi dispositivu diat podere funtzionare male.</string> <string name="vector_maps_may_display_faster_on_some_devices">Sas mapas vetoriales diat dèpere apàrrere in manera prus lestra. In carchi dispositivu diat podere funtzionare male.</string>
<string name="osmand_parking_warning_text">Pretzdentemente est istada annangada a su tzeravallu/calendàriu tuo sa notìfica pro recuperare sa màchina. At a abarrare finas a cando non l\'as a burrare manualmente.</string> <string name="osmand_parking_warning_text">Pretzdentemente est istada annangada a su tzeravallu/calendàriu tuo sa notìfica pro recuperare sa màchina. At a abarrare finas a cando non l\'as a burrare manualmente.</string>
<string name="rendering_attr_noPolygons_description">Faghe divènnere transparentes totu sas caraterìsticas de sas àreas de su terrinu</string> <string name="rendering_attr_noPolygons_description">Faghe divènnere transparentes totu sas caraterìsticas de sas àreas de su terrinu</string>
@ -888,12 +888,12 @@
<string name="osm_editing_plugin_description">Custa estensione permitit de cuntribuire ad OSM creande e modificande sos PDI de OSM, aberinde e cummentande errores de OSM e imbiande documentos GPX registrados. OSM est unu progetu pùblicu de mapadura fatu dae una comunidade globale. Pro àteras informatziones: http://openstreetmap.org. Sa partetzipatzione est apretziada, e sas cuntributziones podent èssere fatas deretamente dae OsmAnd insertande in intro de s\'aplicu sas credentziales de atzessu.</string> <string name="osm_editing_plugin_description">Custa estensione permitit de cuntribuire ad OSM creande e modificande sos PDI de OSM, aberinde e cummentande errores de OSM e imbiande documentos GPX registrados. OSM est unu progetu pùblicu de mapadura fatu dae una comunidade globale. Pro àteras informatziones: http://openstreetmap.org. Sa partetzipatzione est apretziada, e sas cuntributziones podent èssere fatas deretamente dae OsmAnd insertande in intro de s\'aplicu sas credentziales de atzessu.</string>
<string name="play_commands_of_currently_selected_voice">Riprodui sos cumandos de sa boghe ischertada</string> <string name="play_commands_of_currently_selected_voice">Riprodui sos cumandos de sa boghe ischertada</string>
<string name="test_voice_prompts">Proa sos cumandos vocales</string> <string name="test_voice_prompts">Proa sos cumandos vocales</string>
<string name="switch_to_raster_map_to_see">Peruna mapa vetoriale est disponìbile pro custa positzione. Ne podes iscarrigare una in Impostaduras (Amministra sos documentos de sas mapas), o colare a sas mapas in lìnia (abìlita sas mapas in lìnia pro lu fàghere).</string> <string name="switch_to_raster_map_to_see">Peruna mapa vetoriale est disponìbile pro custa positzione. Ne podes iscarrigare una in Impostatziones (Amministra sos documentos de sas mapas), o colare a sas mapas in lìnia (abìlita sas mapas in lìnia pro lu fàghere).</string>
<string name="support_new_features_descr">Faghe una donatzione pro tènnere funtzionalidades noas implementadas in sàplicu</string> <string name="support_new_features_descr">Faghe una donatzione pro tènnere funtzionalidades noas implementadas in sàplicu</string>
<string name="accessibility_extensions_descr">Estensiones pro satzessibilidade pro versiones betzas de Android</string> <string name="accessibility_extensions_descr">Estensiones pro satzessibilidade pro versiones betzas de Android</string>
<string name="accessibility_extensions">Estensiones pro satzessibilidade</string> <string name="accessibility_extensions">Estensiones pro satzessibilidade</string>
<string name="accessibility_default">Basada in supra de sas impostaduras globales de sistema</string> <string name="accessibility_default">Basada in supra de sas impostatziones globales de sistema</string>
<string name="zoomOut">Zoom in segus</string> <string name="zoomOut">Zoom in segus</string>
<string name="zoomIn">Zoom in antis</string> <string name="zoomIn">Zoom in antis</string>
<string name="front">in antis</string> <string name="front">in antis</string>
@ -933,7 +933,7 @@
<string name="live_monitoring_interval">Intervallu de sarrastamentu in dereta (in lìnia)</string> <string name="live_monitoring_interval">Intervallu de sarrastamentu in dereta (in lìnia)</string>
<string name="live_monitoring_url_descr">Dislinda sindiritzu ìnternet cun sa sintassi de sos paràmetros: lat={0}, lon={1}, data/ora={2}, hdop={3}, artària={4}, lestresa={5}, àngulu={6}</string> <string name="live_monitoring_url_descr">Dislinda sindiritzu ìnternet cun sa sintassi de sos paràmetros: lat={0}, lon={1}, data/ora={2}, hdop={3}, artària={4}, lestresa={5}, àngulu={6}</string>
<string name="live_monitoring_url">Indiritzu ìnternet pro sarrastamentu in dereta</string> <string name="live_monitoring_url">Indiritzu ìnternet pro sarrastamentu in dereta</string>
<string name="gpx_monitoring_disabled_warn">Registra sa rasta impreande su widget GPX o sas impostaduras \'Registratzione biàgios\'.</string> <string name="gpx_monitoring_disabled_warn">Registra sa rasta impreande su widget GPX o sas impostatziones \'Registratzione biàgios\'.</string>
<string name="free_version_message">Custa versione de badas de OsmAnd est limitada a %1$s iscarrigamentos e non suportat sos artìculos non in lìnia de Wikipedia.</string> <string name="free_version_message">Custa versione de badas de OsmAnd est limitada a %1$s iscarrigamentos e non suportat sos artìculos non in lìnia de Wikipedia.</string>
<string name="index_name_voice">Indicatziones vocales (registradas, funtzionalidades limitadas)</string> <string name="index_name_voice">Indicatziones vocales (registradas, funtzionalidades limitadas)</string>
@ -1049,7 +1049,7 @@
<string name="shared_string_none">Perunu</string> <string name="shared_string_none">Perunu</string>
<string name="map_overlay">Mapa subraposta</string> <string name="map_overlay">Mapa subraposta</string>
<string name="map_overlay_descr">Issèbera mapa de subrapositzione</string> <string name="map_overlay_descr">Issèbera mapa de subrapositzione</string>
<string name="tile_source_already_installed">Sa mapa est giai installata, sas impostaduras ant a èssere agiornadas</string> <string name="tile_source_already_installed">Sa mapa est giai installata, sas impostatziones ant a èssere agiornadas</string>
<string name="select_tile_source_to_install">Issèbera sas mapas (tasseddos) da installare o agiornare</string> <string name="select_tile_source_to_install">Issèbera sas mapas (tasseddos) da installare o agiornare</string>
<string name="internet_not_available">Una connessione ìnternet est netzessària pro custa operatzione, ma no nde bi sunt disponìbiles</string> <string name="internet_not_available">Una connessione ìnternet est netzessària pro custa operatzione, ma no nde bi sunt disponìbiles</string>
<string name="install_more">Installa àteru…</string> <string name="install_more">Installa àteru…</string>
@ -1221,7 +1221,7 @@
<string name="osmand_routing_experimental">Su nàvigu chene lìnia de OsmAnd est isperimentale e non funtzionat pro distàntzias prus mannas de 20 km.\n\nSu servìtziu de nàvigu benit frunidu intertantu pro mèdiu de CloudMade in lìnia.</string> <string name="osmand_routing_experimental">Su nàvigu chene lìnia de OsmAnd est isperimentale e non funtzionat pro distàntzias prus mannas de 20 km.\n\nSu servìtziu de nàvigu benit frunidu intertantu pro mèdiu de CloudMade in lìnia.</string>
<string name="osmand_net_previously_installed">Best installada una versione prus betza de OsmAnd. Totu sos datos ant a èssere suportados dae saplicatzione noa. Sos preferidos depent èssere esportados dae saplicatzione betza e importados a manuda in sa noa.</string> <string name="osmand_net_previously_installed">Best installada una versione prus betza de OsmAnd. Totu sos datos ant a èssere suportados dae saplicatzione noa. Sos preferidos depent èssere esportados dae saplicatzione betza e importados a manuda in sa noa.</string>
<string name="gps_status_app_not_found">Aplicu istadu GPS no installadu. Lu boles chircare in su Market?</string> <string name="gps_status_app_not_found">Aplicu istadu GPS no installadu. Lu boles chircare in su Market?</string>
<string name="voice_is_not_available_msg">Boghe de ghia non disponìbile. Intra in \'Impostaduras\' → \'Impostaduras generales\' → \'Ghia vocale\', issèbera su pachete preferidu e/o iscàrrigalu.</string> <string name="voice_is_not_available_msg">Boghe de ghia non disponìbile. Intra in \'Impostatziones\' → \'Impostatziones generales\' → \'Ghia vocale\', issèbera su pachete preferidu e/o iscàrrigalu.</string>
<string name="daynight_descr">Issèbera sas règulas pro sa muda de sa modalidade die/note</string> <string name="daynight_descr">Issèbera sas règulas pro sa muda de sa modalidade die/note</string>
<string name="download_files_question">Iscarrigare {0} documentu/os ({1} MB)?</string> <string name="download_files_question">Iscarrigare {0} documentu/os ({1} MB)?</string>
<string name="shared_string_refresh">Torra a carrigare</string> <string name="shared_string_refresh">Torra a carrigare</string>
@ -1358,13 +1358,13 @@
<string name="use_online_routing_descr">Imprea ìnternet pro calculare sàndala</string> <string name="use_online_routing_descr">Imprea ìnternet pro calculare sàndala</string>
<string name="use_online_routing">Imprea singendradore de àndalas in lìnia</string> <string name="use_online_routing">Imprea singendradore de àndalas in lìnia</string>
<string name="osm_settings_descr">Dislinda sas impostaduras Openstreetmap.org (OSM) netzessàrias pro contribuire a OSM</string> <string name="osm_settings_descr">Dislinda sas impostatziones Openstreetmap.org (OSM) netzessàrias pro contribuire a OSM</string>
<string name="data_settings_descr">Dislinda sa limba, iscàrriga/torra a carrigare sos datos</string> <string name="data_settings_descr">Dislinda sa limba, iscàrriga/torra a carrigare sos datos</string>
<string name="data_settings">Datos</string> <string name="data_settings">Datos</string>
<string name="osm_settings">Modìficas OSM</string> <string name="osm_settings">Modìficas OSM</string>
<string name="additional_settings">Impostaduras annativas</string> <string name="additional_settings">Impostatziones agiuntivas</string>
<string name="shared_string_settings">Impostaduras</string> <string name="shared_string_settings">Impostatziones</string>
<string name="save_current_track_descr">Sarba como sa rasta currente in sischeda SD</string> <string name="save_current_track_descr">Sarba como sa rasta currente in sischeda SD</string>
<string name="save_current_track">Sarba sa rasta currente</string> <string name="save_current_track">Sarba sa rasta currente</string>
<string name="save_track_interval">Intervallu de sarbamentu durante su nàvigu</string> <string name="save_track_interval">Intervallu de sarbamentu durante su nàvigu</string>
@ -1379,7 +1379,7 @@
<string name="shared_string_add_to_favorites">Annanghe a sos Preferidos</string> <string name="shared_string_add_to_favorites">Annanghe a sos Preferidos</string>
<string name="use_english_names_descr">Ischerta simpreu de nùmenes locales o inglesos</string> <string name="use_english_names_descr">Ischerta simpreu de nùmenes locales o inglesos</string>
<string name="use_english_names">Imprea nùmenes inglesos in sas mapas</string> <string name="use_english_names">Imprea nùmenes inglesos in sas mapas</string>
<string name="app_settings">Impostaduras aplicu</string> <string name="app_settings">Impostatziones aplicu</string>
<string name="search_address">Chirca indiritzu</string> <string name="search_address">Chirca indiritzu</string>
<string name="choose_building">Issèbera nùmeru tzìvicu</string> <string name="choose_building">Issèbera nùmeru tzìvicu</string>
<string name="choose_street">Issèbera sistrada</string> <string name="choose_street">Issèbera sistrada</string>
@ -1507,8 +1507,8 @@
<string name="speak_poi">PDI a curtzu</string> <string name="speak_poi">PDI a curtzu</string>
<string name="shared_string_all">Totus</string> <string name="shared_string_all">Totus</string>
<string name="index_tours">Itineràrios</string> <string name="index_tours">Itineràrios</string>
<string name="record_plugin_description">"Custa estensione ativat sa funtzionalidade de registratzione de sas rastas tuas carcande su pursante in sischermu de sa mapa e ammustrat sas impostaduras pro sa registratzione de sos biàgios tuos in documentos GPX localmente o in lìnia impreande unu servìtziu web. <string name="record_plugin_description">"Custa estensione ativat sa funtzionalidade de registratzione de sas rastas tuas carcande su pursante in sischermu de sa mapa e ammustrat sas impostatziones pro sa registratzione de sos biàgios tuos in documentos GPX localmente o in lìnia impreande unu servìtziu web.
\n\nSas rastas registradas podent èssere cumpartzida cun sos amigos tuos o èssere impreadas pro cuntribuire a OSM. Sos atletas podent impreare sas rastas pro compidare sos allenamentos issoro. Carchi anàlisi de base podet èssere fata deretamente in OsmAnd, comente tempus de giru, lestresa mèdia etc., e sas rastas podent, est craru, èssere analizadas fintzas prus a tardu cun ainas estèrnas de anàlisi. "</string> \n\nSas rastas registradas podent èssere cumpartzidas cun sos amigos tuos o èssere impreadas pro cuntribuire a OSM. Sos atletas podent impreare sas rastas pro compidare sos allenamentos issoro. Carchi anàlisi de base podet èssere fata deretamente in OsmAnd, comente tempus de giru, lestresa mèdia etc., e sas rastas podent, est craru, èssere analizadas fintzas prus a tardu cun ainas estèrnas de anàlisi. "</string>
<string name="record_plugin_name">Registratzione biàgios</string> <string name="record_plugin_name">Registratzione biàgios</string>
<string name="int_hour">h</string> <string name="int_hour">h</string>
<string name="duration">Durada</string> <string name="duration">Durada</string>
@ -1541,7 +1541,7 @@
<string name="osmo_device_not_found">Dispositivu no agatau</string> <string name="osmo_device_not_found">Dispositivu no agatau</string>
<string name="anonymous_user">Impitadore anònimu</string> <string name="anonymous_user">Impitadore anònimu</string>
<string name="logged_as">Identificadu comente %1$s</string> <string name="logged_as">Identificadu comente %1$s</string>
<string name="osmo_no_connection_msg">Su servìtziu OsMo no est disponìbile:\n- compida sa connessione;\n- compida sas impostaduras;\n- abbàida su Twitter nostru: https://twitter.com/OsMomobi</string> <string name="osmo_no_connection_msg">Su servìtziu OsMo no est disponìbile:\n- còmpida sa connessione;\n- còmpida sas impostatziones;\n- abbàida su Twitter nostru: https://twitter.com/OsMomobi</string>
<string name="anonymous_user_hint">Un\'impitadore anònimu non podet:\n- creare grupos;\n- sincronizare grupos e dispositivos cun su server;\n- gestire grupos e dispositivos in un\'ufìtziu privadu.</string> <string name="anonymous_user_hint">Un\'impitadore anònimu non podet:\n- creare grupos;\n- sincronizare grupos e dispositivos cun su server;\n- gestire grupos e dispositivos in un\'ufìtziu privadu.</string>
<string name="rendering_category_details">Minujas</string> <string name="rendering_category_details">Minujas</string>
<string name="configure_map">Cunfigura sa mapa</string> <string name="configure_map">Cunfigura sa mapa</string>
@ -1698,8 +1698,8 @@
<string name="drawer">Lista ebbia</string> <string name="drawer">Lista ebbia</string>
<string name="short_location_on_map">Lat %1$s\n Lon %2$s</string> <string name="short_location_on_map">Lat %1$s\n Lon %2$s</string>
<string name="tips_and_tricks_descr">Dimandas fitianas, ùrtimas modìficas e àteru</string> <string name="tips_and_tricks_descr">Dimandas fitianas, ùrtimas modìficas e àteru</string>
<string name="routing_settings_2">Impostaduras de nàvigu</string> <string name="routing_settings_2">Impostatziones de nàvigu</string>
<string name="general_settings_2">Impostaduras generales</string> <string name="general_settings_2">Impostatziones generales</string>
<string name="shared_string_ellipsis"></string> <string name="shared_string_ellipsis"></string>
<string name="shared_string_deselect">De-ischerta</string> <string name="shared_string_deselect">De-ischerta</string>
<string name="shared_string_deselect_all">De-ischerta totu</string> <string name="shared_string_deselect_all">De-ischerta totu</string>
@ -2011,4 +2011,6 @@
<string name="poi_dialog_reopen">Torra a abèrrere</string> <string name="poi_dialog_reopen">Torra a abèrrere</string>
<string name="shared_string_commit">Imbia</string> <string name="shared_string_commit">Imbia</string>
<string name="osm_edit_modified_poi">PDI OSM modificadu</string>
<string name="osm_edit_deleted_poi">PDI OSM burradu</string>
</resources> </resources>

View file

@ -101,7 +101,9 @@
<string name="rendering_value_default13_name">Default (13)</string> <string name="rendering_value_default13_name">Default (13)</string>
<string name="rendering_value_defaultTranslucentCyan_name">Default (translucent cyan)</string> <string name="rendering_value_defaultTranslucentCyan_name">Default (translucent cyan)</string>
<string name="rendering_attr_currentTrackColor_name">GPX color</string> <string name="rendering_attr_currentTrackColor_name">GPX color</string>
<string name="rendering_attr_currentTrackColor_description">GPX color</string>
<string name="rendering_attr_currentTrackWidth_name">GPX width</string> <string name="rendering_attr_currentTrackWidth_name">GPX width</string>
<string name="rendering_attr_currentTrackWidth_description">GPX width</string>
<string name="rendering_value_red_name">Red</string> <string name="rendering_value_red_name">Red</string>
<string name="rendering_value_translucent_red_name">Translucent red</string> <string name="rendering_value_translucent_red_name">Translucent red</string>
<string name="rendering_value_orange_name">Orange</string> <string name="rendering_value_orange_name">Orange</string>
@ -386,6 +388,7 @@
<string name="avoid_roads_msg">You can trigger an alternative route by selecting roads to avoid</string> <string name="avoid_roads_msg">You can trigger an alternative route by selecting roads to avoid</string>
<string name="speak_pedestrian">Pedestrian crosswalks</string> <string name="speak_pedestrian">Pedestrian crosswalks</string>
<string name="rendering_attr_roadStyle_name">Road style</string> <string name="rendering_attr_roadStyle_name">Road style</string>
<string name="rendering_attr_roadStyle_description">Road style</string>
<string name="rendering_value__name">Default</string> <string name="rendering_value__name">Default</string>
<string name="rendering_value_default_name">Default</string> <string name="rendering_value_default_name">Default</string>
<string name="rendering_value_germanRoadAtlas_name">German road atlas</string> <string name="rendering_value_germanRoadAtlas_name">German road atlas</string>

View file

@ -1,14 +1,20 @@
package net.osmand.plus.monitoring; package net.osmand.plus.monitoring;
import java.io.BufferedInputStream;
import java.io.BufferedReader; import java.io.BufferedReader;
import java.io.InputStream; import java.io.InputStream;
import java.io.InputStreamReader; import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URI; import java.net.URI;
import java.net.URL; import java.net.URL;
import java.text.MessageFormat; import java.text.MessageFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import javax.net.ssl.HttpsURLConnection;
import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.SSLSession;
import net.osmand.PlatformUtil; import net.osmand.PlatformUtil;
import net.osmand.plus.OsmAndLocationProvider; import net.osmand.plus.OsmAndLocationProvider;
import net.osmand.plus.OsmandApplication; import net.osmand.plus.OsmandApplication;
@ -17,15 +23,6 @@ import net.osmand.plus.OsmandSettings;
import net.osmand.plus.R; import net.osmand.plus.R;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.http.HttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpRequestBase;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.params.BasicHttpParams;
import org.apache.http.params.HttpConnectionParams;
import org.apache.http.params.HttpParams;
import org.apache.http.conn.ssl.AllowAllHostnameVerifier;
import org.apache.http.conn.ssl.SSLSocketFactory;
import android.content.Context; import android.content.Context;
import android.os.AsyncTask; import android.os.AsyncTask;
@ -134,35 +131,37 @@ public class LiveMonitoringHelper {
break; break;
} }
} }
String url = MessageFormat.format(st, prm.toArray()); String urlStr = MessageFormat.format(st, prm.toArray());
try { try {
HttpParams params = new BasicHttpParams();
HttpConnectionParams.setConnectionTimeout(params, 15000);
DefaultHttpClient httpclient = new DefaultHttpClient(params);
//allow certificates where hostnames doesn't match CN
SSLSocketFactory sf = (SSLSocketFactory) httpclient.getConnectionManager().getSchemeRegistry().getScheme("https").getSocketFactory();
sf.setHostnameVerifier(new AllowAllHostnameVerifier());
// Parse the URL and let the URI constructor handle proper encoding of special characters such as spaces // Parse the URL and let the URI constructor handle proper encoding of special characters such as spaces
URL u = new URL(url); URL url = new URL(urlStr);
URI uri = new URI(u.getProtocol(), u.getUserInfo(), u.getHost(), u.getPort(), u.getPath(), u.getQuery(), u.getRef()); HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection();
HttpRequestBase method = new HttpGet(uri); URI uri = new URI(url.getProtocol(), url.getUserInfo(), url.getHost(), url.getPort(),
log.info("Monitor " + uri); url.getPath(), url.getQuery(), url.getRef());
HttpResponse response = httpclient.execute(method);
if(response.getStatusLine() == null || urlConnection.setConnectTimeout(15000);
response.getStatusLine().getStatusCode() != 200){ urlConnection.setReadTimeout(15000);
String msg; // allow certificates where hostnames doesn't match CN
if(response.getStatusLine() == null){ if (url.getProtocol() == "https") {
msg = ctx.getString(R.string.failed_op); //$NON-NLS-1$ ((HttpsURLConnection) urlConnection).setHostnameVerifier(
} else { new HostnameVerifier() {
msg = response.getStatusLine().getStatusCode() + " : " + //$NON-NLS-1$//$NON-NLS-2$ public boolean verify(String host, SSLSession session) {
response.getStatusLine().getReasonPhrase(); return (true);
} }
});
}
log.info("Monitor " + uri);
if (urlConnection.getResponseCode() != 200) {
String msg = urlConnection.getResponseCode() + " : " + //$NON-NLS-1$//$NON-NLS-2$
urlConnection.getResponseMessage();
log.error("Error sending monitor request: " + msg); log.error("Error sending monitor request: " + msg);
} else { } else {
InputStream is = response.getEntity().getContent(); InputStream is = urlConnection.getInputStream();
StringBuilder responseBody = new StringBuilder(); StringBuilder responseBody = new StringBuilder();
if (is != null) { if (is != null) {
BufferedReader in = new BufferedReader(new InputStreamReader(is, "UTF-8")); //$NON-NLS-1$ BufferedReader in = new BufferedReader(new InputStreamReader(is, "UTF-8")); //$NON-NLS-1$
@ -173,13 +172,13 @@ public class LiveMonitoringHelper {
} }
is.close(); is.close();
} }
httpclient.getConnectionManager().shutdown(); log.info("Monitor response (" + urlConnection.getHeaderField("Content-Type") + "): " + responseBody.toString());
log.info("Monitor response (" + response.getFirstHeader("Content-Type") + "): " + responseBody.toString());
} }
urlConnection.disconnect();
} catch (Exception e) { } catch (Exception e) {
log.error("Failed connect to " + url + ": " + e.getMessage(), e); log.error("Failed connect to " + urlStr + ": " + e.getMessage(), e);
} }
} }
} }

View file

@ -23,26 +23,26 @@ import net.osmand.plus.R;
import net.osmand.plus.Version; import net.osmand.plus.Version;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.http.HttpResponse;
import org.apache.http.NameValuePair;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.HttpClient;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.message.BasicNameValuePair;
import org.json.JSONArray; import org.json.JSONArray;
import org.json.JSONException; import org.json.JSONException;
import org.json.JSONObject; import org.json.JSONObject;
import java.io.BufferedReader; import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.io.InputStreamReader; import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.UnsupportedEncodingException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.concurrent.ConcurrentLinkedQueue; import java.util.concurrent.ConcurrentLinkedQueue;
import java.net.HttpURLConnection;
import java.net.URI;
import java.net.URL;
import java.net.URLEncoder;
public class OsMoService implements OsMoReactor { public class OsMoService implements OsMoReactor {
private static final String HTTP_API_PREPARE = "http://api.osmo.mobi/prepare"; private static final String HTTP_API_PREPARE = "http://api.osmo.mobi/prepare";
@ -70,6 +70,31 @@ public class OsMoService implements OsMoReactor {
public final static String OSMO_REGISTER_AGAIN = "OSMO_REGISTER_AGAIN"; //$NON-NLS-1$ public final static String OSMO_REGISTER_AGAIN = "OSMO_REGISTER_AGAIN"; //$NON-NLS-1$
private final static int SIMPLE_NOTFICATION_ID = 5; private final static int SIMPLE_NOTFICATION_ID = 5;
private class HttpPostWriter {
BufferedWriter writer;
boolean first;
HttpPostWriter(OutputStream outputStream) {
this.writer = new BufferedWriter(new OutputStreamWriter(outputStream));
this.first = true;
}
void addPair(String key, String value) throws IOException {
if (this.first)
this.first = false;
else
this.writer.write("&");
this.writer.write(URLEncoder.encode(key, "UTF-8"));
this.writer.write("=");
this.writer.write(URLEncoder.encode(value, "UTF-8"));
}
void flush() throws IOException {
this.writer.flush();
this.writer.close();
}
}
public OsMoService(final OsmandApplication app, OsMoPlugin plugin) { public OsMoService(final OsmandApplication app, OsMoPlugin plugin) {
@ -185,27 +210,29 @@ public class OsMoService implements OsMoReactor {
public String registerOsmoDeviceKey() throws IOException { public String registerOsmoDeviceKey() throws IOException {
HttpClient httpclient = new DefaultHttpClient(); URL url = new URL(plugin.useHttps()? HTTPS_AUTH : HTTP_AUTH);
HttpPost httppost = new HttpPost(plugin.useHttps()? HTTPS_AUTH : HTTP_AUTH);
try { try {
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setDoOutput(true);
// Add your data // Add your data
List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(2); HttpPostWriter postWriter = new HttpPostWriter(conn.getOutputStream());
nameValuePairs.add(new BasicNameValuePair("android_id", postWriter.addPair("android_id", Secure.getString(app.getContentResolver(),
Secure.getString(app.getContentResolver(), Secure.ANDROID_ID));
Secure.ANDROID_ID)));
nameValuePairs.add(new BasicNameValuePair("android_model", Build.MODEL)); postWriter.addPair("android_model", Build.MODEL);
nameValuePairs.add(new BasicNameValuePair("imei", "0")); postWriter.addPair("imei", "0");
nameValuePairs.add(new BasicNameValuePair("android_product", Build.PRODUCT)); postWriter.addPair("android_product", Build.PRODUCT);
nameValuePairs.add(new BasicNameValuePair("client", Version.getFullVersion(app))); postWriter.addPair("client", Version.getFullVersion(app));
nameValuePairs.add(new BasicNameValuePair("osmand", Version.getFullVersion(app))); postWriter.addPair("osmand", Version.getFullVersion(app));
httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
// Execute HTTP Post Request // Execute HTTP Post Request
HttpResponse response = httpclient.execute(httppost); postWriter.flush();
InputStream cm = response.getEntity().getContent(); BufferedReader reader = new BufferedReader(new InputStreamReader(conn.getInputStream()));
BufferedReader reader = new BufferedReader(new InputStreamReader(cm));
String r = reader.readLine(); String r = reader.readLine();
reader.close(); reader.close();
conn.disconnect();
log.info("Authorization key : " + r); log.info("Authorization key : " + r);
final JSONObject obj = new JSONObject(r); final JSONObject obj = new JSONObject(r);
if(obj.has("error")) { if(obj.has("error")) {
@ -274,25 +301,27 @@ public class OsMoService implements OsMoReactor {
if (deviceKey.length() == 0) { if (deviceKey.length() == 0) {
deviceKey = registerOsmoDeviceKey(); deviceKey = registerOsmoDeviceKey();
} }
HttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new HttpPost(plugin.useHttps()? HTTPS_API_PREPARE : HTTP_API_PREPARE); URL url = new URL(plugin.useHttps() ? HTTPS_API_PREPARE : HTTP_API_PREPARE);
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
try { try {
conn.setDoOutput(true);
HttpPostWriter postWriter = new HttpPostWriter(conn.getOutputStream());
// Add your data // Add your data
List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(2); postWriter.addPair("app", Version.getFullVersion(app));
nameValuePairs.add(new BasicNameValuePair("app", Version.getFullVersion(app))); postWriter.addPair("key", deviceKey);
nameValuePairs.add(new BasicNameValuePair("key", deviceKey));
if (app.getSettings().OSMO_USER_PWD.get() != null) { if (app.getSettings().OSMO_USER_PWD.get() != null) {
nameValuePairs.add(new BasicNameValuePair("auth", app.getSettings().OSMO_USER_PWD.get())); postWriter.addPair("auth", app.getSettings().OSMO_USER_PWD.get());
} }
nameValuePairs.add(new BasicNameValuePair("protocol", "1")); postWriter.addPair("protocol", "1");
httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
// Execute HTTP Post Request // Execute HTTP Post Request
HttpResponse response = httpclient.execute(httppost); postWriter.flush();
InputStream cm = response.getEntity().getContent(); BufferedReader reader = new BufferedReader(new InputStreamReader(conn.getInputStream()));
BufferedReader reader = new BufferedReader(new InputStreamReader(cm));
String r = reader.readLine(); String r = reader.readLine();
reader.close(); reader.close();
conn.disconnect();
log.info("Authorization key : " + r); log.info("Authorization key : " + r);
final JSONObject obj = new JSONObject(r); final JSONObject obj = new JSONObject(r);
if (obj.has("error")) { if (obj.has("error")) {
@ -322,8 +351,6 @@ public class OsMoService implements OsMoReactor {
si.port = a.substring(i + 1); si.port = a.substring(i + 1);
si.token = obj.getString("token"); si.token = obj.getString("token");
return si; return si;
} catch (ClientProtocolException e) {
throw new IOException(e);
} catch (IOException e) { } catch (IOException e) {
throw e; throw e;
} catch (JSONException e) { } catch (JSONException e) {