diff --git a/.gitignore b/.gitignore index 18671264e..d7373a673 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,6 @@ out .gradle/ local.properties build/ +.vagrant/ +*console.log +maven-android-sdk-deployer/ diff --git a/.travis.yml b/.travis.yml index c9d64a20c..39230cd78 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,8 +2,10 @@ language: android android: components: - - android-20 - - build-tools-21.1.2 + - android-23 + - build-tools-23.0.1 +# enable building on container-based infrastructure +sudo: false env: global: - secure: "mMIHz+I2pZK7I9PvhkTIRDeXJJIZTwigAamHnaId1q9YO7LvBoCKsJCI7pepbK303lTZJqkTgyTti9xSsYjzMIIMT8G+YBfVqoiy6wWOZjwjjZxn5Mw7g3qxRRdpXCc7B7hBBTEiEzC0Bp3QwPQtwdFDlACwgHWsbDLiaweIglg=" @@ -14,15 +16,9 @@ env: before_install: - cd $HOME # install and initialise build-trend scripts - - if [[ -d buildtime-trend/.git ]]; then cd buildtime-trend; git pull; cd ..; else git clone https://github.com/buildtimetrend/python-client.git buildtime-trend; fi + - if [[ -d buildtime-trend/.git ]]; then cd buildtime-trend; git pull; cd ..; else git clone --recursive https://github.com/buildtimetrend/python-client.git buildtime-trend; fi - source buildtime-trend/init.sh - mvn -v - - timestamp.sh install_libs - - sudo apt-get update -qq - - sudo apt-get install -qq python-pip - # install buildtime-trend dependencies using pip - - timestamp.sh install_python_libs - - sudo CFLAGS="-O0" pip install -r ${BUILD_TREND_HOME}/requirements.txt # deploy android SDK jar to local maven repository - timestamp.sh deploy_android_sdk - $TRAVIS_BUILD_DIR/.utility/deploy-sdk-to-m2-repo.sh @@ -34,7 +30,7 @@ script: after_success: # send code coverage results to coveralls.io - timestamp.sh coverage - - mvn clean test cobertura:cobertura coveralls:cobertura -B + - mvn clean test cobertura:cobertura coveralls:report -B # update javadoc on Github Pages (gh-pages) - timestamp.sh update_javadoc - mvn clean install javadoc:javadoc -DskipTests=true @@ -42,7 +38,6 @@ after_success: after_script: # analyse build timestamps - timestamp.sh end - - sync-buildtime-trend-with-gh-pages.sh addons: coverity_scan: project: @@ -55,4 +50,5 @@ addons: notifications: webhooks: # parse Travis CI log and send result to Keen.io, using Builtime Trend Service - - http://buildtimetrend-service.herokuapp.com/travis + - https://buildtimetrend.herokuapp.com/travis + - https://buildtimetrend-dev.herokuapp.com/travis diff --git a/.utility/copy-javadoc-to-gh-pages.sh b/.utility/copy-javadoc-to-gh-pages.sh index 8a4f7ecb7..a82c50780 100755 --- a/.utility/copy-javadoc-to-gh-pages.sh +++ b/.utility/copy-javadoc-to-gh-pages.sh @@ -11,7 +11,7 @@ # # Copyright (C) 2013 Xiaohao Ma # Copyright (C) 2013 Ben Limmer -# Copyright (C) 2014-2015 Dieter Adriaenssens +# Copyright (C) 2014-2018 Dieter Adriaenssens # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/.utility/crop_scale_screenshot.sh b/.utility/crop_scale_screenshot.sh index b361fb611..93ca72663 100755 --- a/.utility/crop_scale_screenshot.sh +++ b/.utility/crop_scale_screenshot.sh @@ -6,7 +6,7 @@ # # Dependency : ImageMagick # -# Copyright (C) 2014-2015 Dieter Adriaenssens +# Copyright (C) 2014-2018 Dieter Adriaenssens # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/.utility/deploy-sdk-to-m2-repo.sh b/.utility/deploy-sdk-to-m2-repo.sh index dc4aad023..12de7d69c 100755 --- a/.utility/deploy-sdk-to-m2-repo.sh +++ b/.utility/deploy-sdk-to-m2-repo.sh @@ -2,7 +2,7 @@ # # Script to deploy Android SDK jar files to local maven repository. # -# Copyright (C) 2014-2015 Dieter Adriaenssens +# Copyright (C) 2014-2018 Dieter Adriaenssens # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -19,8 +19,8 @@ # deploy android SDK jar to local maven repository if [[ -d maven-android-sdk-deployer/.git ]]; then cd maven-android-sdk-deployer; git pull; else git clone https://github.com/mosabua/maven-android-sdk-deployer.git; cd maven-android-sdk-deployer; fi -# only deploy SDK 4.4W (API 20) -mvn clean install -pl platforms/android-20 +# only deploy SDK 6 (API 23) +mvn clean install -pl platforms/android-23 # return to initial path cd .. diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 7a57998b5..5802911d3 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -1,12 +1,12 @@ + android:versionCode="50" + android:versionName="0.5" > + android:targetSdkVersion="23" /> @@ -18,6 +18,7 @@ diff --git a/ChangeLog b/ChangeLog index a61603c22..72124330f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ + v0.5 (released on 14Jan2018) + - translated to Croatian, thanks to Dag Velovic + - build against Android SDK 5.1 (API 22) + - issue #164 : display altitude/height in meters + - issue #31 : save altitude and calculate height difference to destination + - support RTL languages + - translated to Chinese (China), thanks to YFdyh000 + - build against Android SDK 6.0 (API 23) + - translated to Estonian, thanks to Kristjan Räts + - translated to Norwegian Bokmål, thanks to Allan Nordhøy + - translated to Polish, thanks to Dominik Danelski + v0.4.1 (released on 08Jan2015) - translated to Sardinian, thanks to Lu Ca - translated to Hindi, thanks to Atul Pratap Singh diff --git a/README.md b/README.md index 7090d371a..57badc1ac 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,20 @@ GetBack GPS for Android ======================= -[![GetBack GPS](http://img.shields.io/badge/release-v0.4.1-blue.svg)](https://f-droid.org/repository/browse/?fdid=com.github.ruleant.getback_gps) +[![GetBack GPS](http://img.shields.io/badge/release-v0.5-blue.svg)](https://f-droid.org/repository/browse/?fdid=com.github.ruleant.getback_gps) [![Build Status](https://travis-ci.org/ruleant/getback_gps.svg?branch=master)](https://travis-ci.org/ruleant/getback_gps) +[![Codacy Badge](https://api.codacy.com/project/badge/0040e146618e41ac9c39d04c7b1a3fef)](https://www.codacy.com/app/ruleant/getback_gps) [![Coverity Scan Build Status](https://scan.coverity.com/projects/2277/badge.svg)](https://scan.coverity.com/projects/2277) [![Coverage Status](https://coveralls.io/repos/ruleant/getback_gps/badge.png?branch=master)](https://coveralls.io/r/ruleant/getback_gps?branch=master) + [![Translation status](http://hosted.weblate.org/widgets/getback_gps-shields-badge.png)](http://hosted.weblate.org/engage/getback_gps/?utm_source=widget) +[![todofy badge](https://todofy.org/b/ruleant/getback_gps)](https://todofy.org/r/ruleant/getback_gps) [![Stack Share](http://img.shields.io/badge/tech-stack-0690fa.svg?style=flat)](http://stackshare.io/ruleant/getback-gps) -[![Buildtime trend](https://buildtimetrend-service.herokuapp.com/badge/ruleant/getback_gps/latest)](http://ruleant.github.io/getback_gps/buildtime-trend/) -[![Total builds](https://buildtimetrend-service.herokuapp.com/badge/ruleant/getback_gps/builds/month)](http://ruleant.github.io/getback_gps/buildtime-trend/) -[![Passed build jobs](https://buildtimetrend-service.herokuapp.com/badge/ruleant/getback_gps/passed/month)](http://ruleant.github.io/getback_gps/buildtime-trend/) +[![Buildtime trend](https://buildtimetrend-dev.herokuapp.com/badge/ruleant/getback_gps/latest)](http://ruleant.github.io/getback_gps/buildtime-trend/) +[![Total builds](https://buildtimetrend-dev.herokuapp.com/badge/ruleant/getback_gps/builds/month)](http://ruleant.github.io/getback_gps/buildtime-trend/) +[![Passed build jobs](https://buildtimetrend-dev.herokuapp.com/badge/ruleant/getback_gps/passed/month)](http://ruleant.github.io/getback_gps/buildtime-trend/) +[![Days since last failed build job](https://buildtimetrend-dev.herokuapp.com/badge/ruleant/getback_gps/last_fail)](https://buildtimetrend-dev.herokuapp.com/dashboard/ruleant/getback_gps/index.html) Open Source Android app for finding your way back to a previously visited location using GPS coordinates. @@ -38,7 +42,7 @@ How to get it? The [latest version](https://f-droid.org/repository/browse/?fdid=com.github.ruleant.getback_gps) is available on [F-Droid](https://f-droid.org/). Install the apk directly from the F-Droid website, or use the [F-Droid app](https://f-droid.org/FDroid.apk) to keep automaticaly up to date with future releases. -If you want to try out the latest development version, you can get the code from the [git repository](https://f-droid.org/FDroid.apk) and [build the current development version](https://github.com/ruleant/getback_gps/wiki/Development) yourself. +If you want to try out the latest development version, you can get the code from the [git repository](https://github.com/ruleant/getback_gps) and [build the current development version](https://github.com/ruleant/getback_gps/wiki/Development) yourself. Bugs and feature requests @@ -90,23 +94,15 @@ Third party material - website : https://github.com/keyboardsurfer/Crouton - license : Apache 2.0 -Third party material --------------------- - -- res/drawable-*/ic_action_refresh.png - - From the Action Bar Icon Pack, see http://developer.android.com/design/style/iconography.html - - origin : http://developer.android.com/downloads/design/Android_Design_Icons_20131106.zip - - license : Apache 2.0 +Credits +------- -- Crouton library - - version : v1.8.1 - - website : https://github.com/keyboardsurfer/Crouton - - license : Apache 2.0 +Getback GPS for Android was made possible by many contributers and sponsors, see [Credits](https://github.com/ruleant/getback_gps/wiki/Credits). License ------- -Copyright (C) 2012-2015 Dieter Adriaenssens +Copyright (C) 2012-2018 Dieter Adriaenssens This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/Vagrantfile b/Vagrantfile new file mode 100644 index 000000000..4c62b4e39 --- /dev/null +++ b/Vagrantfile @@ -0,0 +1,60 @@ +# -*- mode: ruby -*- +# vi: set ft=ruby : + +# Vagrantfile API/syntax version. Don't touch unless you know what you're doing! +VAGRANTFILE_API_VERSION = "2" + +Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| + # All Vagrant configuration is done here. The most common configuration + # options are documented and commented below. For a complete reference, + # please see the online documentation at vagrantup.com. + + # Every Vagrant virtual environment requires a box to build off of. + config.vm.box = "ubuntu/xenial64" + + # increase memory of virtualbox + config.vm.provider "virtualbox" do |v| + v.memory = 2048 + v.customize ["modifyvm", :id, "--usb", "on"] + v.customize ["modifyvm", :id, "--usbxhci", "on"] + v.customize ['usbfilter', 'add', '0', '--target', :id, '--name', 'Google Inc. Nexus 4 (debug)', '--vendorid', '0x18d1', '--productid', '0x4ee2'] + v.customize ['usbfilter', 'add', '0', '--target', :id, '--name', 'Motorola Moto X4', '--vendorid', '0x22b8', '--productid', '0x2e76'] + end + + # Disable automatic box update checking. If you disable this, then + # boxes will only be checked for updates when the user runs + # `vagrant box outdated`. This is not recommended. + # config.vm.box_check_update = false + + # Create a forwarded port mapping which allows access to a specific port + # within the machine from a port on the host machine. In the example below, + # accessing "localhost:8080" will access port 80 on the guest machine. + # config.vm.network "forwarded_port", guest: 80, host: 8080 + + # Create a private network, which allows host-only access to the machine + # using a specific IP. + # config.vm.network "private_network", ip: "192.168.33.10" + + # Create a public network, which generally matched to bridged network. + # Bridged networks make the machine appear as another physical device on + # your network. + # config.vm.network "public_network" + + # If true, then any SSH connections made will enable agent forwarding. + # Default value: false + # config.ssh.forward_agent = true + + # Share an additional folder to the guest VM. The first argument is + # the path on the host to the actual folder. The second argument is + # the path on the guest to mount the folder. And the optional third + # argument is a set of non-required options. + # config.vm.synced_folder "../data", "/vagrant_data" + + # start Ansible provisioning + config.vm.provision "ansible" do |ansible| + ansible.verbose = "v" + ansible.become = true + ansible.playbook = "provisioning/playbook.yml" + ansible.extra_vars = { ansible_python_interpreter:"/usr/bin/python2.7" } + end +end diff --git a/build.gradle b/build.gradle index 7f8664da9..757552076 100644 --- a/build.gradle +++ b/build.gradle @@ -13,8 +13,8 @@ buildscript { apply plugin: 'android' android { - compileSdkVersion 20 - buildToolsVersion "21.1.2" + compileSdkVersion 23 + buildToolsVersion "23.0.1" } android { @@ -83,4 +83,4 @@ task unitTest(type:Test, dependsOn: assemble) { classpath = project.sourceSets.unitTest.runtimeClasspath } -check.dependsOn unitTest +//check.dependsOn unitTest diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index a40d83b43..74a45aa2a 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=http\://services.gradle.org/distributions/gradle-1.10-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-1.10-bin.zip diff --git a/pom.xml b/pom.xml index cbec4fb95..60b3305d9 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.github.ruleant.getback_gps getback_gps - 0.4.1 + 0.5 apk GetBack GPS @@ -27,7 +27,7 @@ android android - 4.4W_r1 + 6.0_r1 provided @@ -81,8 +81,8 @@ true - - 20 + + 23 false @@ -95,7 +95,7 @@ org.codehaus.mojo cobertura-maven-plugin - 2.5.2 + 2.7 true xml @@ -110,7 +110,7 @@ org.eluder.coveralls coveralls-maven-plugin - 2.2.0 + 4.0.0 org.apache.maven.plugins diff --git a/provisioning/files/51-android.rules b/provisioning/files/51-android.rules new file mode 100644 index 000000000..c1f7b5703 --- /dev/null +++ b/provisioning/files/51-android.rules @@ -0,0 +1,2 @@ +SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", MODE="4ee2", GROUP="plugdev" +SUBSYSTEM=="usb", ATTR{idVendor}=="22b8", MODE="2e76", GROUP="plugdev", ENV{adb_adbfast}="yes" diff --git a/provisioning/playbook.yml b/provisioning/playbook.yml new file mode 100644 index 000000000..1dc3947e6 --- /dev/null +++ b/provisioning/playbook.yml @@ -0,0 +1,19 @@ +--- +- hosts: all + tasks: + - name: "Install git" + apt: name=git state=latest + + - name: "Install java JDK 8" + apt: name=openjdk-8-jdk state=latest + + - name: "Install maven" + apt: name=maven state=latest + + - name: "Install udev config file" + copy: + src: files/51-android.rules + dest: /etc/udev/rules.d/51-android.rules + owner: root + group: root + mode: 0644 diff --git a/res/layout-land/activity_main.xml b/res/layout-land/activity_main.xml index d745bab9e..0ecf645f2 100644 --- a/res/layout-land/activity_main.xml +++ b/res/layout-land/activity_main.xml @@ -12,7 +12,8 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerVertical="true" - android:layout_toLeftOf="@+id/navigationView_ToDest" /> + android:layout_toLeftOf="@+id/navigationView_ToDest" + android:layout_toStartOf="@+id/navigationView_ToDest" /> + android:layout_toRightOf="@+id/navigationView_ToDest" + android:layout_toEndOf="@+id/navigationView_ToDest"/> diff --git a/res/layout-land/section_to_destination.xml b/res/layout-land/section_to_destination.xml index 08533588c..fb59f9c79 100644 --- a/res/layout-land/section_to_destination.xml +++ b/res/layout-land/section_to_destination.xml @@ -4,7 +4,8 @@ xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:paddingLeft="10dp" > + android:paddingLeft="10dp" + android:paddingStart="10dp" > + + + + + + + + \ No newline at end of file diff --git a/res/layout/activity_details.xml b/res/layout/activity_details.xml index 5ebf00f52..fc105f295 100644 --- a/res/layout/activity_details.xml +++ b/res/layout/activity_details.xml @@ -55,7 +55,6 @@ android:id="@+id/textView_ToDestination" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_gravity="center_vertical" android:padding="2dp" android:text="@string/to_dest" /> diff --git a/res/layout/section_current.xml b/res/layout/section_current.xml index 38ca4ecd1..5d39d1ff8 100644 --- a/res/layout/section_current.xml +++ b/res/layout/section_current.xml @@ -5,12 +5,13 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="vertical" - android:paddingRight="10dp" > + android:paddingRight="10dp" + android:paddingEnd="10dp" > @@ -33,7 +34,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:paddingTop="2dp" - android:layout_gravity="right" + android:layout_gravity="end" android:orientation="vertical" > \ No newline at end of file diff --git a/res/layout/section_to_destination.xml b/res/layout/section_to_destination.xml index 8bc8c52bf..d730d7a18 100644 --- a/res/layout/section_to_destination.xml +++ b/res/layout/section_to_destination.xml @@ -4,7 +4,8 @@ xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:paddingLeft="10dp" > + android:paddingLeft="10dp" + android:paddingStart="10dp"> @@ -85,6 +88,28 @@ style="@style/captionDescription" /> + + + + + + + + \ No newline at end of file diff --git a/res/values-ar/strings.xml b/res/values-ar/strings.xml new file mode 100644 index 000000000..1626de0f3 --- /dev/null +++ b/res/values-ar/strings.xml @@ -0,0 +1,17 @@ + +موقعك الحالي غير دقيق + السرعة الحالية + كم/ساعة + كم + م + المسافة + الإتجاه + غير دقيق + غير معروف + لا يوجد وجهة محددة + NW + شمال + جنوب + الشرق + الغرب + diff --git a/res/values-az/strings.xml b/res/values-az/strings.xml new file mode 100644 index 000000000..a6b3daec9 --- /dev/null +++ b/res/values-az/strings.xml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/res/values-be/strings.xml b/res/values-be/strings.xml index 9d4aee91d..3b372732a 100644 --- a/res/values-be/strings.xml +++ b/res/values-be/strings.xml @@ -1,4 +1,4 @@ - + Хуткасьць км/г Азімут @@ -18,7 +18,7 @@ Падрабязнасьці Лякатар Правайдэр - cетка (сотавая альбо WiFi) + Сетка (сотавая альбо Wi-Fi) GPS Лякатар не падтрымліваецца. Аўтарскае права @@ -52,7 +52,7 @@ Абнаўляць праз такі час Выкарыстоўваць даступныя датчыкі Датчык арыентацыі па змаўчанні - Увамкнёна: хутчэйшае абнаўленьне й дакладнейшы азімут + Увамкнёна: хутчэйшыя абнаўленьні й дакладнейшы азімут Вымкнена: ашчаджвае энергію Вымкнена Аб праграме @@ -101,4 +101,7 @@ Перайменаваць месца Немагчыма перайменаваць месца, спачатку захавайце месцазнаходжанне Месца перайменавана + Розніца вышынь + м + км diff --git a/res/values-cs/strings.xml b/res/values-cs/strings.xml index d93422b4c..4bee88732 100644 --- a/res/values-cs/strings.xml +++ b/res/values-cs/strings.xml @@ -1,4 +1,4 @@ - + Najděte svoji cestu zpět k dříve navštíveným místům pomocí GPS souřadnic. @@ -69,7 +69,7 @@ Kopii Obecné veřejné licence GNU jste měli obdržet spolu s tímto programem Nebyl nastaven cíl Použít čidla Výchozí čidlo orientace - Povoleno: přesnější a rychlejší změny azimutu + Povoleno: Přesnější a rychlejší změny azimutu Vypnuto: šetří energii Zadejte název tohoto místa: Název místa @@ -100,4 +100,7 @@ Kopii Obecné veřejné licence GNU jste měli obdržet spolu s tímto programem Přejmenovat cíl Nelze přejmenovat cíl, nejprve umístění uložte Cíl byl přejmenován + m + km + Výškový rozdíl diff --git a/res/values-da/strings.xml b/res/values-da/strings.xml index 65758f627..10b3b3001 100644 --- a/res/values-da/strings.xml +++ b/res/values-da/strings.xml @@ -1,4 +1,4 @@ - + Find vej tilbage til en tidligere besøgt placering ved hjælp af GPS-koordinater. Din aktuelle placering er unøjagtig Gem din placering for at angive en destination @@ -26,7 +26,7 @@ Detaljer Placeringsudbyder Udbyder - Netværk (GSM/WiFi) + Netværk (Mobiltelefon/Wi-Fi) GPS Udbyderen understøttes ikke. Nuværende (sidst kendte) placering @@ -37,7 +37,7 @@ Ø V Højde - hastighed + Hastighed Kurs Nøjagtighed Tidsstempel @@ -58,18 +58,18 @@ Tidsbaseret opdateringer Brug tilgængelige sensorer Standard orienteringssensor - Aktiveret: hurtigere opdateret og mere præcis kurs - Inaktiv: sparer strøm + Aktiveret: Hurtigere opdateringer og mere præcis kurs + Inaktiv: Sparer strøm Inaktiv Bygget på %s. Besøg <a href=%1$s>hjemmesiden</a> for mere information. Copyright - Dette program er gratis software: du kan redistribuere det og/eller modificere det under betingelserne i GNU General Public License som publiceret af Free Software Foundation, enten version 3 af licensen, eller enhver nyere version.\n -\n - Dette program er distribueret i håb om at det vil være nyttigt, men uden nogen garanti; uden engang den stiltiende garanti for salgbarhed eller egnethed til et bestemt formål. Se GNU General Public License for flere detaljer.\n -\n - Du skulle have modtaget en kopi af GNU General Public License sammen med dette program. Hvis ikke, se www.gnu.org/licenses. -Sensor baseret retningsforskydning + Dette program er fri software: du kan redistribuere det og/eller modificere det under betingelserne i GNU General Public License som publiceret af Free Software Foundation, enten version 3 af licensen, eller enhver nyere version. +\n +\n Dette program er distribueret i håb om at det vil være nyttigt, men uden nogen garanti; uden engang den stiltiende garanti for salgbarhed eller egnethed til et bestemt formål. Se GNU General Public License for flere detaljer. +\n +\n Du skulle have modtaget en kopi af GNU General Public License sammen med dette program. Hvis ikke, se www.gnu.org/licenses. +Sensorbaseret retningsforskydning Køreretning Fremad Baglæns @@ -95,4 +95,7 @@ Omdøb destinationen Kan ikke omdøbe destinationen, gem en placering først Destination omdøbt + Højdeforskel + m + km diff --git a/res/values-de/strings.xml b/res/values-de/strings.xml index c7e253f61..18ba5dfb4 100644 --- a/res/values-de/strings.xml +++ b/res/values-de/strings.xml @@ -1,4 +1,4 @@ - + Finde den Rückweg zu einem vorher besuchten Ort mit Hilfe der GPS-Koordinaten. Dein jetztiger Ort ist nicht akkurat @@ -26,7 +26,7 @@ Details Ort Provider Provider - Netzwerk (Telefon/WiFi) + Netzwerk (Telefon/Wi-Fi) GPS Provider wird nicht unterstützt. Aktueller (letzter bekannter) Ort @@ -96,4 +96,6 @@ Sie sollten ein Exemplar der GNU General Public License zusammen mit diesem Prog Bewegungsrichtung Vorwärts Rückwärts + m + km diff --git a/res/values-el/strings.xml b/res/values-el/strings.xml new file mode 100644 index 000000000..a6b3daec9 --- /dev/null +++ b/res/values-el/strings.xml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/res/values-es/strings.xml b/res/values-es/strings.xml index da834cd52..74ed47383 100644 --- a/res/values-es/strings.xml +++ b/res/values-es/strings.xml @@ -1,11 +1,11 @@ - + Este programa es software libre: puede redistribuirlo y/o modificarlo bajo los términos de la Licencia General Pública de GNU publicada por la Free Software Foundation, ya sea la versión 3 de la Licencia, o cualquier versión posterior.\n \n Este programa se distribuye con la esperanza de que sea útil pero SIN NINGUNA GARANTÍA; incluso sin la garantía implícita de MERCANTIBILIDAD o CALIFICADA PARA UN PROPÓSITO EN PARTICULAR. Vea la Licencia General Pública de GNU para más detalles.\n \n Usted ha debido de recibir una copia de la Licencia General Pública de GNU junto con este programa. Si no, vea www.gnu.org/licenses. -Encuentra el camino de vuelta a un sitio previamente visitado utilizando coordenadas GPS. +Encuentra el camino de vuelta utilizando coordenadas GPS. Tu ubicación actual es inexacta Guarda tu ubicación para crear un destino Comienza a moverte para obtener una dirección precisa hacia tu destino @@ -63,7 +63,7 @@ Usted ha debido de recibir una copia de la Licencia General Pública de GNU junt Actualizaciones basadas en tiempo Habilitar sensores disponibles Sensor de orientación predeterminado - Deshabilitado: ahorra energía + Deshabilitado: Ahorra energía Deshabilitado Versión Visite el <a href=%1$s>sitio web</a> para más información. @@ -71,7 +71,7 @@ Usted ha debido de recibir una copia de la Licencia General Pública de GNU junt Giro actual En destino Hacia el destino - Habilitado: actualizaciones más rápidas y giros más precisos + Habilitado: Actualizaciones más rápidas y giros más precisos Acerca de Compilado en %s. Poner un nombre a la ubicación actual: @@ -96,4 +96,7 @@ Usted ha debido de recibir una copia de la Licencia General Pública de GNU junt No se puede renombrar el destino, guarde primero una ubicación Destino renombrado Nombre de la ubicación no especificado + m + km + Diferencia de altura diff --git a/res/values-et/strings.xml b/res/values-et/strings.xml new file mode 100644 index 000000000..2624864dd --- /dev/null +++ b/res/values-et/strings.xml @@ -0,0 +1,101 @@ + +Leia GPS koordinaatide abil tagasitee eelnevalt külatatud kohta. + Su praegune asukoht ei ole täpne + Sihtkoha määramiseks salvesta oma asukoht + Hakka liikuma, et leida täpne suund sihtkohta + Oled jõudnud sihtkohta + Praegune kiirus + km/h + Praegune kurss + Kaugus + m + km + Kõrguste vahe + Suund + NE + SE + SW + NW + Asukoht uuendatud + Ebatäpne + Sihtkohas + Sihtkoht pole määratud + Tundmatu + Värskenda + Sisesta praeguse asukoha nimi: + Sisesta sihtkoha uus nimi: + Asukoha nimi + Loobu + Salvesta asukoht + Nimeta sihtkoht + Asukohta ei saa salvestada, kui puudub praegune asukoht + Sihtkohta ei saa ümber nimetada, salvesta esmalt asukoht + Asukoht salvestatud + Asukoht \"%s\" salvestatud + Sihtkoht on ümbernimetatud + Asukoha nime pole määratud + Asukoha detailid + Detailid + Asukoha pakkuja + Nimi + Pakkuja + Võrgupõhine (mobiiltelefon/Wi-Fi) + GPS + Pakkuja ei ole toetatud. + Praegune (viimane teadaolev) asukoht + Laiuskraad + N + S + Pikkuskraad + E + W + Kõrgus merepinnast + Kiirus + Kurss + Sensoril põhinev kursi nihe + Reisi suund + Edasi + Tööjõukulu + Täpsus + Ajatempel + Sihtkoht + Sihtkohta + praeguse suuna suhtes + Vormindamata + Puudub + Määramata + Asukohta on hiljuti uuendatud. + Asukohta EI OLE hiljuti uuendatud. + Seaded + Üldine + Asukoha uuendused + Uuendused vahemaa alusel + Uuendused aja alusel + Kasuta saadaval olevaid andureid + Vaikimisi suuna andur + Lubatud: kiiremad uuendused ja täpsemam kurss + Keelatud: säästab energiat + Keelatud + + %d meeter + %d meetrit + + + %d sekund + %d sekundit + + + %d minut + %d minutit + + Teave + Versioon + Ehitatud %s. + Lisainfot leiad <a href=%1$s>veebilehelt</a>. + Autoriõigus + See programm on tasuta tarkvara: saate seda levitada ja / või seda muuta vastavalt GNU Üldise Avaliku Litsentsi tingimustele, mille on avaldanud Free Software Foundation, kas Litsentsi 3. versioon või mõni hilisem versioon. +\n +\nSeda programm levitatakse lootuses, et see on kasulik, kuid ilma igasuguse garantiita; isegi ilma vaikimisi garantiita sobimaks KAUBANDUSLIKUKS või MÕNEKS MUUKS EESMÄRGIKS. Üksikasjalikuma teabe saamiseks vaadake GNU Üldist Avalikku Litsentsi. +\n +\nGNU Üldise Avaliku Litsentsi oleksid pidanud saama selle programmiga. Kui ei, siis vaadake www.gnu.org/licenses. + diff --git a/res/values-fr/strings.xml b/res/values-fr/strings.xml index 2b9a65919..0c8aa0dc8 100644 --- a/res/values-fr/strings.xml +++ b/res/values-fr/strings.xml @@ -1,4 +1,4 @@ - + Ce programme est un logiciel libre ; vous pouvez le redistribuer ou le modifier suivant les termes de la GNU General Public License telle que publiée par la Free Software Foundation : soit la version 3 de cette licence, soit toute version ultérieure.\n \n @@ -29,7 +29,7 @@ Vous devriez avoir reçu une copie de la Licence Générale Publique GNU avec ce Détails Fournisseur de localisation Fournisseur - Réseau (Data/Wifi) + Réseau (Données mobiles / Wifi) GPS Fournisseur non supporté. Position actuelle (dernière connue) @@ -57,7 +57,7 @@ Vous devriez avoir reçu une copie de la Licence Générale Publique GNU avec ce Actualiser en fonction du temps Activer les capteurs Capteur d\'orientation par défaut - Désactivé : économise l\'énergie + Désactivé : Économise la batterie Désactivé À propos Version @@ -66,7 +66,7 @@ Vous devriez avoir reçu une copie de la Licence Générale Publique GNU avec ce Copyright Relèvement actuel Relèvement - Activé : actualisation plus fréquente et relèvement plus précis + Activé : Mises à jour plus fréquentes et relèvement plus précis Aucune destination définie Direction de marche En avant @@ -96,4 +96,7 @@ Vous devriez avoir reçu une copie de la Licence Générale Publique GNU avec ce Renommer la destination Impossible de renommer la destination, veuillez sauver la position Destination renommée + m + km + Écart d\'altitude diff --git a/res/values-hi/strings.xml b/res/values-hi/strings.xml index c8c45ce77..b1fc6d5b2 100644 --- a/res/values-hi/strings.xml +++ b/res/values-hi/strings.xml @@ -97,4 +97,7 @@ संस्करण (वर्शन) %S पर बनाया गया। अधिक जानकारी के लिए <a href=%1$s>वेबसाइट</a> पर जाएँ। + मीटर + किलो मीटर + ऊंचाई में अंतर diff --git a/res/values-hr/strings.xml b/res/values-hr/strings.xml index 2ba9ae27a..6b2f04152 100644 --- a/res/values-hr/strings.xml +++ b/res/values-hr/strings.xml @@ -1,6 +1,110 @@ - + Nepoznato - \ No newline at end of file +Pronađite put natrag do prethodno posjećene lokacije pomoću GPS koordinata. + Vaša trenutna lokacija je netočna + Pohranite vašu lokaciju kako bi postavili odredište + Počnite se kretati da dobijete točan smjer do vašeg odredišta + Stigli ste na odredište + Trenutna brzina + km/h + Trenutni smjer - azimut + Udaljenost + Smjer + SI + JI + JZ + SZ + Lokacija ažurirana + Netočno + Na odredištu + Odredište nije zadano + Osvježi + Unesite naziv za vašu trenutnu lokaciju: + Unesite novo ime za vašu trenutnu lokaciju: + Naziv lokacije + Pohrani lokaciju + Preimenuj odredište + Nije moguće pohraniti lokaciju ako nema trenutne lokacije + Nije moguće preimenovati odredište, najprije pohranite lokaciju + Lokacija pohranjena + Lokacija \'%s\' pohranjena + Odredište preimenovano + Naziv lokacije nije specificiran + Detalji lokacije + Detalji + Naziv + Mreža (mobitel / Wi-Fi) + GPS + Trenutna (zadnje poznata) lokacija + Geografska širina + S + J + Geografska dužina + I + Z + Nadmorska visina + Brzina + Azimut + Otklon senzora azimuta + Smjer kretanja + Naprijed + Nazad + Točnost + Vremenska oznaka + Odredište + Prema odredištu + relativno trenutnom smjeru + Neformatirano + Nijedan + Nije postavljeno + Lokacija nedavno ažurirana. + Lokacija NIJE nedavno ažurirana. + Postavke + Opće + Ažuriranje lokacija + Ažuriranja temeljem udaljenosti + Ažuriranje temeljem vremena + Koristi dostupne senzore + Zadani senzor orijentacije + Uključeno: Brže ažuriranje i točniji azimut + Isključeno: štedi energiju + Isključeno + + %d metar + %d metra + %d metara + + + + %d sekunda + %d sekunde + + + + + %d minuta + %d minute + + + + O + Verzija + Posjetite <a href=%1$s>website</a> za više informacija. + Autorska prava + Ovaj program je slobodan; možete ga distribuirati i/ili mijenjati pod uvjetima GNU Opće javne licence kako ju je objavio Free Software Foundation; ili verzije 3 Licence, ili (po vašem izboru) bilo koje novije verzije.\n +\n +Ovaj program se distribuira u nadi da će biti koristan, ali BEZ IKAKVOG JAMSTVA; čak i bez podrazumijevanog jamstva TRGOVINSKE PRIKLADNOSTI ili ODGOVARANJA ODREĐENOJ SVRSI. Za detalje pročitajte GNU Opću javnu licencu.\n +\n +Trebali ste dobiti primjerak GNU Opće javne licence uz ovaj program; ako niste, posjetite www.gnu.org/licenses. +Odustani + Lokacijski davalac usluge + Davalac usluge + Davalac usluge nije podržan. + Napravljeno na %s. + m + km + Visinska razlika + diff --git a/res/values-hu/strings.xml b/res/values-hu/strings.xml index a6b3daec9..c81fb949e 100644 --- a/res/values-hu/strings.xml +++ b/res/values-hu/strings.xml @@ -1,2 +1,38 @@ - - \ No newline at end of file + +Találjon vissza egy előzőleg meglátogatott helyre GPS koordináták alapján. + A jelenlegi helyzete nem pontos + A helyzet eltárolása egy cél beállításához + Megérkezett a célhoz + Jelenlegi sebesség + km/h + Jelenlegi irány + Távolság + Irány + ÉK + DK + DNY + ÉNY + Hely frissítve + Pontatlan + A célnál + Nincs cél beállítva + Ismeretlen + Frissítés + Induljon el a pontos célirány beállításhoz + m + km + Magasságkülönbség + Aktuális helyzetének neve + Adja meg céljának új nevét + Helyének neve + Mégsem + Hely rögzítése + Cél átnevezése + Nincs aktuális helyzet, így a hely nem tárolható + Először tárolja helyzetét, utána nevezheti át célját + Helyzete tárolva + Helyzete \'%s\' tárolva + Cél átnevezve + Helyzetének neve nincs megadva + Helyzetének részletei + diff --git a/res/values-it/strings.xml b/res/values-it/strings.xml index 28c828930..eb9e06313 100644 --- a/res/values-it/strings.xml +++ b/res/values-it/strings.xml @@ -1,8 +1,8 @@ - + Ritorna a una posizione visitata precedentemente usando le coordinate GPS. - La posizione rilevata non è accurata - Salva la tua posizione per impostare una destinazione + GPS non attivo o rilevamento posizione in corso + Memorizza la tua posizione per impostare una destinazione Sei a destinazione Velocità corrente km/h @@ -18,7 +18,7 @@ Sconosciuto Aggiorna Aggiungi posizione - Posizione salvata + Posizione memorizzata Dettagli Dettagli Sorgente posizione @@ -41,13 +41,13 @@ Impostazioni Generali Attiva sensori (se disponibili) - Rilevamento corrente + Rotta Muovendoti otterrai una direzione più precisa Posizione aggiornata Posizione corrente non identificata, impossibile salvarla Latitudine Compensazione rilevamento basata su sensore - Direzione di viaggio + Direzione di marcia Avanti Indietro Marca temporale @@ -61,11 +61,11 @@ Aggiornamenti basati su tempo Sensore orientamento predefinito Disattivato: risparmio energia - Attivato: aggiornamenti veloci e posizionamento accurato + Attivato: aggiornamenti più veloci e posizione più accurata Disattivato Informazioni su Versione - Costruito su %s. + Build del %s. Visita il <a href=%1$s>sito web</a> per maggiori informazioni. Copyright Questo è software libero: puoi ridistribuirlo e/o modificarlo secondo i termini della GNU General Public License pubblicata dalla Free Software Foundation, versione 3 o successiva.\n @@ -95,5 +95,8 @@ Inserire un nome per la destinazione: Rinomina destinazione Destinazione rinominata - Impossibile rinominare destinazione, prima salvare una posizione + Impossibile rinominare destinazione, salva prima una posizione + m + km + Dislivello diff --git a/res/values-ja/strings.xml b/res/values-ja/strings.xml index 540c9bb7b..1447ef152 100644 --- a/res/values-ja/strings.xml +++ b/res/values-ja/strings.xml @@ -1,4 +1,4 @@ - + 方向 著作権 @@ -18,7 +18,7 @@ 設定 全般 場所の更新 - GPS座標を使用して、以前に訪れた場所へ戻る方法を探す。 + GPS座標を使用して、以前に訪れた場所へ戻る道を探します。 現在の場所に間違いがあります 目的地を設定するためにあなたの場所を保存してください 目的地までの正確な方向を取得するために移動を開始してください @@ -52,7 +52,7 @@ 場所プロバイダー 名前 プロバイダー - ネットワーク (携帯電話/WiFi) + ネットワーク (携帯電話/Wi-Fi) プロバイダーはサポートされていません。 現在の (最新の) 場所 @@ -78,8 +78,8 @@ 時間に基づく更新 利用可能なセンサーを使用 デフォルトの方位センサー - 有効 : より迅速な更新、より正確な方角 - 無効 : 電力を節約 + 有効: より迅速な更新、より正確な方角 + 無効: 電力を節約 無効 アプリについて バージョン @@ -92,4 +92,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see www.gnu.org/licenses. 方角 場所の名前を変更しました + m + km + 高低差 diff --git a/res/values-nb-rNO/strings.xml b/res/values-nb-rNO/strings.xml new file mode 100644 index 000000000..9b1236cfd --- /dev/null +++ b/res/values-nb-rNO/strings.xml @@ -0,0 +1,101 @@ + +Finn veien tilbake til en tidligere besøkt plassering ved bruk av GPS-koordinater. + Din gjeldende plassering er unøyaktig + Lagre din plassering for å angi et mål + Begynn å bevege deg for å få en presis retningsanvisning til ditt mål + Du har nådd ditt mål + Nåværende hastighet + km/t + Aktuell kurs + Avstand + m + km + Høydeforskjell + Retning + + + SV + NV + Plassering oppdatert + Unøyaktig + Ved målet + Inget mål satt + Ukjent + Oppdater + Skriv inn et navn for ditt gjeldende mål: + Skriv inn ett nytt navn for ditt mål: + Plasseringsnavn + Avbryt + Lagre plassering + Gi plassering nytt navn + Kan ikke lagre plassering hvis det ikke forefinnes en aktuell plassering + Kan ikke gi mål nytt navn, lagre en plassering først + Plassering lagret + Plasseringen \"%s\" ble lagret + Mål har fått nytt navn + Plasseringsnavn ble ikke angitt + Plasseringsdetaljer + Detaljer + Plasseringstilbyder + Navn + Tilbyder + Nettverk (telefon/Wi-Fi) + GPS + Tilbyderen støttes ikke. + Nåværende (siste kjente) plassering + Breddegrad + N + S + Lengdegrad + Ø + V + Høyde + Hastighet + Kurs + Sensorbasert retningsforskyvning + Bevegelsesretning + Framover + Bakover + Nøyaktighet + Tidsstempel + Mål + Til målet + i forhold til aktuell retning + Uformatert + Ingen + Ikke angitt + Plassering oppdatert nylig. + Plassering IKKE oppdatert nylig. + Innstillinger + Hovedinnstillinger + Plasseringsoppdateringer + Avstandsbaserte oppdateringer + Tidsbaserte oppdateringer + Bruk tilgjengelige sensorer + Forvalgt orienteringssensor + Påskrudd: Raskere oppdateringer og mer nøyaktig kurs + Avskrudd: Sparer strøm + Avskrudd + + %d meter + %d meter + + + %d sekund + %d sekunder + + + %d minutt + %d minutter + + Om + Versjon + Bygd på %s. + Besøk <a href=%1$s>nettsiden</a> for mer info. + Kopirett + Dette program er fri programvare: Du kan redistribuere det og/eller modifisere det under betingelsene i GNU General Public Lisens, som utgitt av Free Software Foundation, enten versjon 3 av lisensen, eller enhver nyere versjon. +\n +\n Dette program er distribuert i håp om at det vil være nyttig, men udet nogen garanti; selv uten implisitt garanti for SALGBARHET eller FORMÅLSTJENLIGHET for noe formål. Se GNU General Public Lisensen for flere detaljer. +\n +\n Du skulle have mottatt en kopi av GNU General Public Lisensen sammen med dette programmet. Hvis ikke, se www.gnu.org/licenses. + diff --git a/res/values-nl/strings.xml b/res/values-nl/strings.xml index 3995c6340..3a3000406 100644 --- a/res/values-nl/strings.xml +++ b/res/values-nl/strings.xml @@ -1,7 +1,7 @@ - + - Vind je weg terug naar een eerder bezochte locatie met behulp van GPS-coördinaten. + Vind uw weg terug naar een eerder bezochte locatie met behulp van GPS-coördinaten. Geen Onbekend Niet ingesteld @@ -36,14 +36,14 @@ Dit programma wordt gedistribueerd in de hoop dat het nuttig zal zijn maar ZONDER ENIGE GARANTIE; zelfs zonder de impliciete garanties die GEBRUIKELIJK ZIJN IN DE HANDEL of voor BRUIKBAARHEID VOOR EEN SPECIFIEK DOEL. Zie de GNU Algemene Publieke Licentie voor meer details.\n \n Je zou een kopie van de GNU Algemene Publieke Licentie moeten hebben ontvangen samen met dit programma. Als dat niet het geval is, zie www.gnu.org/licenses. - netwerk (GSM/WiFi) + Netwerk (GSM/WiFi) GPS Locatie werd recent bijgewerkt. Locatie werd NIET recent bijgewerkt. Auteursrecht - Start met bewegen voor een nauwkeurige richting naar je bestemming + Start met bewegen voor een nauwkeurige aanwijzing naar uw bestemming Bezoek de <a href=\"%1$s\">website</a> voor meer info. - Locatie bijgewerkt + De locatie is bijgewerkt Locatie bewaard Bewaar uw locatie om een bestemming in te stellen Locatie kon niet bewaard worden omdat er geen huidige locatie is @@ -65,14 +65,14 @@ Je zou een kopie van de GNU Algemene Publieke Licentie moeten hebben ontvangen s WL km/u ten opzichte van huidige richting - Je huidige locatie is onnauwkeurig + Uw huidige locatie is onnauwkeurig Locatiedetails Details Onnauwkeurig Huidige snelheid Huidige koers Gecompileerd op %s. - Je bent op je bestemming + U bent op uw bestemming NO ZO ZW @@ -80,8 +80,8 @@ Je zou een kopie van de GNU Algemene Publieke Licentie moeten hebben ontvangen s Op bestemming Geen bestemming ingesteld Beschikbare sensoren gebruiken - Ingeschakeld : sneller bijgewerkte en nauwkeurigere richting - Uitgeschakeld : bespaart energie + Ingeschakeld : Sneller bijgewerkte en nauwkeurigere richting + Uitgeschakeld : Bespaart energie Standaard richtingsensor Correctie richting door sensors Bewegingsrichting @@ -97,4 +97,7 @@ Je zou een kopie van de GNU Algemene Publieke Licentie moeten hebben ontvangen s Hernoem bestemming Niet mogelijk om bestemming te hernoemen, sla eerst een locatie op Bestemming werd hernoemd + Hoogteverschil + m + km diff --git a/res/values-pl/strings.xml b/res/values-pl/strings.xml new file mode 100644 index 000000000..94d91f3f6 --- /dev/null +++ b/res/values-pl/strings.xml @@ -0,0 +1,84 @@ + +m + km + Kierunek + Dystans + Jesteś u celu + km/h + Wersja + Używaj dostępnych czujników + Ustawienia + Twoja obecna lokalizacja jest niedokładna + Obecna prędkość + Różnica wysokości + Odśwież + Anuluj + Zmień nazwę celu + Zmieniono nazwę celu + Szczegóły lokalizacji + Szczegóły + Źródło lokalizacji + Nazwa + Źródło + GPS + Obecna (ostatnia znana) lokalizacja + Prędkość + Kierunek podróży + Cel + Do celu + O aplikacji + Dokładność + Źródło nie jest obsługiwane. + sieć (komórkowa/WiFi) + Zapisano lokalizację + Wybierz lokalizację dla swojego aktualnego położenia: + Wybierz nową nazwę dla swojego celu: + Nazwa lokalizacji + Zapisz lokalizację + "Lokalizacja \'%s\' została zapisana" + Nie wybrano celu + Zacznij się poruszać, aby uzyskać dokładny kierunek do swojego celu + Zapisz swoją lokalizację, aby ustawić cel + Nie można zapisać lokalizacji, jeżeli nieznane jest obecne położenie + Nazwa lokalizacji nie została wybrana + "Aby uzyskać więcej informacji, odwiedź stronę <a href=%1$s>website</a>." + Częstotliwość według czasu + Częstotliwość według odległości + Niedokładna + Nieznany + Znajdź drogę powrotną do odwiedzonej lokalizacji, wykorzystując współrzędne GPS. + Czujnik orientacji telefonu + Nie można zmienić nazwy celu, najpierw zapisz lokalizację + Jesteś u celu + Obecny kierunek + Odświeżanie lokalizacji + Włączone: Twój kierunek jest dokładniejszy i szybciej odświeżany + Wyłączone: oszczędzana jest energia + Prawa autorskie + Równoleżnik + Południk + Data kompilacji: %s. + Ten program jest wolnym oprogramowaniem, może być dowolnie udostępniany i modyfikowany, o ile zostaną przestrzegane warunki GNU General Public License wydanej przez Free Software Foundation w wersji 3 lub nowszej.\n\nTa aplikacja została udostępniony w nadziei, że będzie ona użyteczna, ale nie NIE UDZIELA SIĘ NA NIĄ ŻADNEJ GWARANCJI, nie możemy zapewnić, że będzie ona działała poprawnie, spełni stawiane przed nią cele, jak i autor nie odpowiada, za wszelkie wyrządzone przez nią szkody. Aby dowiedzieć się więcej, przeczytaj postanowienia GNU General Public License.\n\nRazem z tym oprogramowaniem, powinieneś otrzymać kopię GNU General Public License, jeżeli nie została ona załączona, przeczytaj jej warunki na www.gnu.org/licenses. + + %d minuta + %d minut + + + + płn. wsch. + płd. wsch. + płd. zach. + płn. zach. + płn. + płd. + wsch. + zach. + Wysokość + Zaktualizowano lokalizację + + metr + metrów + metry + + + diff --git a/res/values-pt-rBR/strings.xml b/res/values-pt-rBR/strings.xml index 0d2105c7f..d9fccbb2b 100644 --- a/res/values-pt-rBR/strings.xml +++ b/res/values-pt-rBR/strings.xml @@ -1,5 +1,5 @@ - -Encontre o caminho de volta a um lugar que visitou através de coordenadas GPS. + +Encontre o caminho de volta para um local visitado anteriormente utilizando as coordenadas do GPS. Sua localização atual é inexata Salve sua localização para definir um destino Mova-se para obter uma orientação precisa para seu destino @@ -26,7 +26,7 @@ Detalhes Provedor de local Provedor - rede (celular/WiFi) + Rede (celular/WiFi) GPS Provedor não suportado. Última localização @@ -52,8 +52,8 @@ Atualização de localização A utilização de sensores já existentes Sensor na orientação padrão - Ativado : atualização mais rápida e maior precisão de deslocamento - Desativado : economiza energia + Ativado : Atualização mais rápida e maior precisão de deslocamento + Desativado : Economiza energia Desativado Sobre Versão @@ -95,4 +95,7 @@ %d segundo %d segundos + m + km + Diferença de altura diff --git a/res/values-sc/strings.xml b/res/values-sc/strings.xml index aba208f25..9c3b38a7a 100644 --- a/res/values-sc/strings.xml +++ b/res/values-sc/strings.xml @@ -1,10 +1,10 @@ - + Torra ad una positzione bisitada pretzedentemente impreande sas coordinatas GPS. - Sa positzione relevada tua no est accurada - Sarba sa positzione tua pro impostare una destinatzione - Moende•ti as a otènnere una diretzione prus pretzisa - Ses arribbau a sa destinatzione tua - Lestresa + Sa positzione relevada tua no est pretzisa + Sarva sa positzione tua pro impostare una destinatzione + Moende·ti as a otènnere una diretzione prus pretzisa + Ses arribbadu a sa destinatzione tua + Lestresa de como km/h Relevamentu currente Distàntzia @@ -25,10 +25,10 @@ Annudda Annanghe positzione Torra a numenare sa destinatzione - Positzione de como no identificada, est impossìbile a la sarbare - Impossìbile torrare a numenare sa destinatzione, in antis bolet sarbada una positzione - Positzione sarbada - Positzione \'%s\' sarbada + Positzione de como no identificada, est impossìbile a la sarvare + Impossìbile torrare a numenare sa destinatzione, in antis bolet sarvada una positzione + Positzione sarvada + Positzione \'%s\' sarvada Destinatzione torrada a numenare Nùmene positzione non dislindadu Minujas @@ -36,7 +36,7 @@ Mitza de sa positzione Nùmene Mitza - Retza (Cellulare/WiFi) + Retza (Cellulare/Wi-Fi) GPS Custa mitza no est suportada. Positzione de como (ùrtima connota) @@ -70,8 +70,8 @@ Agiornamentos basados in supra de su tempus Ativa sos sensores disponìbiles Sensore orientamentu predefinidu - Ativadu: agiornamentos lestros e positzionamentu pretzisu - Disativadu: risparmiu energia + Allutu: Agiornamentos prus lestros e positzionamentu prus pretzisu + Istudadu: Risparmiat energia Disativadu %d metru @@ -95,4 +95,7 @@ Custu programma est distribuidu isperande chi siat ùtile, ma SENA GARANTZIA PERUNA; sena fintzas sa garantzia implìcita de CUMMERTZIALIDADE o IDONEIDADE PRO UN\'ISCOPU PARTICULARE. Abbàida sa GNU General Public License pro àteras informatziones.\n \n Si no as retzidu una copia de sa GNU General Public License paris cun custu programma, la podes agatare a custu inoghe: www.gnu.org/licenses. - +m + km + Diferèntzia de artària + diff --git a/res/values-zh-rCN/strings.xml b/res/values-zh-rCN/strings.xml new file mode 100644 index 000000000..0c4aa621e --- /dev/null +++ b/res/values-zh-rCN/strings.xml @@ -0,0 +1,99 @@ + +使用 GPS 坐标找出您应该怎样回到以前曾造访的位置。 + 您的当前位置不准确 + 存储您的位置以设置一个目的地 + 开始移动以获取前往您的目的地的精确方向 + 您已在您的目的地 + 当前速度 + 公里/小时 + 当前朝向 + 距离 + + 千米 + 方向 + 高度差异 + 东北 + 东南 + 西南 + 西北 + 位置已更新 + 不准确 + 已在目的地 + 未设置目的地 + 未知 + 刷新 + 请为您的当前位置输入一个名称: + 请为您的目的地输入一个新名称: + 位置名称 + 取消 + 存储位置 + 重命名目的地 + 无法存储位置,如果没有当前位置 + 无法重命名目的地,需要先存储一个位置 + 位置已存储 + 位置“%s”已存储 + 目的地已重命名 + 未指定位置名称 + 位置详情 + 详情 + 位置提供者 + 名称 + 提供者 + 网络(手机基站/Wi-Fi) + GPS + 不支持该提供者。 + 当前(最后已知)位置 + 纬度 + + + 经度 + + 西 + 海拔 + 速度 + 朝向 + 目的地 + 到目的地 + 相对于当前方向 + 未格式化 + + 未设置 + 位置最近已更新。 + 位置最近未更新。 + 设置 + 常规 + 位置更新 + 使用可用的传感器 + 默认方向传感器 + 启用:快速更新并且更准确朝向 + 停用:节约电量 + 已停用 + + %d 米 + + + + %d 秒 + + + + %d 分 + + + 关于 + 版本 + 构建于 %s。 + 访问<a href=%1$s>网站</a>了解更多信息。 + 版权所有 + 移动方向 + 前进 + 后退 + 精确度 + 时间戳 + 基于传感器的朝向偏移 + 基于距离更新 + 基于时间更新 + 此程序是自由软件:您可以按照 GNU 通用公共许可证 第三版或更新版本的条款重新分发和或修改它。\n +\n This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.\n +\n You should have received a copy of the GNU General Public License along with this program. If not, see www.gnu.org/licenses. + diff --git a/res/values-zh-rTW/strings.xml b/res/values-zh-rTW/strings.xml index 154bc279a..c88573efb 100644 --- a/res/values-zh-rTW/strings.xml +++ b/res/values-zh-rTW/strings.xml @@ -1,4 +1,4 @@ - + 您目前的位置並不正確 存儲您的位置以便設定為目的地 您已在您的目的地 @@ -55,7 +55,7 @@ 相對於現在的航向 使用可用的感測器 預設方位感測器 - 啟用: 快速更新、更準確的方位 + 啟用:快速更新、更準確的方位 停用:節約電力 停用 關於 @@ -92,4 +92,7 @@ 目的地重新命名 無法重新命名目的地,先儲存位置 目的地已重新命名 + 公尺 + 公里 + 高度差異 diff --git a/res/values/donottranslate.xml b/res/values/donottranslate.xml index cf26f0c40..e622b58cb 100644 --- a/res/values/donottranslate.xml +++ b/res/values/donottranslate.xml @@ -2,7 +2,7 @@ GetBack GPS http://ruleant.github.io/getback_gps - © 2012–2015 <a href="mailto:ruleant@users.sourceforge.net">Dieter Adriaenssens</a> + © 2012–2018 <a href="mailto:ruleant@users.sourceforge.net">Dieter Adriaenssens</a> Debug Debugging diff --git a/res/values/strings.xml b/res/values/strings.xml index c3f66ba8f..d6c4dcb52 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -1,7 +1,5 @@ - - + + Find your way back to a previously visited location using GPS coordinates. Your current location is inaccurate @@ -13,6 +11,9 @@ km/h Current bearing Distance + m + km + Height difference Direction NE SE @@ -43,7 +44,7 @@ Location Provider Name Provider - network (Cell phone/WiFi) + Network (Cell phone/Wi-Fi) GPS Provider is not supported. Current (last known) location @@ -79,8 +80,8 @@ Time based updates Use available sensors Default orientation sensor - Enabled : quicker updated and more accurate bearing - Disabled : saves power + Enabled: Quicker updates and more accurate bearing + Disabled: Saves power Disabled %d metre @@ -103,7 +104,7 @@ About Version Built on %s. - Visit the <a href="%1$s">website</a> for more info. + Visit the <a href="%1$s">website</a> for more info. Copyright This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/src/java/com/github/ruleant/getback_gps/AboutActivity.java b/src/java/com/github/ruleant/getback_gps/AboutActivity.java index 5006798c2..975cf6f2f 100644 --- a/src/java/com/github/ruleant/getback_gps/AboutActivity.java +++ b/src/java/com/github/ruleant/getback_gps/AboutActivity.java @@ -1,7 +1,7 @@ /** * About activity, shows app information. * - * Copyright (C) 2012-2015 Dieter Adriaenssens + * Copyright (C) 2012-2018 Dieter Adriaenssens * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/java/com/github/ruleant/getback_gps/AbstractGetBackGpsActivity.java b/src/java/com/github/ruleant/getback_gps/AbstractGetBackGpsActivity.java index ad7169ea9..6c5cea50a 100644 --- a/src/java/com/github/ruleant/getback_gps/AbstractGetBackGpsActivity.java +++ b/src/java/com/github/ruleant/getback_gps/AbstractGetBackGpsActivity.java @@ -1,7 +1,7 @@ /** * Main Activity * - * Copyright (C) 2012-2015 Dieter Adriaenssens + * Copyright (C) 2012-2018 Dieter Adriaenssens * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -165,7 +165,7 @@ protected final void onDestroy() { * It displays a dialog, where the user confirm or cancel storing * the current location. */ - final void storeLocation() { + public final void storeLocation() { if (mBound && mService.getLocation() == null) { Toast.makeText( this, @@ -230,7 +230,7 @@ public void onClick(final DialogInterface dialog, * It displays a dialog, where the user can enter a new name * for the current destination. */ - final void renameDestination() { + public final void renameDestination() { if (mBound && mService.getDestination() == null) { Toast.makeText( this, @@ -307,7 +307,7 @@ public void onClick(final DialogInterface dialog, * * @param item MenuItem object that was clicked */ - final void refresh(final MenuItem item) { + public final void refresh(final MenuItem item) { if (mBound) { mService.updateLocationProvider(); mService.updateLocation(); @@ -320,7 +320,7 @@ final void refresh(final MenuItem item) { * * @param item MenuItem object that was clicked */ - final void displayAbout(final MenuItem item) { + public final void displayAbout(final MenuItem item) { Intent intent = new Intent(this, AboutActivity.class); startActivity(intent); } @@ -330,7 +330,7 @@ final void displayAbout(final MenuItem item) { * * @param item MenuItem object that was clicked */ - final void displaySettings(final MenuItem item) { + public final void displaySettings(final MenuItem item) { Intent intent = new Intent(this, SettingsActivity.class); startActivity(intent); } @@ -398,7 +398,7 @@ protected boolean refreshDisplay() { /** * Update which crouton should be displayed. */ - final void refreshCrouton() { + protected final void refreshCrouton() { // only refresh items if activity is bound to service // connection state is checked in getNavigator Navigator navigator = getNavigator(); @@ -441,7 +441,7 @@ final void refreshCrouton() { * * @param displayInaccurate display value when it is inaccurate */ - final void refreshCurrentViews(final boolean displayInaccurate) { + public final void refreshCurrentViews(final boolean displayInaccurate) { // only refresh items if activity is bound to service // connection state is checked in getNavigator Navigator navigator = getNavigator(); @@ -488,7 +488,7 @@ final void refreshCurrentViews(final boolean displayInaccurate) { * * @return boolean Bound State */ - final boolean isBound() { + protected final boolean isBound() { return mBound; } @@ -497,7 +497,7 @@ final boolean isBound() { * * @return LocationService */ - final LocationService getService() { + protected final LocationService getService() { if (isBound()) { return mService; } else { @@ -510,7 +510,7 @@ final LocationService getService() { * * @return Navigator */ - final Navigator getNavigator() { + protected final Navigator getNavigator() { LocationService service = getService(); if (service == null) { diff --git a/src/java/com/github/ruleant/getback_gps/DetailsActivity.java b/src/java/com/github/ruleant/getback_gps/DetailsActivity.java index b39932c1d..b0dbe5081 100644 --- a/src/java/com/github/ruleant/getback_gps/DetailsActivity.java +++ b/src/java/com/github/ruleant/getback_gps/DetailsActivity.java @@ -1,7 +1,7 @@ /** * Main Activity * - * Copyright (C) 2012-2015 Dieter Adriaenssens + * Copyright (C) 2012-2018 Dieter Adriaenssens * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -152,7 +152,17 @@ protected final boolean refreshDisplay() { // Print distance and bearing toDestinationText += " " + res.getString(R.string.distance) + ": " - + FormatUtils.formatDist(navigator.getDistance()) + "\n"; + + FormatUtils.formatDist(navigator.getDistance(), this) + "\n"; + + toDestinationText += " " + + res.getString(R.string.height_difference) + ": "; + if (destination.hasAltitude() && currentLocation.hasAltitude()) { + toDestinationText += + FormatUtils.formatHeight(navigator.getHeightDifference(), this) + + "\n"; + } else { + toDestinationText += res.getString(R.string.unknown) + "\n"; + } CardinalDirection cd = new CardinalDirection( this, diff --git a/src/java/com/github/ruleant/getback_gps/ILocationServiceCallback.aidl b/src/java/com/github/ruleant/getback_gps/ILocationServiceCallback.aidl index c4a2339d9..788b9085a 100755 --- a/src/java/com/github/ruleant/getback_gps/ILocationServiceCallback.aidl +++ b/src/java/com/github/ruleant/getback_gps/ILocationServiceCallback.aidl @@ -1,7 +1,7 @@ /** * Location Service Callback Interface * - * Copyright (C) 2012-2015 Dieter Adriaenssens + * Copyright (C) 2012-2018 Dieter Adriaenssens * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/java/com/github/ruleant/getback_gps/LocationService.java b/src/java/com/github/ruleant/getback_gps/LocationService.java index dc103a8f9..e10366287 100644 --- a/src/java/com/github/ruleant/getback_gps/LocationService.java +++ b/src/java/com/github/ruleant/getback_gps/LocationService.java @@ -1,7 +1,7 @@ /** * Location Service * - * Copyright (C) 2012-2015 Dieter Adriaenssens + * Copyright (C) 2012-2018 Dieter Adriaenssens * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -631,7 +631,7 @@ public class LocationBinder extends Binder { * * @return LocationService */ - final LocationService getService() { + public final LocationService getService() { // Return this instance of LocationService so clients // can call public methods return LocationService.this; diff --git a/src/java/com/github/ruleant/getback_gps/MainActivity.java b/src/java/com/github/ruleant/getback_gps/MainActivity.java index 3acba0715..58cdbb750 100644 --- a/src/java/com/github/ruleant/getback_gps/MainActivity.java +++ b/src/java/com/github/ruleant/getback_gps/MainActivity.java @@ -1,7 +1,7 @@ /** * Main Activity * - * Copyright (C) 2012-2015 Dieter Adriaenssens + * Copyright (C) 2012-2018 Dieter Adriaenssens * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -119,7 +119,7 @@ public boolean onPrepareOptionsMenu(final Menu menu) { * * @param item MenuItem object that was clicked */ - final void displayDetails(final MenuItem item) { + public final void displayDetails(final MenuItem item) { Intent intent = new Intent(this, DetailsActivity.class); startActivity(intent); } @@ -156,6 +156,8 @@ protected final boolean refreshDisplay() { = (TextView) findViewById(R.id.textView_toDestDist); TextView tvToDestinationDirection = (TextView) findViewById(R.id.textView_toDestDir); + TextView tvHeightDifference + = (TextView) findViewById(R.id.textView_heightDifference); LinearLayout sectionToDestination = (LinearLayout) findViewById(R.id.section_toDestination); @@ -166,6 +168,7 @@ protected final boolean refreshDisplay() { String toDestinationDistanceText = res.getString(R.string.unknown); String toDestinationDirectionText = res.getString(R.string.unknown); String toDestinationMessage = res.getString(R.string.unknown); + String heightDifferenceText = res.getString(R.string.unknown); NavigationView.Mode nvNavigationMode = NavigationView.Mode.Disabled; NavigationView.Mode nvOrientationMode = NavigationView.Mode.Disabled; Boolean displayToDest = false; @@ -209,7 +212,17 @@ protected final boolean refreshDisplay() { if (navigator.isLocationAccurate()) { // Set distance to destination toDestinationDistanceText - = FormatUtils.formatDist(navigator.getDistance()); + = FormatUtils.formatDist(navigator.getDistance(), this); + + // Set height difference + if (destination.hasAltitude() && + getService().getLocation().hasAltitude() + ) { + heightDifferenceText = FormatUtils.formatHeight( + navigator.getHeightDifference(), + this + ); + } // Set direction to destination CardinalDirection cd = new CardinalDirection( @@ -248,6 +261,7 @@ protected final boolean refreshDisplay() { tvToDestinationName.setText(toDestinationNameText); tvToDestinationDistance.setText(toDestinationDistanceText); tvToDestinationDirection.setText(toDestinationDirectionText); + tvHeightDifference.setText(heightDifferenceText); } else { // hide 'to Destination' info, show message sectionToDestination.setVisibility(LinearLayout.INVISIBLE); diff --git a/src/java/com/github/ruleant/getback_gps/NavigationView.java b/src/java/com/github/ruleant/getback_gps/NavigationView.java index 53f76c442..1a0f73683 100644 --- a/src/java/com/github/ruleant/getback_gps/NavigationView.java +++ b/src/java/com/github/ruleant/getback_gps/NavigationView.java @@ -1,7 +1,7 @@ /** * Navigation View * - * Copyright (C) 2012-2015 Dieter Adriaenssens + * Copyright (C) 2012-2018 Dieter Adriaenssens * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/java/com/github/ruleant/getback_gps/SettingsActivity.java b/src/java/com/github/ruleant/getback_gps/SettingsActivity.java index 0718a0d69..4c66aca3b 100644 --- a/src/java/com/github/ruleant/getback_gps/SettingsActivity.java +++ b/src/java/com/github/ruleant/getback_gps/SettingsActivity.java @@ -1,7 +1,7 @@ /** * Preference Activity, for settings. * - * Copyright (C) 2012-2015 Dieter Adriaenssens + * Copyright (C) 2012-2018 Dieter Adriaenssens * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/java/com/github/ruleant/getback_gps/lib/AbstractGeoCoordinate.java b/src/java/com/github/ruleant/getback_gps/lib/AbstractGeoCoordinate.java index f28bb1931..6c153ea2e 100644 --- a/src/java/com/github/ruleant/getback_gps/lib/AbstractGeoCoordinate.java +++ b/src/java/com/github/ruleant/getback_gps/lib/AbstractGeoCoordinate.java @@ -1,7 +1,7 @@ /** * Abstract class for formatting a geological coordinate. * - * Copyright (C) 2012-2015 Dieter Adriaenssens + * Copyright (C) 2012-2018 Dieter Adriaenssens * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -23,6 +23,8 @@ import android.content.Context; +import com.github.ruleant.getback_gps.R; + /** * Abstract class for formatting a geological coordinate. * @@ -82,7 +84,7 @@ public abstract class AbstractGeoCoordinate { * @param rangeLow Lower limit of allowed range * @param rangeHigh Higher limit of allowed range */ - final void setRange( + public final void setRange( final double rangeLow, final double rangeHigh) { mRangeLow = rangeLow; @@ -119,7 +121,7 @@ public final double getValue() { * * @param context Current context */ - final void setContext(final Context context) { + public final void setContext(final Context context) { if (context != null) { mContext = context; } @@ -130,7 +132,7 @@ final void setContext(final Context context) { * * @return Current context */ - final Context getContext() { + public final Context getContext() { return mContext; } @@ -157,7 +159,11 @@ private boolean checkRange(final double coordinate) { * @return String formatted string */ public final String format() { - return formatValue() + " " + getSegmentUnit(); + try { + return String.format("%1$s %2$s", formatValue(), getSegmentUnit()); + } catch (Exception e) { + return getContext().getResources().getString(R.string.none); + } } /** diff --git a/src/java/com/github/ruleant/getback_gps/lib/AriadneLocation.java b/src/java/com/github/ruleant/getback_gps/lib/AriadneLocation.java index 49edac324..d2d4d1046 100644 --- a/src/java/com/github/ruleant/getback_gps/lib/AriadneLocation.java +++ b/src/java/com/github/ruleant/getback_gps/lib/AriadneLocation.java @@ -1,7 +1,7 @@ /** * Custom Ariadne Location object * - * Copyright (C) 2012-2015 Dieter Adriaenssens + * Copyright (C) 2012-2018 Dieter Adriaenssens * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -145,7 +145,7 @@ public final String toFormattedString(final Context context) { if (hasAltitude()) { locationText += "\n " + res.getString(R.string.altitude) + ": " - + FormatUtils.formatDist(getAltitude()); + + FormatUtils.formatHeight(getAltitude(), context); } if (hasBearing()) { CardinalDirection cd = new CardinalDirection(context, getBearing()); @@ -162,7 +162,7 @@ public final String toFormattedString(final Context context) { if (hasAccuracy()) { locationText += "\n " + res.getString(R.string.accuracy) + ": " - + FormatUtils.formatDist(getAccuracy()); + + FormatUtils.formatDist(getAccuracy(), context); } // Location provider diff --git a/src/java/com/github/ruleant/getback_gps/lib/CardinalDirection.java b/src/java/com/github/ruleant/getback_gps/lib/CardinalDirection.java index 500561c8d..2459b49f5 100644 --- a/src/java/com/github/ruleant/getback_gps/lib/CardinalDirection.java +++ b/src/java/com/github/ruleant/getback_gps/lib/CardinalDirection.java @@ -1,7 +1,7 @@ /** * Class for formatting cardinal direction. * - * Copyright (C) 2012-2015 Dieter Adriaenssens + * Copyright (C) 2012-2018 Dieter Adriaenssens * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/java/com/github/ruleant/getback_gps/lib/CircularAverage.java b/src/java/com/github/ruleant/getback_gps/lib/CircularAverage.java index bf846cd74..af34526ec 100644 --- a/src/java/com/github/ruleant/getback_gps/lib/CircularAverage.java +++ b/src/java/com/github/ruleant/getback_gps/lib/CircularAverage.java @@ -4,7 +4,7 @@ * a value that starts in the lower end of the range, * fe. 360° = 0°, 370° = 10°, 350° = -10°. * - * Copyright (C) 2014-2015 Dieter Adriaenssens + * Copyright (C) 2014-2018 Dieter Adriaenssens * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/java/com/github/ruleant/getback_gps/lib/Coordinate.java b/src/java/com/github/ruleant/getback_gps/lib/Coordinate.java index 7cde8b3b9..1977453b2 100644 --- a/src/java/com/github/ruleant/getback_gps/lib/Coordinate.java +++ b/src/java/com/github/ruleant/getback_gps/lib/Coordinate.java @@ -1,7 +1,7 @@ /** * 2D coordinate class, for converting between polar and Cartesian. * - * Copyright (C) 2012-2015 Dieter Adriaenssens + * Copyright (C) 2012-2018 Dieter Adriaenssens * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/java/com/github/ruleant/getback_gps/lib/CoordinateConverterInterface.java b/src/java/com/github/ruleant/getback_gps/lib/CoordinateConverterInterface.java index 407c4a743..b5487f584 100644 --- a/src/java/com/github/ruleant/getback_gps/lib/CoordinateConverterInterface.java +++ b/src/java/com/github/ruleant/getback_gps/lib/CoordinateConverterInterface.java @@ -1,7 +1,7 @@ /** * Interface for classes converting coordinates. * - * Copyright (C) 2012-2015 Dieter Adriaenssens + * Copyright (C) 2012-2018 Dieter Adriaenssens * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/java/com/github/ruleant/getback_gps/lib/CoordinateRotation.java b/src/java/com/github/ruleant/getback_gps/lib/CoordinateRotation.java index 0ff4d3dd9..f7618c4b8 100644 --- a/src/java/com/github/ruleant/getback_gps/lib/CoordinateRotation.java +++ b/src/java/com/github/ruleant/getback_gps/lib/CoordinateRotation.java @@ -1,7 +1,7 @@ /** * Coordinate converter class rotating a set of coordinates. * - * Copyright (C) 2012-2015 Dieter Adriaenssens + * Copyright (C) 2012-2018 Dieter Adriaenssens * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/java/com/github/ruleant/getback_gps/lib/Coordinates.java b/src/java/com/github/ruleant/getback_gps/lib/Coordinates.java index a1cf7eb6c..78e4edb89 100644 --- a/src/java/com/github/ruleant/getback_gps/lib/Coordinates.java +++ b/src/java/com/github/ruleant/getback_gps/lib/Coordinates.java @@ -1,7 +1,7 @@ /** * Coordinate class container. * - * Copyright (C) 2012-2015 Dieter Adriaenssens + * Copyright (C) 2012-2018 Dieter Adriaenssens * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/java/com/github/ruleant/getback_gps/lib/DebugLevel.java b/src/java/com/github/ruleant/getback_gps/lib/DebugLevel.java index 390320b68..5e37cfed9 100644 --- a/src/java/com/github/ruleant/getback_gps/lib/DebugLevel.java +++ b/src/java/com/github/ruleant/getback_gps/lib/DebugLevel.java @@ -1,7 +1,7 @@ /** * DebugLevel class * - * Copyright (C) 2012-2015 Dieter Adriaenssens + * Copyright (C) 2012-2018 Dieter Adriaenssens * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/java/com/github/ruleant/getback_gps/lib/FormatUtils.java b/src/java/com/github/ruleant/getback_gps/lib/FormatUtils.java index 3777ff9a8..424694e78 100644 --- a/src/java/com/github/ruleant/getback_gps/lib/FormatUtils.java +++ b/src/java/com/github/ruleant/getback_gps/lib/FormatUtils.java @@ -2,7 +2,7 @@ * Class to format distances, speeds and numbers. * * Copyright (C) 2010 Peer internet solutions - * Copyright (C) 2013-2015 Dieter Adriaenssens + * Copyright (C) 2013-2018 Dieter Adriaenssens * * Method formatDist() in this file is based on method formatDist * in class MixUtils that is part of mixare. @@ -106,10 +106,29 @@ protected FormatUtils() { * @return formatted distance with unit (m or km) */ public static String formatDist(final double distance) { + return formatDist(distance, null); + } + + /** + * Formats a distance (in meter) to a string, + * in meter or kilometer, depending on the size. + * The number format is localized. + * + * @param distance distance in m + * @param context App context + * @return formatted distance with unit (m or km) + */ + public static String formatDist(final double distance, final Context context) { String shortUnit = "m"; String longUnit = "km"; double scaleUnit = CONV_KM_M; + // if context is defined, use android string + if (context != null) { + shortUnit = context.getResources().getString(R.string.distance_m); + longUnit = context.getResources().getString(R.string.distance_km); + } + // distance shouldn't be negative double distanceAbs = Math.abs(distance); @@ -137,7 +156,38 @@ public static String formatDist(final double distance) { } /** - * Formats a distance (in meter per second (m/s)) to a string, + * Formats a height (in meter) to a string, in meter. + * The number format is localized. + * + * @param height height in m + * @return formatted height with unit (m) + */ + public static String formatHeight(final double height) { + return formatHeight(height, null); + } + + /** + * Formats a height (in meter) to a string, in meter. + * The number format is localized. + * + * @param height height in m + * @return formatted height with unit (m) + */ + public static String formatHeight(final double height, final Context context) { + String unit = "m"; + + // if context is defined, use android string + if (context != null) { + unit = context.getResources().getString(R.string.distance_m); + } + + return String.format( + Locale.getDefault(), "%1$,d%2$s", + Math.round(height), unit); + } + + /** + * Formats a speed (in meter per second (m/s)) to a string, * in kilometer per hour (km/h). * The number format is localized. * @@ -200,7 +250,7 @@ public static String formatAngle(final double angle, final int precision) { // generate format string // format number with variable precision (%s.xf), with x = precision - String formatString = "%1$." + String.format("%d", precision) + "f"; + String formatString = "%1$." + String.format(Locale.US, "%d", precision) + "f"; // add unit formatString += "%2$s"; @@ -253,9 +303,9 @@ public static String localizeProviderName( try { Resources res = context.getResources(); - if (providerName.equals("network")) { + if ("network".equals(providerName)) { l10nProviderName = res.getString(R.string.loc_provider_network); - } else if (providerName.equals("gps")) { + } else if ("gps".equals(providerName)) { l10nProviderName = res.getString(R.string.loc_provider_gps); } } catch (NotFoundException e) { diff --git a/src/java/com/github/ruleant/getback_gps/lib/Latitude.java b/src/java/com/github/ruleant/getback_gps/lib/Latitude.java index bc4227294..c1a57c4ed 100644 --- a/src/java/com/github/ruleant/getback_gps/lib/Latitude.java +++ b/src/java/com/github/ruleant/getback_gps/lib/Latitude.java @@ -1,7 +1,7 @@ /** * Class for formatting latitude. * - * Copyright (C) 2012-2015 Dieter Adriaenssens + * Copyright (C) 2012-2018 Dieter Adriaenssens * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -176,7 +176,14 @@ protected final double getConvertedValue() { * @return formatted value */ protected final String formatValue() { - return Location.convert(getConvertedValue(), Location.FORMAT_SECONDS) - .replaceFirst(":", "° ").replace(":", "' ") + "\""; + String[] components = Location.convert( + getConvertedValue(), + Location.FORMAT_SECONDS + ).split(":"); + return String.format("%1$d° %2$d' %3$s\"", + Integer.parseInt(components[0]), + Integer.parseInt(components[1]), + components[2] + ); } } diff --git a/src/java/com/github/ruleant/getback_gps/lib/Longitude.java b/src/java/com/github/ruleant/getback_gps/lib/Longitude.java index ace668c46..f2af7715e 100644 --- a/src/java/com/github/ruleant/getback_gps/lib/Longitude.java +++ b/src/java/com/github/ruleant/getback_gps/lib/Longitude.java @@ -1,7 +1,7 @@ /** * Class for formatting longitude. * - * Copyright (C) 2012-2015 Dieter Adriaenssens + * Copyright (C) 2012-2018 Dieter Adriaenssens * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -174,7 +174,14 @@ protected final double getConvertedValue() { * @return formatted value */ protected final String formatValue() { - return Location.convert(getConvertedValue(), Location.FORMAT_SECONDS) - .replaceFirst(":", "° ").replace(":", "' ") + "\""; + String[] components = Location.convert( + getConvertedValue(), + Location.FORMAT_SECONDS + ).split(":"); + return String.format("%1$d° %2$d' %3$s\"", + Integer.parseInt(components[0]), + Integer.parseInt(components[1]), + components[2] + ); } } diff --git a/src/java/com/github/ruleant/getback_gps/lib/LowPassFilter.java b/src/java/com/github/ruleant/getback_gps/lib/LowPassFilter.java index 13cd6c2b4..40a3e4def 100644 --- a/src/java/com/github/ruleant/getback_gps/lib/LowPassFilter.java +++ b/src/java/com/github/ruleant/getback_gps/lib/LowPassFilter.java @@ -1,7 +1,7 @@ /** * Implementation of a low pass filter. * - * Copyright (C) 2014-2015 Dieter Adriaenssens + * Copyright (C) 2014-2018 Dieter Adriaenssens * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/java/com/github/ruleant/getback_gps/lib/Navigator.java b/src/java/com/github/ruleant/getback_gps/lib/Navigator.java index 42bb67da8..045994619 100644 --- a/src/java/com/github/ruleant/getback_gps/lib/Navigator.java +++ b/src/java/com/github/ruleant/getback_gps/lib/Navigator.java @@ -1,7 +1,7 @@ /** * Class with several methods useful for navigation. * - * Copyright (C) 2012-2015 Dieter Adriaenssens + * Copyright (C) 2012-2018 Dieter Adriaenssens * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -200,6 +200,21 @@ public final float getDistance() { return mCurrentLocation.distanceTo(destination); } + /** + * Calculate height difference to current destination. + * + * @return distance in meters + */ + public final double getHeightDifference() { + AriadneLocation destination = getDestination(); + + // don't calculate difference if current location is not set + if (mCurrentLocation == null || destination == null) { + return DIST_ZERO; + } + return destination.getAltitude() - mCurrentLocation.getAltitude(); + } + /** * Calculate absolute direction to current destination. * diff --git a/src/java/com/github/ruleant/getback_gps/lib/SensorOrientation.java b/src/java/com/github/ruleant/getback_gps/lib/SensorOrientation.java index 57fc75179..be96d1dd5 100644 --- a/src/java/com/github/ruleant/getback_gps/lib/SensorOrientation.java +++ b/src/java/com/github/ruleant/getback_gps/lib/SensorOrientation.java @@ -1,7 +1,7 @@ /** * Calculates current orientation from sensors. * - * Copyright (C) 2014-2015 Dieter Adriaenssens + * Copyright (C) 2014-2018 Dieter Adriaenssens * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -49,6 +49,12 @@ public class SensorOrientation implements SensorEventListener { */ private Context mContext; + /** + * List with subscribed listeners. + */ + private ArrayList eventListenerList + = new ArrayList(); + /** * Current calculated orientation. */ @@ -394,12 +400,6 @@ public interface OrientationEventListener extends EventListener { void onOrientationChanged(); } - /** - * List with subscribed listeners. - */ - private ArrayList eventListenerList - = new ArrayList(); - /** * Adds the listener to eventListenerList. * @param listener SensorOrientation event listener diff --git a/src/java/com/github/ruleant/getback_gps/lib/StoredDestination.java b/src/java/com/github/ruleant/getback_gps/lib/StoredDestination.java index 9affa9333..a090acd6c 100644 --- a/src/java/com/github/ruleant/getback_gps/lib/StoredDestination.java +++ b/src/java/com/github/ruleant/getback_gps/lib/StoredDestination.java @@ -2,7 +2,7 @@ /** * Stored Destination * - * Copyright (C) 2012-2015 Dieter Adriaenssens + * Copyright (C) 2012-2018 Dieter Adriaenssens * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -60,6 +60,7 @@ public final void setLocation(final AriadneLocation location) { tempLocation.setName(location.getName()); tempLocation.setLongitude(location.getLongitude()); tempLocation.setLatitude(location.getLatitude()); + tempLocation.setAltitude(location.getAltitude()); super.setLocation(tempLocation); } diff --git a/src/java/com/github/ruleant/getback_gps/lib/StoredLocation.java b/src/java/com/github/ruleant/getback_gps/lib/StoredLocation.java index a09454d99..110ff1911 100644 --- a/src/java/com/github/ruleant/getback_gps/lib/StoredLocation.java +++ b/src/java/com/github/ruleant/getback_gps/lib/StoredLocation.java @@ -1,7 +1,7 @@ /** * StoredLocation * - * Copyright (C) 2012-2015 Dieter Adriaenssens + * Copyright (C) 2012-2018 Dieter Adriaenssens * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/java/com/github/ruleant/getback_gps/lib/Tools.java b/src/java/com/github/ruleant/getback_gps/lib/Tools.java index 6c1da016b..1cc144a3c 100644 --- a/src/java/com/github/ruleant/getback_gps/lib/Tools.java +++ b/src/java/com/github/ruleant/getback_gps/lib/Tools.java @@ -1,7 +1,7 @@ /** * Collection of useful methods. * - * Copyright (C) 2014-2015 Dieter Adriaenssens + * Copyright (C) 2014-2018 Dieter Adriaenssens * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/java/com/github/ruleant/getback_gps/lib/package-info.java b/src/java/com/github/ruleant/getback_gps/lib/package-info.java index 8fcb02a19..ec1ef35e1 100644 --- a/src/java/com/github/ruleant/getback_gps/lib/package-info.java +++ b/src/java/com/github/ruleant/getback_gps/lib/package-info.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2012-2015 Dieter Adriaenssens + * Copyright (C) 2012-2018 Dieter Adriaenssens * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/java/com/github/ruleant/getback_gps/package-info.java b/src/java/com/github/ruleant/getback_gps/package-info.java index 3ed314488..b94f438b8 100644 --- a/src/java/com/github/ruleant/getback_gps/package-info.java +++ b/src/java/com/github/ruleant/getback_gps/package-info.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2012-2015 Dieter Adriaenssens + * Copyright (C) 2012-2018 Dieter Adriaenssens * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/java/com/github/ruleant/unitconversion/package-info.java b/src/java/com/github/ruleant/unitconversion/package-info.java index cb60f63a2..a0b252d78 100644 --- a/src/java/com/github/ruleant/unitconversion/package-info.java +++ b/src/java/com/github/ruleant/unitconversion/package-info.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2012-2015 Dieter Adriaenssens + * Copyright (C) 2012-2018 Dieter Adriaenssens * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/test/java/com/github/ruleant/getback_gps/lib/CardinalDirectionTest.java b/src/test/java/com/github/ruleant/getback_gps/lib/CardinalDirectionTest.java index cd1c77957..c2034825f 100644 --- a/src/test/java/com/github/ruleant/getback_gps/lib/CardinalDirectionTest.java +++ b/src/test/java/com/github/ruleant/getback_gps/lib/CardinalDirectionTest.java @@ -1,7 +1,7 @@ /** * Unit tests for CardinalDirection class * - * Copyright (C) 2012-2015 Dieter Adriaenssens + * Copyright (C) 2012-2018 Dieter Adriaenssens * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -29,6 +29,7 @@ import org.robolectric.RobolectricTestRunner; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.fail; /** * Unit tests for CardinalDirection class. @@ -108,6 +109,7 @@ public final void testOutOfRangeValueBigger() { thrown.expectMessage(MESSAGE_VALUE_RANGE); object.setValue(OUT_OF_RANGE); + fail("Expected an IllegalArgumentException to be thrown"); } /** @@ -119,6 +121,7 @@ public final void testOutOfRangeValueSmaller() { thrown.expectMessage(MESSAGE_VALUE_RANGE); object.setValue(-1 * OUT_OF_RANGE); + fail("Expected an IllegalArgumentException to be thrown"); } /** diff --git a/src/test/java/com/github/ruleant/getback_gps/lib/CircularAverageTest.java b/src/test/java/com/github/ruleant/getback_gps/lib/CircularAverageTest.java index 96ea22a13..2baa20b2f 100644 --- a/src/test/java/com/github/ruleant/getback_gps/lib/CircularAverageTest.java +++ b/src/test/java/com/github/ruleant/getback_gps/lib/CircularAverageTest.java @@ -1,7 +1,7 @@ /** * Unit tests for CircularAverage class * - * Copyright (C) 2014-2015 Dieter Adriaenssens + * Copyright (C) 2014-2018 Dieter Adriaenssens * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -28,6 +28,7 @@ import org.robolectric.RobolectricTestRunner; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.fail; /** * Unit tests for CircularAverage class. @@ -148,6 +149,7 @@ public final void testOutOfRangeValueSmaller() { // invalid range for parameter alpha CircularAverage.getAverageValue(0, 0, -1); + fail("Expected an IllegalArgumentException to be thrown"); } /** @@ -159,6 +161,7 @@ public final void testOutOfRangeValueBigger() { thrown.expectMessage(MESSAGE_VALUE_RANGE); CircularAverage.getAverageValue(0, 0, 2); + fail("Expected an IllegalArgumentException to be thrown"); } /** diff --git a/src/test/java/com/github/ruleant/getback_gps/lib/CoordinateRotationTest.java b/src/test/java/com/github/ruleant/getback_gps/lib/CoordinateRotationTest.java index ddeb1aa50..e7e5d1d29 100644 --- a/src/test/java/com/github/ruleant/getback_gps/lib/CoordinateRotationTest.java +++ b/src/test/java/com/github/ruleant/getback_gps/lib/CoordinateRotationTest.java @@ -1,7 +1,7 @@ /** * Unit tests for Coordinate class * - * Copyright (C) 2012-2015 Dieter Adriaenssens + * Copyright (C) 2012-2018 Dieter Adriaenssens * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -29,6 +29,7 @@ import org.robolectric.RobolectricTestRunner; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.fail; /** * Unit tests for Coordinate class. @@ -134,6 +135,7 @@ public final void testNoCenter() { thrown.expectMessage("Parameter center should not be null"); converter.setRotationCenter(null); + fail("Expected an IllegalArgumentException to be thrown"); } /** diff --git a/src/test/java/com/github/ruleant/getback_gps/lib/CoordinateTest.java b/src/test/java/com/github/ruleant/getback_gps/lib/CoordinateTest.java index 0cf597080..064446ed0 100644 --- a/src/test/java/com/github/ruleant/getback_gps/lib/CoordinateTest.java +++ b/src/test/java/com/github/ruleant/getback_gps/lib/CoordinateTest.java @@ -1,7 +1,7 @@ /** * Unit tests for Coordinate class * - * Copyright (C) 2012-2015 Dieter Adriaenssens + * Copyright (C) 2012-2018 Dieter Adriaenssens * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -29,6 +29,7 @@ import org.robolectric.RobolectricTestRunner; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.fail; /** * Unit tests for Coordinate class. @@ -259,6 +260,7 @@ public final void testSetCoordinateNull() { thrown.expectMessage("Parameter coordinate should not be null"); coordinate.setCoordinate(null); + fail("Expected an IllegalArgumentException to be thrown"); } /** diff --git a/src/test/java/com/github/ruleant/getback_gps/lib/CoordinatesTest.java b/src/test/java/com/github/ruleant/getback_gps/lib/CoordinatesTest.java index 88974abf7..6a4d6bd92 100644 --- a/src/test/java/com/github/ruleant/getback_gps/lib/CoordinatesTest.java +++ b/src/test/java/com/github/ruleant/getback_gps/lib/CoordinatesTest.java @@ -1,7 +1,7 @@ /** * Unit tests for Coordinates class * - * Copyright (C) 2012-2015 Dieter Adriaenssens + * Copyright (C) 2012-2018 Dieter Adriaenssens * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -29,6 +29,7 @@ import org.robolectric.RobolectricTestRunner; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.fail; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; @@ -190,6 +191,7 @@ public final void testSetCoordinateNull() { thrown.expectMessage("Parameter coordinate should not be null"); coordinates.addCoordinate(null); + fail("Expected an IllegalArgumentException to be thrown"); } /** @@ -432,5 +434,6 @@ public final void testSetCoordinateConverterNull() { thrown.expectMessage("Parameter converter should not be null"); coordinates.setCoordinateConverter(null); + fail("Expected an IllegalArgumentException to be thrown"); } } diff --git a/src/test/java/com/github/ruleant/getback_gps/lib/FormatUtilsTest.java b/src/test/java/com/github/ruleant/getback_gps/lib/FormatUtilsTest.java index d8f42f6d1..d4458c708 100644 --- a/src/test/java/com/github/ruleant/getback_gps/lib/FormatUtilsTest.java +++ b/src/test/java/com/github/ruleant/getback_gps/lib/FormatUtilsTest.java @@ -1,7 +1,7 @@ /** * Unit tests for FormatUtils class * - * Copyright (C) 2013-2015 Dieter Adriaenssens + * Copyright (C) 2013-2018 Dieter Adriaenssens * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -34,6 +34,7 @@ import java.util.Locale; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.fail; /** * Unit tests for FormatUtils class. @@ -364,6 +365,62 @@ public final void testFormatDistNeg() { assertEquals("11km", FormatUtils.formatDist(-1.0 * M_11KM)); } + /** + * Tests main functionality of method FormatHeight. + * Locale en_US is assumed, several distances are passed as an argument + * to test the different cases : in meter, more than 1,000 m. + */ + @Test + public final void testFormatHeightMain() { + assertEquals("9m", FormatUtils.formatHeight(M_9M)); + assertEquals("10m", FormatUtils.formatHeight(M_10M)); + assertEquals("9,000m", FormatUtils.formatHeight(M_9KM)); + assertEquals("9,900m", FormatUtils.formatHeight(M_9P9KM)); + assertEquals("11,000m", FormatUtils.formatHeight(M_11KM)); + assertEquals("12,345,000m", FormatUtils.formatHeight(M_12345KM)); + } + + /** + * Tests the formatting when a European locale is used, in this case nl_BE. + */ + @Test + public final void testFormatHeightBelgianFormat() { + // Set Dutch (Belgium) locale + Locale localeDutchBelgian = new Locale("nl", "BE"); + Locale.setDefault(localeDutchBelgian); + + assertEquals("9.000m", FormatUtils.formatHeight(M_9KM)); + assertEquals("9.900m", FormatUtils.formatHeight(M_9P9KM)); + assertEquals("12.345.000m", FormatUtils.formatHeight(M_12345KM)); + } + + /** + * Test if the height is correctly rounded. + */ + @Test + public final void testFormatHeightRoundUp() { + assertEquals("10m", FormatUtils.formatHeight(M_9P9M)); + assertEquals("999m", FormatUtils.formatHeight(M_999P3M)); + assertEquals("1,000m", FormatUtils.formatHeight(M_999P9M)); + assertEquals("1,330m", FormatUtils.formatHeight(M_1P33KM)); + assertEquals("1,370m", FormatUtils.formatHeight(M_1P37KM)); + assertEquals("9,930m", FormatUtils.formatHeight(M_9P93KM)); + assertEquals("9,980m", FormatUtils.formatHeight(M_9P98KM)); + assertEquals("11,400m", FormatUtils.formatHeight(M_11P4KM)); + assertEquals("11,700m", FormatUtils.formatHeight(M_11P7KM)); + } + + /** + * Tests if returned formatted height is negative, + * if the distance argument is negative. + */ + @Test + public final void testFormatHeightNeg() { + assertEquals("-1m", FormatUtils.formatHeight(-1.0)); + assertEquals("-9,000m", FormatUtils.formatHeight(-1.0 * M_9KM)); + assertEquals("-11,000m", FormatUtils.formatHeight(-1.0 * M_11KM)); + } + /** * Tests conversion of the speed from m/s to km/h * and formatting of the speed : @@ -465,6 +522,7 @@ public final void testFormatAngleWrongPrecision() { thrown.expectMessage("Precision can't be a negative value"); FormatUtils.formatAngle(A_45, -1); + fail("Expected an IllegalArgumentException to be thrown"); } /** diff --git a/src/test/java/com/github/ruleant/getback_gps/lib/LatitudeTest.java b/src/test/java/com/github/ruleant/getback_gps/lib/LatitudeTest.java index b3beb8ad4..1969706ae 100644 --- a/src/test/java/com/github/ruleant/getback_gps/lib/LatitudeTest.java +++ b/src/test/java/com/github/ruleant/getback_gps/lib/LatitudeTest.java @@ -1,7 +1,7 @@ /** * Unit tests for Latitude class * - * Copyright (C) 2012-2015 Dieter Adriaenssens + * Copyright (C) 2012-2018 Dieter Adriaenssens * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -29,6 +29,7 @@ import org.robolectric.RobolectricTestRunner; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.fail; /** * Unit tests for Latitude class. @@ -124,6 +125,7 @@ public final void testOutOfRangeValueBigger() { thrown.expectMessage(MESSAGE_VALUE_RANGE); latitude.setValue(OUT_OF_RANGE); + fail("Expected an IllegalArgumentException to be thrown"); } /** @@ -135,6 +137,7 @@ public final void testOutOfRangeValueSmaller() { thrown.expectMessage(MESSAGE_VALUE_RANGE); latitude.setValue(-1 * OUT_OF_RANGE); + fail("Expected an IllegalArgumentException to be thrown"); } /** diff --git a/src/test/java/com/github/ruleant/getback_gps/lib/LongitudeTest.java b/src/test/java/com/github/ruleant/getback_gps/lib/LongitudeTest.java index 485fa5339..96e71d16a 100644 --- a/src/test/java/com/github/ruleant/getback_gps/lib/LongitudeTest.java +++ b/src/test/java/com/github/ruleant/getback_gps/lib/LongitudeTest.java @@ -1,7 +1,7 @@ /** * Unit tests for Longitude class * - * Copyright (C) 2012-2015 Dieter Adriaenssens + * Copyright (C) 2012-2018 Dieter Adriaenssens * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -29,6 +29,7 @@ import org.robolectric.RobolectricTestRunner; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.fail; /** * Unit tests for Longitude class. @@ -124,6 +125,7 @@ public final void testOutOfRangeValueBigger() { thrown.expectMessage(MESSAGE_VALUE_RANGE); longitude.setValue(OUT_OF_RANGE); + fail("Expected an IllegalArgumentException to be thrown"); } /** @@ -135,6 +137,7 @@ public final void testOutOfRangeValueSmaller() { thrown.expectMessage(MESSAGE_VALUE_RANGE); longitude.setValue(-1 * OUT_OF_RANGE); + fail("Expected an IllegalArgumentException to be thrown"); } /** diff --git a/src/test/java/com/github/ruleant/getback_gps/lib/LowPassFilterTest.java b/src/test/java/com/github/ruleant/getback_gps/lib/LowPassFilterTest.java index d46c6a6ba..64ffc863f 100644 --- a/src/test/java/com/github/ruleant/getback_gps/lib/LowPassFilterTest.java +++ b/src/test/java/com/github/ruleant/getback_gps/lib/LowPassFilterTest.java @@ -1,7 +1,7 @@ /** * Unit tests for LowPassFilter class * - * Copyright (C) 2014-2015 Dieter Adriaenssens + * Copyright (C) 2014-2018 Dieter Adriaenssens * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -28,6 +28,7 @@ import org.robolectric.RobolectricTestRunner; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.fail; /** * Unit tests for FormatUtils class. @@ -100,6 +101,7 @@ public final void testOutOfRangeValueSmaller() { // invalid range for parameter alpha LowPassFilter.filterValue(0, 0, -1); + fail("Expected an IllegalArgumentException to be thrown"); } /** @@ -112,6 +114,7 @@ public final void testOutOfRangeValueSmaller2() { // invalid range for parameter alpha LowPassFilter.filterValue(0, 0, -1 * 2); + fail("Expected an IllegalArgumentException to be thrown"); } /** @@ -123,6 +126,7 @@ public final void testOutOfRangeValueBigger() { thrown.expectMessage(MESSAGE_VALUE_RANGE); LowPassFilter.filterValue(0, 0, 2); + fail("Expected an IllegalArgumentException to be thrown"); } /** @@ -187,7 +191,7 @@ public final void testFilterValueUnSetArrays() { // empty newArray LowPassFilter.filterValueSet(null, null, 0f); - + fail("Expected an IllegalArgumentException to be thrown"); } /** @@ -202,6 +206,7 @@ public final void testFilterValueEmptyArrays() { float[] newArray = new float[0]; LowPassFilter.filterValueSet(null, newArray, 0f); + fail("Expected an IllegalArgumentException to be thrown"); } /** diff --git a/src/test/java/com/github/ruleant/getback_gps/lib/NavigatorTest.java b/src/test/java/com/github/ruleant/getback_gps/lib/NavigatorTest.java index 1d2d18959..cb00270f5 100644 --- a/src/test/java/com/github/ruleant/getback_gps/lib/NavigatorTest.java +++ b/src/test/java/com/github/ruleant/getback_gps/lib/NavigatorTest.java @@ -1,7 +1,7 @@ /** * Unit tests for Navigator class * - * Copyright (C) 2012-2015 Dieter Adriaenssens + * Copyright (C) 2012-2018 Dieter Adriaenssens * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -32,6 +32,7 @@ import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; @@ -92,6 +93,30 @@ public class NavigatorTest { */ private static final double BEARING_2 = 80.0; + /** + * Altitude 1 (10m). + */ + private static final double ALTITUDE_1 = 10.0; + + /** + * Altitude 2 (75m). + */ + private static final double ALTITUDE_2 = 75.0; + + /** + * Altitude 3 (100m). + */ + private static final double ALTITUDE_3 = 100.0; + + /** + * Height difference between location 2 and 1. + */ + private static final double HEIGHT_LOC2_1 = -65.0; + + /** + * Height difference between location 2 and 3. + */ + private static final double HEIGHT_LOC2_3 = 25.0; /** * Bearing variation (+ 10°). */ @@ -185,6 +210,10 @@ public final void setUp() { when(loc1.bearingTo(loc3)).thenReturn((float) DIR_LOC1_3); when(loc2.bearingTo(loc1)).thenReturn((float) DIR_LOC2_1); when(loc2.bearingTo(loc3)).thenReturn((float) DIR_LOC2_3); + // set altitudes + when(loc1.getAltitude()).thenReturn(ALTITUDE_1); + when(loc2.getAltitude()).thenReturn(ALTITUDE_2); + when(loc3.getAltitude()).thenReturn(ALTITUDE_3); } /** @@ -217,6 +246,8 @@ public final void testNoValue() { assertEquals(Navigator.DIST_ZERO, navigator.getDistance(), ASSERT_ACCURACY); + assertEquals(Navigator.DIST_ZERO, navigator.getHeightDifference(), + ASSERT_ACCURACY); assertEquals(Navigator.DIR_ZERO, navigator.getCurrentBearing(), ASSERT_ACCURACY); assertEquals(Navigator.DIR_ZERO, navigator.getAbsoluteDirection(), @@ -251,6 +282,7 @@ public final void testConstructorOrientationNull() { thrown.expectMessage("Parameter sensorOrientation should not be null"); new Navigator(null); + fail("Expected an IllegalArgumentException to be thrown"); } /** @@ -364,6 +396,33 @@ public final void testGetDistance() { assertEquals(DIST_LOC1_2, navigator.getDistance(), ASSERT_ACCURACY); } + /** + * Tests getHeightDifference. + */ + @Test + public final void testGetHeightDifference() { + // set location + navigator.setLocation(loc2); + // set destination + navigator.setDestination(loc3); + + // test HeightDifference + assertEquals(HEIGHT_LOC2_3, navigator.getHeightDifference(), + ASSERT_ACCURACY); + + // set another destination + navigator.setDestination(loc1); + // test HeightDifference + assertEquals(HEIGHT_LOC2_1, navigator.getHeightDifference(), + ASSERT_ACCURACY); + + // set final destination + navigator.setDestination(loc2); + // test HeightDifference + assertEquals(Navigator.DIST_ZERO, navigator.getHeightDifference(), + ASSERT_ACCURACY); + } + /** * Tests getAbsoluteDirection. */ diff --git a/src/test/java/com/github/ruleant/getback_gps/lib/ToolsTest.java b/src/test/java/com/github/ruleant/getback_gps/lib/ToolsTest.java index bfc0e5685..4ae2320c3 100644 --- a/src/test/java/com/github/ruleant/getback_gps/lib/ToolsTest.java +++ b/src/test/java/com/github/ruleant/getback_gps/lib/ToolsTest.java @@ -1,7 +1,7 @@ /** * Unit tests for Tools class * - * Copyright (C) 2014-2015 Dieter Adriaenssens + * Copyright (C) 2014-2018 Dieter Adriaenssens * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -31,6 +31,7 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; /** * Unit tests for FormatUtils class. @@ -118,6 +119,7 @@ public final void testIsTimestampRecentRangeCurrent() { thrown.expectMessage("currentTimestamp can't be a negative value"); Tools.isTimestampRecent(-1, 1, 1); + fail("Expected an IllegalArgumentException to be thrown"); } /** @@ -129,6 +131,7 @@ public final void testIsTimestampRecentRangePrevious() { thrown.expectMessage("previousTimestamp can't be a negative value"); Tools.isTimestampRecent(1, -1, 1); + fail("Expected an IllegalArgumentException to be thrown"); } /** @@ -141,6 +144,7 @@ public final void testIsTimestampRecentRangeValidityZero() { thrown.expectMessage("validity should be a non-zero positive value"); Tools.isTimestampRecent(1, 1, 0); + fail("Expected an IllegalArgumentException to be thrown"); } /** @@ -153,6 +157,7 @@ public final void testIsTimestampRecentRangeValidityNegative() { thrown.expectMessage("validity should be a non-zero positive value"); Tools.isTimestampRecent(1, 1, -1); + fail("Expected an IllegalArgumentException to be thrown"); } /** diff --git a/src/test/java/com/github/ruleant/getback_gps/lib/package-info.java b/src/test/java/com/github/ruleant/getback_gps/lib/package-info.java index 3f7699137..0fdcd4ada 100644 --- a/src/test/java/com/github/ruleant/getback_gps/lib/package-info.java +++ b/src/test/java/com/github/ruleant/getback_gps/lib/package-info.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2012-2015 Dieter Adriaenssens + * Copyright (C) 2012-2018 Dieter Adriaenssens * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by