├── .gitignore ├── LICENSE.md ├── README.md ├── releases ├── mapping-1.4.1.txt ├── mapping-1.5.0.txt ├── mapping-1.5.1.txt ├── mapping-1.5.2.txt ├── mapping-1.5.3.txt ├── mapping-1.5.4.txt ├── opengpstracker-1.4.0.apk ├── opengpstracker-1.4.1.apk ├── opengpstracker-1.5.0.apk ├── opengpstracker-1.5.1.apk ├── opengpstracker-1.5.2-release.apk ├── opengpstracker-1.5.3-release.apk └── opengpstracker-1.5.4-release.apk ├── resources ├── 036028-yellow-comment-bubbles-icon-culture-world1 │ ├── 036028-yellow-comment-bubbles-icon-culture-world1.png │ └── readme.txt ├── PrivacyPolicy.txt ├── ogt-pictogram.png └── ogt-pictogram.webp └── studio ├── .gitignore ├── LICENCE ├── NOTICE ├── app ├── .gitignore ├── build.gradle ├── proguard-rules.pro ├── signing.gradle └── src │ ├── androidTest │ ├── java │ │ └── nl │ │ │ └── sogeti │ │ │ └── android │ │ │ └── gpstracker │ │ │ ├── ApplicationTest.java │ │ │ └── tests │ │ │ ├── GPStrackingInstrumentation.java │ │ │ ├── demo │ │ │ └── OpenGPSTrackerDemo.java │ │ │ ├── gpsmock │ │ │ └── MockGPSLoggerServiceTest.java │ │ │ ├── perf │ │ │ ├── LoggerStressTest.java │ │ │ └── MapStressTest.java │ │ │ ├── userinterface │ │ │ ├── LoggerMapTest.java │ │ │ └── TrackingOverlayTest.java │ │ │ ├── utils │ │ │ ├── MockGPSLoggerDriver.java │ │ │ └── TelnetPositionSender.java │ │ │ └── viewer │ │ │ └── TrackListTest.java │ └── res │ │ └── xml │ │ ├── amsterdam2utrecht.xml │ │ ├── denhaagdenbosch.xml │ │ └── rondjesingelutrecht.xml │ ├── main │ ├── AndroidManifest.xml │ ├── assets │ │ └── about.html │ ├── java │ │ └── nl │ │ │ └── sogeti │ │ │ └── android │ │ │ └── gpstracker │ │ │ ├── Application.java │ │ │ ├── actions │ │ │ ├── AboutActivity.java │ │ │ ├── ControlTracking.java │ │ │ ├── InsertNote.java │ │ │ ├── NameTrack.java │ │ │ ├── ShareTrack.java │ │ │ ├── Statistics.java │ │ │ ├── tasks │ │ │ │ ├── ContentProviderFileExtractor.java │ │ │ │ ├── GpxCreator.java │ │ │ │ ├── GpxParser.java │ │ │ │ ├── GpxSDCardStore.java │ │ │ │ ├── GpxSharing.java │ │ │ │ ├── KmzCreator.java │ │ │ │ ├── KmzSDCardStore.java │ │ │ │ ├── KmzSharing.java │ │ │ │ └── XmlCreator.java │ │ │ └── utils │ │ │ │ ├── GraphCanvas.java │ │ │ │ ├── ProgressListener.java │ │ │ │ ├── StatisticsCalulator.java │ │ │ │ ├── StatisticsDelegate.java │ │ │ │ └── ViewFlipper.java │ │ │ ├── adapter │ │ │ └── SectionedListAdapter.java │ │ │ ├── settings │ │ │ ├── Helper.java │ │ │ ├── SettingsActivity.java │ │ │ └── SettingsFragment.java │ │ │ ├── streaming │ │ │ ├── CustomUpload.java │ │ │ ├── StreamUtils.java │ │ │ └── VoiceOver.java │ │ │ ├── support │ │ │ └── AppCompatMapActivity.java │ │ │ ├── util │ │ │ ├── Constants.java │ │ │ ├── DateView.java │ │ │ ├── ProgressFilterInputStream.java │ │ │ ├── UnicodeReader.java │ │ │ └── UnitsI18n.java │ │ │ ├── viewer │ │ │ ├── FixedMyLocationOverlay.java │ │ │ ├── LoggerMap.java │ │ │ ├── SegmentOverlay.java │ │ │ └── TrackList.java │ │ │ └── widget │ │ │ └── ControlWidgetProvider.java │ └── res │ │ ├── anim │ │ ├── slide_left_in.xml │ │ ├── slide_left_out.xml │ │ ├── slide_right_in.xml │ │ └── slide_right_out.xml │ │ ├── drawable-hdpi │ │ ├── btn_close_normal.png │ │ ├── btn_close_pressed.png │ │ ├── btn_close_selected.png │ │ ├── ic_menu_preferences.png │ │ ├── icon.png │ │ ├── live.png │ │ ├── media_camera.png │ │ ├── media_film.png │ │ ├── media_mark.png │ │ ├── media_notepad.png │ │ └── media_speech.png │ │ ├── drawable-ldpi │ │ ├── btn_close_normal.png │ │ ├── btn_close_pressed.png │ │ ├── btn_close_selected.png │ │ └── icon.png │ │ ├── drawable-mdpi │ │ ├── btn_close_normal.png │ │ ├── btn_close_pressed.png │ │ ├── btn_close_selected.png │ │ ├── ic_maps_indicator_current_position.png │ │ ├── ic_menu_preferences.png │ │ ├── icon.png │ │ ├── live.png │ │ ├── media_camera.png │ │ ├── media_film.png │ │ ├── media_mark.png │ │ ├── media_notepad.png │ │ ├── media_speech.png │ │ ├── mylocation.png │ │ ├── speedindexbar.png │ │ ├── stip.png │ │ └── stip2.png │ │ ├── drawable │ │ ├── btn_close.xml │ │ ├── ic_graph_24dp.xml │ │ ├── ic_import_24dp.xml │ │ ├── ic_layers_24dp.xml │ │ ├── ic_list_24dp.xml │ │ ├── ic_navigation_24dp.xml │ │ ├── ic_navigation_48dp.xml │ │ ├── ic_pin_drop_24dp.xml │ │ ├── ic_pin_drop_48dp.xml │ │ ├── ic_search_24dp.xml │ │ └── ic_share_24dp.xml │ │ ├── layout-land │ │ ├── graphtype.xml │ │ ├── insertnote.xml │ │ ├── layerdialog.xml │ │ ├── logcontrol.xml │ │ └── statistics.xml │ │ ├── layout │ │ ├── activity_settings.xml │ │ ├── contrib.xml │ │ ├── control_appwidget.xml │ │ ├── fragment_about.xml │ │ ├── graphtype.xml │ │ ├── insertnote.xml │ │ ├── layerdialog.xml │ │ ├── logcontrol.xml │ │ ├── map.xml │ │ ├── mediachooser.xml │ │ ├── namedialog.xml │ │ ├── notenamedialog.xml │ │ ├── notetextdialog.xml │ │ ├── savenotificationprogress.xml │ │ ├── section_header.xml │ │ ├── sharedialog.xml │ │ ├── statistics.xml │ │ ├── toolbar.xml │ │ ├── trackitem.xml │ │ └── tracklist.xml │ │ ├── values-cs-rCZ │ │ └── strings.xml │ │ ├── values-da │ │ └── strings.xml │ │ ├── values-de │ │ ├── array.xml │ │ ├── strings.xml │ │ └── units.xml │ │ ├── values-el │ │ └── strings.xml │ │ ├── values-en-rUS │ │ ├── strings.xml │ │ ├── units.xml │ │ └── units_values.xml │ │ ├── values-es │ │ ├── array.xml │ │ ├── strings.xml │ │ └── units.xml │ │ ├── values-et-rEE │ │ └── strings.xml │ │ ├── values-fi │ │ └── strings.xml │ │ ├── values-fr │ │ ├── array.xml │ │ ├── strings.xml │ │ └── units.xml │ │ ├── values-hi │ │ └── strings.xml │ │ ├── values-hu-rHU │ │ └── strings.xml │ │ ├── values-it │ │ ├── array.xml │ │ ├── strings.xml │ │ └── units.xml │ │ ├── values-iw │ │ └── strings.xml │ │ ├── values-jp-rJP │ │ └── strings.xml │ │ ├── values-ko │ │ └── strings.xml │ │ ├── values-nl │ │ ├── array.xml │ │ ├── strings.xml │ │ └── units.xml │ │ ├── values-pl │ │ ├── array.xml │ │ ├── strings.xml │ │ └── units.xml │ │ ├── values-pt-rBR │ │ └── strings.xml │ │ ├── values-ru │ │ └── strings.xml │ │ ├── values-sv │ │ └── strings.xml │ │ ├── values-tr-rTR │ │ └── strings.xml │ │ ├── values-v14 │ │ └── dimens.xml │ │ ├── values-vi │ │ └── strings.xml │ │ ├── values-zh-rCN │ │ ├── array.xml │ │ ├── strings.xml │ │ └── units.xml │ │ ├── values-zh-rTW │ │ ├── array.xml │ │ ├── strings.xml │ │ └── units.xml │ │ ├── values │ │ ├── array.xml │ │ ├── array_values.xml │ │ ├── attrs.xml │ │ ├── dimens.xml │ │ ├── donottranslate_units_values.xml │ │ ├── palette.xml │ │ ├── settings.ml.xml │ │ ├── strings.xml │ │ ├── styles.xml │ │ └── units.xml │ │ ├── xml-V24 │ │ └── settings.xml │ │ └── xml │ │ ├── control_appwidget_info.xml │ │ ├── file_paths.xml │ │ ├── searchable.xml │ │ └── settings.xml │ └── test │ └── java │ └── nl │ └── sogeti │ └── android │ └── gpstracker │ └── actions │ └── tasks │ └── XmlCreatorTest.java ├── build.gradle ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── maps-api-key.txt ├── service ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── nl │ │ └── sogeti │ │ └── android │ │ └── gpstracker │ │ └── service │ │ ├── db │ │ └── GPStrackingProviderTest.java │ │ └── logger │ │ └── GPSListenerTest.java │ └── main │ ├── AndroidManifest.xml │ ├── aidl │ └── nl │ │ └── sogeti │ │ └── android │ │ └── gpstracker │ │ └── integration │ │ └── IGPSLoggerServiceRemote.aidl │ ├── java │ └── nl │ │ └── sogeti │ │ └── android │ │ └── gpstracker │ │ ├── integration │ │ ├── ContentConstants.java │ │ ├── PermissionRequestor.java │ │ ├── ServiceConstants.java │ │ └── ServiceManager.java │ │ └── service │ │ ├── db │ │ ├── DatabaseConstants.java │ │ ├── DatabaseHelper.java │ │ └── GPStrackingProvider.java │ │ ├── linger │ │ └── LingerService.java │ │ ├── logger │ │ ├── GPSListener.java │ │ ├── GPSLoggerService.java │ │ ├── LoggerNotification.java │ │ ├── LoggerPersistence.java │ │ ├── LoggingConstants.java │ │ └── PowerManager.java │ │ └── startstop │ │ ├── BootReceiver.java │ │ ├── DockReceiver.java │ │ └── PowerReceiver.java │ └── res │ ├── drawable │ ├── ic_maps_indicator_current_position.png │ ├── ic_pause_24dp.xml │ └── ic_play_arrow_24dp.xml │ └── values │ ├── strings.xml │ └── strings_integration.xml ├── settings.gradle └── versions.gradle /.gitignore: -------------------------------------------------------------------------------- 1 | *.save 2 | 3 | studio/nohup\.out 4 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # open-gpstracker 2 | Legacy code for the Open GPS Tracker project as created for Android 1.5-2.3 This project uses Eclipse and the deprecated Google Maps for Android V1 API. 3 | 4 | Only very minor maintance will happen here. 5 | 6 | To build and run a version of this app with Google Maps loading you must have 7 | * a personal pre-depracation Map V1 API key (Adjust `map.xml`) 8 | * valid keystore to match the API key (Generate `keystore.properties` as referenced in `app/build.gradle`) 9 | * adjust the app identifier to match your V1 API key (Adjust `app/build.gradle`) 10 | 11 | 12 | Future versions of the Open GPS Tracker will be created at: 13 | https://gitlab.com/rcgroot/open-gps-tracker 14 | 15 | -------------------------------------------------------------------------------- /releases/opengpstracker-1.4.0.apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcgroot/open-gpstracker/4c5f4ddda108bcf45756e797747f94c0b25e9471/releases/opengpstracker-1.4.0.apk -------------------------------------------------------------------------------- /releases/opengpstracker-1.4.1.apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcgroot/open-gpstracker/4c5f4ddda108bcf45756e797747f94c0b25e9471/releases/opengpstracker-1.4.1.apk -------------------------------------------------------------------------------- /releases/opengpstracker-1.5.0.apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcgroot/open-gpstracker/4c5f4ddda108bcf45756e797747f94c0b25e9471/releases/opengpstracker-1.5.0.apk -------------------------------------------------------------------------------- /releases/opengpstracker-1.5.1.apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcgroot/open-gpstracker/4c5f4ddda108bcf45756e797747f94c0b25e9471/releases/opengpstracker-1.5.1.apk -------------------------------------------------------------------------------- /releases/opengpstracker-1.5.2-release.apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcgroot/open-gpstracker/4c5f4ddda108bcf45756e797747f94c0b25e9471/releases/opengpstracker-1.5.2-release.apk -------------------------------------------------------------------------------- /releases/opengpstracker-1.5.3-release.apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcgroot/open-gpstracker/4c5f4ddda108bcf45756e797747f94c0b25e9471/releases/opengpstracker-1.5.3-release.apk -------------------------------------------------------------------------------- /releases/opengpstracker-1.5.4-release.apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcgroot/open-gpstracker/4c5f4ddda108bcf45756e797747f94c0b25e9471/releases/opengpstracker-1.5.4-release.apk -------------------------------------------------------------------------------- /resources/036028-yellow-comment-bubbles-icon-culture-world1/036028-yellow-comment-bubbles-icon-culture-world1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcgroot/open-gpstracker/4c5f4ddda108bcf45756e797747f94c0b25e9471/resources/036028-yellow-comment-bubbles-icon-culture-world1/036028-yellow-comment-bubbles-icon-culture-world1.png -------------------------------------------------------------------------------- /resources/036028-yellow-comment-bubbles-icon-culture-world1/readme.txt: -------------------------------------------------------------------------------- 1 | Thanks for downloading! 2 | 3 | For licensing and FAQs please see our online readme: 4 | http://mysitemyway.com/etc-readme/ -------------------------------------------------------------------------------- /resources/PrivacyPolicy.txt: -------------------------------------------------------------------------------- 1 | This app does not share personal information unless intended or allowed by the user. Nor does it store any information other then for the function of the app. 2 | 3 | -------------------------------------------------------------------------------- /resources/ogt-pictogram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcgroot/open-gpstracker/4c5f4ddda108bcf45756e797747f94c0b25e9471/resources/ogt-pictogram.png -------------------------------------------------------------------------------- /resources/ogt-pictogram.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcgroot/open-gpstracker/4c5f4ddda108bcf45756e797747f94c0b25e9471/resources/ogt-pictogram.webp -------------------------------------------------------------------------------- /studio/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | 10 | 11 | #built application files 12 | *.apk 13 | *.ap_ 14 | 15 | # files for the dex VM 16 | *.dex 17 | 18 | # Java class files 19 | *.class 20 | 21 | # generated files 22 | bin/ 23 | gen/ 24 | 25 | # Local configuration file (sdk path, etc) 26 | local.properties 27 | 28 | # Windows thumbnail db 29 | Thumbs.db 30 | 31 | # OSX files 32 | .DS_Store 33 | 34 | # Eclipse project files 35 | .classpath 36 | .project 37 | 38 | # Android Studio 39 | *.iml 40 | .idea 41 | #.idea/workspace.xml - remove # and delete .idea if it better suit your needs. 42 | .gradle 43 | build/ 44 | 45 | keystore.properties 46 | -------------------------------------------------------------------------------- /studio/app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /studio/app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion "$rootProject.compileSdkVersion" 5 | buildToolsVersion "$rootProject.buildToolsVersion" 6 | 7 | defaultConfig { 8 | applicationId "nl.sogeti.android.gpstracker" 9 | testApplicationId "nl.sogeti.android.gpstracker.tests" 10 | minSdkVersion 15 11 | targetSdkVersion 15 12 | versionCode 1552 13 | versionName "1.5.5" 14 | buildConfigField "int", "BUILD_NUMBER", System.getenv("BUILD_NUMBER") as String ?: "0" 15 | buildConfigField "String", "GIT_COMMIT", "\"" + System.getenv("GIT_COMMIT") + "\"" as String ?: "\"Unknown\"" 16 | generatedDensities = ["hdpi", "xxhdpi"] 17 | archivesBaseName = "opengpstracker-$versionName" 18 | } 19 | 20 | if (rootProject.file("keystore.properties").exists()) { 21 | apply from: 'signing.gradle' 22 | } 23 | 24 | buildTypes { 25 | debug { 26 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 27 | } 28 | release { 29 | shrinkResources true 30 | minifyEnabled true 31 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 32 | } 33 | } 34 | 35 | compileOptions { 36 | sourceCompatibility JavaVersion.VERSION_1_7 37 | targetCompatibility JavaVersion.VERSION_1_7 38 | } 39 | 40 | lintOptions { 41 | abortOnError false 42 | } 43 | } 44 | 45 | dependencies { 46 | compile fileTree(include: ['*.jar'], dir: 'libs') 47 | compile "com.android.support:support-v4:$rootProject.supportLibraryVersion" 48 | compile "com.android.support:appcompat-v7:$rootProject.supportLibraryVersion" 49 | compile "com.android.support:preference-v7:$rootProject.supportLibraryVersion" 50 | compile "com.android.support:design:$rootProject.supportLibraryVersion" 51 | compile "com.android.support:support-annotations:$rootProject.supportLibraryVersion" 52 | compile "com.jakewharton.timber:timber:$rootProject.timberVersion" 53 | compile project(':service') 54 | testCompile "junit:junit:$rootProject.junitVersion" 55 | } 56 | -------------------------------------------------------------------------------- /studio/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /opt/rene/android-sdk-linux/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | 19 | 20 | -keep class com.google.android.maps.** {*;} 21 | -dontnote **ILicensingService 22 | -dontwarn android.support.v4.** 23 | -dontwarn org.osmdroid.** 24 | 25 | -keepattributes Signature -------------------------------------------------------------------------------- /studio/app/signing.gradle: -------------------------------------------------------------------------------- 1 | def keystorePropertiesFile = rootProject.file("keystore.properties"); 2 | def signingProperties = new Properties() 3 | signingProperties.load(new FileInputStream(keystorePropertiesFile)) 4 | 5 | android { 6 | signingConfigs { 7 | all { 8 | storeFile file(signingProperties["storeFile"]) 9 | storePassword signingProperties["storePassword"] 10 | 11 | keyAlias signingProperties["keyAlias"] 12 | keyPassword signingProperties["keyPassword"] 13 | } 14 | release { 15 | storeFile file(signingProperties["storeFile"]) 16 | storePassword signingProperties["storePassword"] 17 | 18 | keyAlias signingProperties["keyAlias"] 19 | keyPassword signingProperties["keyPassword"] 20 | } 21 | } 22 | buildTypes { 23 | release { 24 | signingConfig signingConfigs.release 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /studio/app/src/androidTest/java/nl/sogeti/android/gpstracker/ApplicationTest.java: -------------------------------------------------------------------------------- 1 | package nl.sogeti.android.gpstracker; 2 | 3 | import android.app.Application; 4 | import android.test.ApplicationTestCase; 5 | 6 | /** 7 | * Testing Fundamentals 8 | */ 9 | public class ApplicationTest extends ApplicationTestCase { 10 | public ApplicationTest() { 11 | super(Application.class); 12 | } 13 | } -------------------------------------------------------------------------------- /studio/app/src/androidTest/java/nl/sogeti/android/gpstracker/tests/GPStrackingInstrumentation.java: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------------------------ 2 | ** Ident: Innovation en Inspiration > Google Android 3 | ** Author: rene 4 | ** Copyright: (c) Jan 22, 2009 Sogeti Nederland B.V. All Rights Reserved. 5 | **------------------------------------------------------------------------------ 6 | ** Sogeti Nederland B.V. | No part of this file may be reproduced 7 | ** Distributed Software Engineering | or transmitted in any form or by any 8 | ** Lange Dreef 17 | means, electronic or mechanical, for the 9 | ** 4131 NJ Vianen | purpose, without the express written 10 | ** The Netherlands | permission of the copyright holder. 11 | *------------------------------------------------------------------------------ 12 | * 13 | * This file is part of OpenGPSTracker. 14 | * 15 | * OpenGPSTracker is free software: you can redistribute it and/or modify 16 | * it under the terms of the GNU General Public License as published by 17 | * the Free Software Foundation, either version 3 of the License, or 18 | * (at your option) any later version. 19 | * 20 | * OpenGPSTracker is distributed in the hope that it will be useful, 21 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 22 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 23 | * GNU General Public License for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License 26 | * along with OpenGPSTracker. If not, see . 27 | * 28 | */ 29 | package nl.sogeti.android.gpstracker.tests; 30 | 31 | import android.test.InstrumentationTestRunner; 32 | import android.test.InstrumentationTestSuite; 33 | 34 | import junit.framework.TestSuite; 35 | 36 | import nl.sogeti.android.gpstracker.tests.gpsmock.MockGPSLoggerServiceTest; 37 | import nl.sogeti.android.gpstracker.tests.userinterface.LoggerMapTest; 38 | 39 | /** 40 | * Perform unit tests Run on the adb shell: 41 | *

42 | *

43 |  *   am instrument -w nl.sogeti.android.gpstracker.tests/.GPStrackingInstrumentation
44 |  * 
45 | * 46 | * @author rene (c) Jan 22, 2009, Sogeti B.V. 47 | * @version $Id$ 48 | */ 49 | public class GPStrackingInstrumentation extends InstrumentationTestRunner { 50 | 51 | /** 52 | * (non-Javadoc) 53 | * 54 | * @see android.test.InstrumentationTestRunner#getAllTests() 55 | */ 56 | @Override 57 | public TestSuite getAllTests() { 58 | TestSuite suite = new InstrumentationTestSuite(this); 59 | suite.setName("GPS Tracking Testsuite"); 60 | suite.addTestSuite(MockGPSLoggerServiceTest.class); 61 | suite.addTestSuite(LoggerMapTest.class); 62 | 63 | // suite.addTestSuite( OpenGPSTrackerDemo.class ); // The demo recorded for youtube 64 | // suite.addTestSuite( MapStressTest.class ); // The stress test of the map viewer 65 | return suite; 66 | } 67 | 68 | /** 69 | * (non-Javadoc) 70 | * 71 | * @see android.test.InstrumentationTestRunner#getLoader() 72 | */ 73 | @Override 74 | public ClassLoader getLoader() { 75 | return GPStrackingInstrumentation.class.getClassLoader(); 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /studio/app/src/androidTest/java/nl/sogeti/android/gpstracker/tests/gpsmock/MockGPSLoggerServiceTest.java: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------------------------ 2 | ** Ident: Innovation en Inspiration > Google Android 3 | ** Author: rene 4 | ** Copyright: (c) Jan 22, 2009 Sogeti Nederland B.V. All Rights Reserved. 5 | **------------------------------------------------------------------------------ 6 | ** Sogeti Nederland B.V. | No part of this file may be reproduced 7 | ** Distributed Software Engineering | or transmitted in any form or by any 8 | ** Lange Dreef 17 | means, electronic or mechanical, for the 9 | ** 4131 NJ Vianen | purpose, without the express written 10 | ** The Netherlands | permission of the copyright holder. 11 | *------------------------------------------------------------------------------ 12 | * 13 | * This file is part of OpenGPSTracker. 14 | * 15 | * OpenGPSTracker is free software: you can redistribute it and/or modify 16 | * it under the terms of the GNU General Public License as published by 17 | * the Free Software Foundation, either version 3 of the License, or 18 | * (at your option) any later version. 19 | * 20 | * OpenGPSTracker is distributed in the hope that it will be useful, 21 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 22 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 23 | * GNU General Public License for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License 26 | * along with OpenGPSTracker. If not, see . 27 | * 28 | */ 29 | package nl.sogeti.android.gpstracker.tests.gpsmock; 30 | 31 | import android.test.AndroidTestCase; 32 | import android.test.suitebuilder.annotation.SmallTest; 33 | 34 | import junit.framework.Assert; 35 | 36 | import nl.sogeti.android.gpstracker.tests.R; 37 | import nl.sogeti.android.gpstracker.tests.utils.MockGPSLoggerDriver; 38 | 39 | /** 40 | * ???? 41 | * 42 | * @author rene (c) Jan 22, 2009, Sogeti B.V. 43 | * @version $Id$ 44 | */ 45 | public class MockGPSLoggerServiceTest extends AndroidTestCase { 46 | MockGPSLoggerDriver service; 47 | 48 | public MockGPSLoggerServiceTest() { 49 | this.service = new MockGPSLoggerDriver(getContext(), R.xml.denhaagdenbosch, 1000); 50 | } 51 | 52 | @SmallTest 53 | public void testGPGGACreateLocationCommand() { 54 | String command = MockGPSLoggerDriver.createGPGGALocationCommand(5.117719d, 52.096524d, 0d); 55 | Assert.assertTrue("Start of a NMEA sentence: ", command.startsWith("GPGGA")); 56 | Assert.assertTrue("Body of a NMEA sentence", command.contains("05205.791440")); 57 | } 58 | 59 | @SmallTest 60 | public void testGPRMCreateLocationCommand() { 61 | String command = MockGPSLoggerDriver.createGPRMCLocationCommand(5.117719d, 52.096524d, 0d, 0d); 62 | Assert.assertTrue("Start of a NMEA sentence: ", command.startsWith("GPRMC")); 63 | Assert.assertTrue("Body of a NMEA sentence", command.contains("05205.791440")); 64 | } 65 | 66 | @SmallTest 67 | public void testCalulateChecksum() { 68 | Assert.assertEquals("4F", MockGPSLoggerDriver.calulateChecksum("GPGGA,064746.000,4925.4895,N,00103.9255,E,1,05," + 69 | "2.1,-68.0,M,47.1,M,,0000")); 70 | Assert.assertEquals("47", MockGPSLoggerDriver.calulateChecksum("GPGGA,123519,4807.038,N,01131.000,E,1,08,0.9," + 71 | "545.4,M,46.9,M,,")); 72 | Assert.assertEquals("39", MockGPSLoggerDriver.calulateChecksum("GPRMC,120557.916,A,5058.7456,N,00647.0515,E,0" + 73 | ".00,82.33,220503,,")); 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /studio/app/src/androidTest/java/nl/sogeti/android/gpstracker/tests/perf/LoggerStressTest.java: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------------------------ 2 | ** Ident: Innovation en Inspiration > Google Android 3 | ** Author: rene 4 | ** Copyright: (c) Jan 22, 2009 Sogeti Nederland B.V. All Rights Reserved. 5 | **------------------------------------------------------------------------------ 6 | ** Sogeti Nederland B.V. | No part of this file may be reproduced 7 | ** Distributed Software Engineering | or transmitted in any form or by any 8 | ** Lange Dreef 17 | means, electronic or mechanical, for the 9 | ** 4131 NJ Vianen | purpose, without the express written 10 | ** The Netherlands | permission of the copyright holder. 11 | *------------------------------------------------------------------------------ 12 | * 13 | * This file is part of OpenGPSTracker. 14 | * 15 | * OpenGPSTracker is free software: you can redistribute it and/or modify 16 | * it under the terms of the GNU General Public License as published by 17 | * the Free Software Foundation, either version 3 of the License, or 18 | * (at your option) any later version. 19 | * 20 | * OpenGPSTracker is distributed in the hope that it will be useful, 21 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 22 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 23 | * GNU General Public License for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License 26 | * along with OpenGPSTracker. If not, see . 27 | * 28 | */ 29 | package nl.sogeti.android.gpstracker.tests.perf; 30 | 31 | import android.os.Debug; 32 | import android.test.ActivityInstrumentationTestCase2; 33 | import android.test.PerformanceTestCase; 34 | import android.test.suitebuilder.annotation.LargeTest; 35 | 36 | import nl.sogeti.android.gpstracker.tests.R; 37 | import nl.sogeti.android.gpstracker.tests.utils.MockGPSLoggerDriver; 38 | import nl.sogeti.android.gpstracker.viewer.LoggerMap; 39 | 40 | /** 41 | * Goal is to feed as the LoggerMap as many points as possible to give it a good workout. 42 | * 43 | * @author rene (c) Mar 15, 2009, Sogeti B.V. 44 | * @version $Id$ 45 | */ 46 | public class LoggerStressTest extends ActivityInstrumentationTestCase2 implements PerformanceTestCase { 47 | private static final Class CLASS = LoggerMap.class; 48 | private static final String PACKAGE = "nl.sogeti.android.gpstracker"; 49 | private Intermediates mIntermediates; 50 | 51 | public LoggerStressTest() { 52 | super(PACKAGE, CLASS); 53 | } 54 | 55 | @Override 56 | protected void setUp() throws Exception { 57 | super.setUp(); 58 | getActivity(); 59 | } 60 | 61 | protected void tearDown() throws Exception { 62 | super.tearDown(); 63 | } 64 | 65 | /** 66 | * Just pours a lot of tracking actions at the application 67 | * 68 | * @throws InterruptedException 69 | */ 70 | @LargeTest 71 | public void testLapsAroundUtrecht() throws InterruptedException { 72 | // Our data feeder to the emulator 73 | MockGPSLoggerDriver service = new MockGPSLoggerDriver(getInstrumentation().getContext(), R.xml 74 | .rondjesingelutrecht, 10); 75 | 76 | this.sendKeys("T T T T"); 77 | this.sendKeys("MENU DPAD_RIGHT T T E S T R O U T E ENTER"); 78 | this.sendKeys("ENTER"); 79 | 80 | // Start method tracing for Issue 18 81 | Debug.startMethodTracing("rondjesingelutrecht"); 82 | if (this.mIntermediates != null) { 83 | this.mIntermediates.startTiming(true); 84 | } 85 | 86 | service.run(); 87 | 88 | // Start method tracing for Issue 18 89 | if (this.mIntermediates != null) { 90 | this.mIntermediates.finishTiming(true); 91 | } 92 | Debug.stopMethodTracing(); 93 | } 94 | 95 | public int startPerformance(Intermediates intermediates) { 96 | this.mIntermediates = intermediates; 97 | return 1; 98 | } 99 | 100 | public boolean isPerformanceOnly() { 101 | return true; 102 | } 103 | } 104 | -------------------------------------------------------------------------------- /studio/app/src/androidTest/java/nl/sogeti/android/gpstracker/tests/userinterface/TrackingOverlayTest.java: -------------------------------------------------------------------------------- 1 | package nl.sogeti.android.gpstracker.tests.userinterface; 2 | 3 | import android.test.AndroidTestCase; 4 | import android.test.suitebuilder.annotation.SmallTest; 5 | 6 | import junit.framework.Assert; 7 | 8 | import nl.sogeti.android.gpstracker.viewer.SegmentOverlay; 9 | 10 | public class TrackingOverlayTest extends AndroidTestCase { 11 | 12 | 13 | @Override 14 | protected void setUp() { 15 | // mTrackingOverlay = new SegmentOverlay( getContext(), null, SegmentOverlay.DRAW_CALCULATED, 36d, null ); 16 | } 17 | 18 | @SmallTest 19 | public void testExtendDoubleNegative() { 20 | int extention = SegmentOverlay.extendPoint(-9, -4); 21 | Assert.assertEquals("Extension should be", 1, extention); 22 | } 23 | 24 | @SmallTest 25 | public void testExtendDoubleFirstNegative() { 26 | int extention = SegmentOverlay.extendPoint(-4, 9); 27 | Assert.assertEquals("Extension should be", 22, extention); 28 | } 29 | 30 | 31 | @SmallTest 32 | public void testExtendDoublePositive() { 33 | int extention = SegmentOverlay.extendPoint(9, 16); 34 | Assert.assertEquals("Extension should be", 23, extention); 35 | } 36 | 37 | @SmallTest 38 | public void testExtendDoublePositiveBack() { 39 | int extention = SegmentOverlay.extendPoint(16, 9); 40 | Assert.assertEquals("Extension should be", 2, extention); 41 | } 42 | 43 | @SmallTest 44 | public void testExtendDoubleSecondNegativeBack() { 45 | int extention = SegmentOverlay.extendPoint(9, -4); 46 | Assert.assertEquals("Extension should be", -17, extention); 47 | } 48 | 49 | @SmallTest 50 | public void testExtendDoubleNegativeBack() { 51 | int extention = SegmentOverlay.extendPoint(-4, -16); 52 | Assert.assertEquals("Extension should be", -28, extention); 53 | } 54 | 55 | } 56 | -------------------------------------------------------------------------------- /studio/app/src/androidTest/java/nl/sogeti/android/gpstracker/tests/utils/TelnetPositionSender.java: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------------------------ 2 | ** Ident: Innovation en Inspiration > Google Android 3 | ** Author: rene 4 | ** Copyright: (c) Jan 22, 2009 Sogeti Nederland B.V. All Rights Reserved. 5 | **------------------------------------------------------------------------------ 6 | ** Sogeti Nederland B.V. | No part of this file may be reproduced 7 | ** Distributed Software Engineering | or transmitted in any form or by any 8 | ** Lange Dreef 17 | means, electronic or mechanical, for the 9 | ** 4131 NJ Vianen | purpose, without the express written 10 | ** The Netherlands | permission of the copyright holder. 11 | *------------------------------------------------------------------------------ 12 | * 13 | * This file is part of OpenGPSTracker. 14 | * 15 | * OpenGPSTracker is free software: you can redistribute it and/or modify 16 | * it under the terms of the GNU General Public License as published by 17 | * the Free Software Foundation, either version 3 of the License, or 18 | * (at your option) any later version. 19 | * 20 | * OpenGPSTracker is distributed in the hope that it will be useful, 21 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 22 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 23 | * GNU General Public License for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License 26 | * along with OpenGPSTracker. If not, see . 27 | * 28 | */ 29 | package nl.sogeti.android.gpstracker.tests.utils; 30 | 31 | import android.util.Log; 32 | 33 | import java.io.IOException; 34 | import java.io.InputStream; 35 | import java.io.OutputStream; 36 | import java.net.Socket; 37 | import java.net.UnknownHostException; 38 | 39 | 40 | /** 41 | * Translates SimplePosition objects to a telnet command and sends the commands to a telnet session with an android 42 | * emulator. 43 | * 44 | * @author Bram Pouwelse (c) Jan 22, 2009, Sogeti B.V. 45 | * @version $Id$ 46 | */ 47 | public class TelnetPositionSender { 48 | private static final String TAG = "TelnetPositionSender"; 49 | 50 | private static final String TELNET_OK_FEEDBACK_MESSAGE = "OK\r\n"; 51 | private static String HOST = "10.0.2.2"; 52 | private static int PORT = 5554; 53 | 54 | private Socket socket; 55 | private OutputStream out; 56 | private InputStream in; 57 | 58 | 59 | /** 60 | * Constructor 61 | */ 62 | public TelnetPositionSender() { 63 | 64 | } 65 | 66 | /** 67 | * When a new position is received it is sent to the android emulator over the telnet connection. 68 | * 69 | * @param position the position to send 70 | */ 71 | public void sendCommand(String telnetString) { 72 | createTelnetConnection(); 73 | 74 | Log.v(TAG, "Sending command: " + telnetString); 75 | 76 | byte[] sendArray = telnetString.getBytes(); 77 | 78 | for (byte b : sendArray) { 79 | try { 80 | this.out.write(b); 81 | } catch (IOException e) { 82 | System.out.println("IOException: " + e.getMessage()); 83 | } 84 | } 85 | 86 | String feedback = readInput(); 87 | if (!feedback.equals(TELNET_OK_FEEDBACK_MESSAGE)) { 88 | System.err.println("Warning: no OK mesage message was(" + feedback + ")"); 89 | } 90 | closeConnection(); 91 | 92 | } 93 | 94 | /** 95 | * Setup a telnet connection to the android emulator 96 | */ 97 | private void createTelnetConnection() { 98 | try { 99 | this.socket = new Socket(HOST, PORT); 100 | this.in = this.socket.getInputStream(); 101 | this.out = this.socket.getOutputStream(); 102 | 103 | Thread.sleep(500); // give the telnet session half a second to 104 | // respond 105 | } catch (UnknownHostException e) { 106 | e.printStackTrace(); 107 | } catch (IOException e) { 108 | e.printStackTrace(); 109 | } catch (InterruptedException e) { 110 | e.printStackTrace(); 111 | } 112 | readInput(); // read the input to throw it away the first time :) 113 | } 114 | 115 | /** 116 | * read the input buffer 117 | * 118 | * @return 119 | */ 120 | private String readInput() { 121 | StringBuffer sb = new StringBuffer(); 122 | try { 123 | byte[] bytes = new byte[this.in.available()]; 124 | this.in.read(bytes); 125 | 126 | for (byte b : bytes) { 127 | sb.append((char) b); 128 | } 129 | } catch (Exception e) { 130 | System.err.println("Warning: Could not read the input from the telnet session"); 131 | } 132 | 133 | return sb.toString(); 134 | } 135 | 136 | private void closeConnection() { 137 | try { 138 | this.out.close(); 139 | this.in.close(); 140 | this.socket.close(); 141 | } catch (IOException e) { 142 | e.printStackTrace(); 143 | } 144 | } 145 | } -------------------------------------------------------------------------------- /studio/app/src/androidTest/java/nl/sogeti/android/gpstracker/tests/viewer/TrackListTest.java: -------------------------------------------------------------------------------- 1 | package nl.sogeti.android.gpstracker.tests.viewer; 2 | 3 | import android.test.suitebuilder.annotation.SmallTest; 4 | 5 | import junit.framework.Assert; 6 | import junit.framework.TestCase; 7 | 8 | import java.text.ParseException; 9 | 10 | import nl.sogeti.android.gpstracker.actions.tasks.GpxParser; 11 | 12 | public class TrackListTest extends TestCase { 13 | 14 | 15 | @SmallTest 16 | public void testGarminDateTime() throws ParseException { 17 | String dateTime = "2010-10-19T07:58:23.000Z"; 18 | long result = GpxParser.parseXmlDateTime(dateTime); 19 | Assert.assertEquals("Date Time test", 1287475103000l, result); 20 | } 21 | 22 | @SmallTest 23 | public void testOGTDateTime() throws ParseException { 24 | String dateTime = "2010-09-06T15:36:44Z"; 25 | long result = GpxParser.parseXmlDateTime(dateTime); 26 | Assert.assertEquals("Date Time test", 1283787404000l, result); 27 | } 28 | } -------------------------------------------------------------------------------- /studio/app/src/androidTest/res/xml/denhaagdenbosch.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /studio/app/src/main/java/nl/sogeti/android/gpstracker/Application.java: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------------------------ 2 | ** Ident: Sogeti Smart Mobile Solutions 3 | ** Author: rene 4 | ** Copyright: (c) 2015 Sogeti Nederland B.V. All Rights Reserved. 5 | **------------------------------------------------------------------------------ 6 | ** Sogeti Nederland B.V. | No part of this file may be reproduced 7 | ** Distributed Software Engineering | or transmitted in any form or by any 8 | ** Lange Dreef 17 | means, electronic or mechanical, for the 9 | ** 4131 NJ Vianen | purpose, without the express written 10 | ** The Netherlands | permission of the copyright holder. 11 | *------------------------------------------------------------------------------ 12 | * 13 | * This file is part of OpenGPSTracker. 14 | * 15 | * OpenGPSTracker is free software: you can redistribute it and/or modify 16 | * it under the terms of the GNU General Public License as published by 17 | * the Free Software Foundation, either version 3 of the License, or 18 | * (at your option) any later version. 19 | * 20 | * OpenGPSTracker is distributed in the hope that it will be useful, 21 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 22 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 23 | * GNU General Public License for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License 26 | * along with OpenGPSTracker. If not, see . 27 | * 28 | */ 29 | package nl.sogeti.android.gpstracker; 30 | 31 | import nl.sogeti.android.gpstracker.streaming.StreamUtils; 32 | import timber.log.Timber; 33 | 34 | /** 35 | * Created by rene on 27-12-15. 36 | */ 37 | public class Application extends android.app.Application { 38 | @Override 39 | public void onCreate() { 40 | super.onCreate(); 41 | if (BuildConfig.DEBUG) { 42 | Timber.plant(new Timber.DebugTree()); 43 | } 44 | StreamUtils.initStreams(this); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /studio/app/src/main/java/nl/sogeti/android/gpstracker/actions/AboutActivity.java: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------------------------ 2 | ** Ident: Sogeti Smart Mobile Solutions 3 | ** Author: rene 4 | ** Copyright: (c) 2015 Sogeti Nederland B.V. All Rights Reserved. 5 | **------------------------------------------------------------------------------ 6 | ** Sogeti Nederland B.V. | No part of this file may be reproduced 7 | ** Distributed Software Engineering | or transmitted in any form or by any 8 | ** Lange Dreef 17 | means, electronic or mechanical, for the 9 | ** 4131 NJ Vianen | purpose, without the express written 10 | ** The Netherlands | permission of the copyright holder. 11 | *------------------------------------------------------------------------------ 12 | * 13 | * This file is part of OpenGPSTracker. 14 | * 15 | * OpenGPSTracker is free software: you can redistribute it and/or modify 16 | * it under the terms of the GNU General Public License as published by 17 | * the Free Software Foundation, either version 3 of the License, or 18 | * (at your option) any later version. 19 | * 20 | * OpenGPSTracker is distributed in the hope that it will be useful, 21 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 22 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 23 | * GNU General Public License for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License 26 | * along with OpenGPSTracker. If not, see . 27 | * 28 | */ 29 | package nl.sogeti.android.gpstracker.actions; 30 | 31 | import android.content.DialogInterface; 32 | import android.os.Bundle; 33 | import android.support.annotation.Nullable; 34 | import android.support.v4.app.FragmentManager; 35 | import android.support.v7.app.AppCompatActivity; 36 | import android.support.v7.app.AppCompatDialogFragment; 37 | import android.view.LayoutInflater; 38 | import android.view.View; 39 | import android.view.ViewGroup; 40 | import android.webkit.WebView; 41 | import android.widget.Button; 42 | import android.widget.TextView; 43 | 44 | import nl.sogeti.android.gpstracker.BuildConfig; 45 | import nl.sogeti.android.gpstracker.R; 46 | 47 | import static nl.sogeti.android.gpstracker.BuildConfig.BUILD_NUMBER; 48 | import static nl.sogeti.android.gpstracker.BuildConfig.GIT_COMMIT; 49 | 50 | public class AboutActivity extends AppCompatActivity { 51 | 52 | public static final String DIALOG = "fragment_about_dialog"; 53 | 54 | @Override 55 | protected void onResume() { 56 | super.onResume(); 57 | FragmentManager fm = getSupportFragmentManager(); 58 | AboutDialogFragment aboutDialog = (AboutDialogFragment) fm.findFragmentByTag(DIALOG); 59 | if (aboutDialog == null) { 60 | aboutDialog = new AboutDialogFragment(); 61 | aboutDialog.setListener(this); 62 | aboutDialog.show(fm, DIALOG); 63 | } 64 | } 65 | 66 | public void onDismiss(AboutDialogFragment aboutDialogFragment) { 67 | finish(); 68 | } 69 | 70 | public static class AboutDialogFragment extends AppCompatDialogFragment { 71 | AboutActivity listener; 72 | 73 | public void setListener(AboutActivity listener) { 74 | this.listener = listener; 75 | } 76 | 77 | @Nullable 78 | @Override 79 | public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { 80 | getDialog().setTitle(R.string.menu_about); 81 | 82 | View view = getActivity().getLayoutInflater().inflate(R.layout.fragment_about, container, false); 83 | Button button = (Button) view.findViewById(R.id.button_ok); 84 | button.setOnClickListener(new View.OnClickListener() { 85 | @Override 86 | public void onClick(View v) { 87 | dismiss(); 88 | } 89 | }); 90 | WebView webView = (WebView) view.findViewById(R.id.fragment_about_webview); 91 | webView.loadUrl("file:///android_asset/about.html"); 92 | TextView version = (TextView) view.findViewById(R.id.fragment_about_version); 93 | if (BUILD_NUMBER > 0) { 94 | String shortHash = GIT_COMMIT.substring(0, Math.min(GIT_COMMIT.length(), 7)); 95 | version.setText(String.format("Version %s build %d", shortHash, BUILD_NUMBER)); 96 | } else { 97 | version.setText(String.format("Version %s", BuildConfig.VERSION_NAME)); 98 | } 99 | 100 | return view; 101 | } 102 | 103 | @Override 104 | public void onDismiss(DialogInterface dialog) { 105 | super.onDismiss(dialog); 106 | if (listener != null) { 107 | listener.onDismiss(this); 108 | } 109 | } 110 | } 111 | } -------------------------------------------------------------------------------- /studio/app/src/main/java/nl/sogeti/android/gpstracker/actions/tasks/ContentProviderFileExtractor.java: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------------------------ 2 | ** Ident: Delivery Center Java 3 | ** Author: rene 4 | ** Copyright: (c) 2017 Sogeti Nederland B.V. All Rights Reserved. 5 | **------------------------------------------------------------------------------ 6 | ** Sogeti Nederland B.V. | No part of this file may be reproduced 7 | ** Distributed Software Engineering | or transmitted in any form or by any 8 | ** Lange Dreef 17 | means, electronic or mechanical, for the 9 | ** 4131 NJ Vianen | purpose, without the express written 10 | ** The Netherlands | permission of the copyright holder. 11 | *------------------------------------------------------------------------------ 12 | * 13 | * This file is part of OpenGPSTracker. 14 | * 15 | * OpenGPSTracker is free software: you can redistribute it and/or modify 16 | * it under the terms of the GNU General Public License as published by 17 | * the Free Software Foundation, either version 3 of the License, or 18 | * (at your option) any later version. 19 | * 20 | * OpenGPSTracker is distributed in the hope that it will be useful, 21 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 22 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 23 | * GNU General Public License for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License 26 | * along with OpenGPSTracker. If not, see . 27 | * 28 | */ 29 | package nl.sogeti.android.gpstracker.actions.tasks; 30 | 31 | import android.content.Context; 32 | import android.net.Uri; 33 | import android.os.ParcelFileDescriptor; 34 | 35 | import java.io.BufferedInputStream; 36 | import java.io.BufferedOutputStream; 37 | import java.io.Closeable; 38 | import java.io.File; 39 | import java.io.FileInputStream; 40 | import java.io.FileOutputStream; 41 | import java.io.IOException; 42 | 43 | /** 44 | * Copies a ContentProvider file to a directory 45 | */ 46 | public class ContentProviderFileExtractor { 47 | 48 | private Context context; 49 | 50 | public ContentProviderFileExtractor(Context context) { 51 | this.context = context; 52 | } 53 | 54 | public File copyIntoDirectory(Uri source, File targetDirectory) { 55 | String fileName = source.getLastPathSegment(); 56 | File targetFile = new File(targetDirectory, fileName); 57 | ParcelFileDescriptor description = null; 58 | FileOutputStream fos = null; 59 | BufferedOutputStream bos = null; 60 | FileInputStream fis = null; 61 | BufferedInputStream bis = null; 62 | try { 63 | byte[] buffer = new byte[8192]; 64 | description = context.getContentResolver().openFileDescriptor(source, "r"); 65 | fis = new FileInputStream(description.getFileDescriptor()); 66 | bis = new BufferedInputStream(fis, 8192); 67 | fos = new FileOutputStream(targetFile); 68 | bos = new BufferedOutputStream(fos, 8192); 69 | 70 | int n; 71 | while ((n = bis.read(buffer)) != -1) { 72 | bos.write(buffer, 0, n); 73 | } 74 | } catch (IOException e) { 75 | targetFile = null; 76 | } finally { 77 | close(bos); 78 | close(bis); 79 | close(fos); 80 | close(fis); 81 | close(description); 82 | } 83 | 84 | return targetFile; 85 | } 86 | 87 | private void close(ParcelFileDescriptor description) { 88 | if (description != null) { 89 | try { 90 | description.close(); 91 | } catch (IOException e) { 92 | // Ignore 93 | } 94 | } 95 | } 96 | 97 | private void close(Closeable closeable) { 98 | if (closeable != null) { 99 | try { 100 | closeable.close(); 101 | } catch (IOException e) { 102 | // Ignore 103 | } 104 | } 105 | } 106 | } 107 | -------------------------------------------------------------------------------- /studio/app/src/main/java/nl/sogeti/android/gpstracker/actions/tasks/GpxSDCardStore.java: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------------------------ 2 | ** Ident: Delivery Center Java 3 | ** Author: rene 4 | ** Copyright: (c) 2017 Sogeti Nederland B.V. All Rights Reserved. 5 | **------------------------------------------------------------------------------ 6 | ** Sogeti Nederland B.V. | No part of this file may be reproduced 7 | ** Distributed Software Engineering | or transmitted in any form or by any 8 | ** Lange Dreef 17 | means, electronic or mechanical, for the 9 | ** 4131 NJ Vianen | purpose, without the express written 10 | ** The Netherlands | permission of the copyright holder. 11 | *------------------------------------------------------------------------------ 12 | * 13 | * This file is part of OpenGPSTracker. 14 | * 15 | * OpenGPSTracker is free software: you can redistribute it and/or modify 16 | * it under the terms of the GNU General Public License as published by 17 | * the Free Software Foundation, either version 3 of the License, or 18 | * (at your option) any later version. 19 | * 20 | * OpenGPSTracker is distributed in the hope that it will be useful, 21 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 22 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 23 | * GNU General Public License for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License 26 | * along with OpenGPSTracker. If not, see . 27 | * 28 | */ 29 | package nl.sogeti.android.gpstracker.actions.tasks; 30 | 31 | import android.content.Context; 32 | import android.content.Intent; 33 | import android.media.MediaScannerConnection; 34 | import android.net.Uri; 35 | import android.widget.Toast; 36 | 37 | import java.io.File; 38 | 39 | import nl.sogeti.android.gpstracker.actions.utils.ProgressListener; 40 | import nl.sogeti.android.gpstracker.util.Constants; 41 | 42 | public class GpxSDCardStore extends GpxCreator { 43 | 44 | public GpxSDCardStore(Context context, Uri trackUri, String chosenBaseFileName, boolean attachments, ProgressListener 45 | listener) { 46 | super(context, trackUri, chosenBaseFileName, attachments, listener); 47 | } 48 | 49 | @Override 50 | protected Uri doInBackground(Void... params) { 51 | Uri contentUri = super.doInBackground(params); 52 | ContentProviderFileExtractor contentProviderFileExtractor = new ContentProviderFileExtractor(mContext); 53 | File targetDirectory = Constants.getExternalRootDataFolder(mContext); 54 | Uri resultFileUri; 55 | if (contentUri.getScheme() == "file") { 56 | resultFileUri = contentUri; 57 | } else { 58 | File sdcardFile = contentProviderFileExtractor.copyIntoDirectory(contentUri, targetDirectory); 59 | resultFileUri = Uri.fromFile(sdcardFile); 60 | 61 | MediaScannerConnection.scanFile(mContext, new String[]{sdcardFile.getPath()}, null, null); 62 | mContext.sendBroadcast(new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE, resultFileUri)); 63 | } 64 | 65 | return resultFileUri; 66 | } 67 | 68 | @Override 69 | protected void onPostExecute(Uri resultFilename) { 70 | super.onPostExecute(resultFilename); 71 | Toast.makeText(mContext, resultFilename.getPath(), Toast.LENGTH_LONG).show(); 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /studio/app/src/main/java/nl/sogeti/android/gpstracker/actions/tasks/GpxSharing.java: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------------------------ 2 | ** Ident: Delivery Center Java 3 | ** Author: rene 4 | ** Copyright: (c) Jul 9, 2011 Sogeti Nederland B.V. All Rights Reserved. 5 | **------------------------------------------------------------------------------ 6 | ** Sogeti Nederland B.V. | No part of this file may be reproduced 7 | ** Distributed Software Engineering | or transmitted in any form or by any 8 | ** Lange Dreef 17 | means, electronic or mechanical, for the 9 | ** 4131 NJ Vianen | purpose, without the express written 10 | ** The Netherlands | permission of the copyright holder. 11 | *------------------------------------------------------------------------------ 12 | * 13 | * This file is part of OpenGPSTracker. 14 | * 15 | * OpenGPSTracker is free software: you can redistribute it and/or modify 16 | * it under the terms of the GNU General Public License as published by 17 | * the Free Software Foundation, either version 3 of the License, or 18 | * (at your option) any later version. 19 | * 20 | * OpenGPSTracker is distributed in the hope that it will be useful, 21 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 22 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 23 | * GNU General Public License for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License 26 | * along with OpenGPSTracker. If not, see . 27 | * 28 | */ 29 | package nl.sogeti.android.gpstracker.actions.tasks; 30 | 31 | import android.content.Context; 32 | import android.net.Uri; 33 | 34 | import nl.sogeti.android.gpstracker.R; 35 | import nl.sogeti.android.gpstracker.actions.ShareTrack; 36 | import nl.sogeti.android.gpstracker.actions.utils.ProgressListener; 37 | 38 | public class GpxSharing extends GpxCreator { 39 | 40 | 41 | public GpxSharing(Context context, Uri trackUri, String chosenBaseFileName, boolean attachments, ProgressListener 42 | listener) { 43 | super(context, trackUri, chosenBaseFileName, attachments, listener); 44 | } 45 | 46 | @Override 47 | protected void onPostExecute(Uri resultFilename) { 48 | super.onPostExecute(resultFilename); 49 | ShareTrack.sendFile(mContext, resultFilename, getContentType(), mContext.getString(R.string.email_gpxbody)); 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /studio/app/src/main/java/nl/sogeti/android/gpstracker/actions/tasks/KmzSDCardStore.java: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------------------------ 2 | ** Ident: Delivery Center Java 3 | ** Author: rene 4 | ** Copyright: (c) Jul 9, 2011 Sogeti Nederland B.V. All Rights Reserved. 5 | **------------------------------------------------------------------------------ 6 | ** Sogeti Nederland B.V. | No part of this file may be reproduced 7 | ** Distributed Software Engineering | or transmitted in any form or by any 8 | ** Lange Dreef 17 | means, electronic or mechanical, for the 9 | ** 4131 NJ Vianen | purpose, without the express written 10 | ** The Netherlands | permission of the copyright holder. 11 | *------------------------------------------------------------------------------ 12 | * 13 | * This file is part of OpenGPSTracker. 14 | * 15 | * OpenGPSTracker is free software: you can redistribute it and/or modify 16 | * it under the terms of the GNU General Public License as published by 17 | * the Free Software Foundation, either version 3 of the License, or 18 | * (at your option) any later version. 19 | * 20 | * OpenGPSTracker is distributed in the hope that it will be useful, 21 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 22 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 23 | * GNU General Public License for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License 26 | * along with OpenGPSTracker. If not, see . 27 | * 28 | */ 29 | package nl.sogeti.android.gpstracker.actions.tasks; 30 | 31 | import android.content.Context; 32 | import android.content.Intent; 33 | import android.media.MediaScannerConnection; 34 | import android.net.Uri; 35 | import android.widget.Toast; 36 | 37 | import java.io.File; 38 | 39 | import nl.sogeti.android.gpstracker.actions.utils.ProgressListener; 40 | import nl.sogeti.android.gpstracker.util.Constants; 41 | 42 | /** 43 | * ???? 44 | * 45 | * @author rene (c) Jul 9, 2011, Sogeti B.V. 46 | * @version $Id:$ 47 | */ 48 | public class KmzSDCardStore extends KmzCreator { 49 | 50 | public KmzSDCardStore(Context context, Uri trackUri, String chosenFileName, ProgressListener listener) { 51 | super(context, trackUri, chosenFileName, listener); 52 | } 53 | 54 | @Override 55 | protected Uri doInBackground(Void... params) { 56 | Uri contentUri = super.doInBackground(params); 57 | ContentProviderFileExtractor contentProviderFileExtractor = new ContentProviderFileExtractor(mContext); 58 | File targetDirectory = Constants.getExternalRootDataFolder(mContext); 59 | Uri resultFileUri; 60 | if (contentUri.getScheme() == "file") { 61 | resultFileUri = contentUri; 62 | } else { 63 | File sdcardFile = contentProviderFileExtractor.copyIntoDirectory(contentUri, targetDirectory); 64 | resultFileUri = Uri.fromFile(sdcardFile); 65 | 66 | MediaScannerConnection.scanFile(mContext, new String[]{sdcardFile.getPath()}, null, null); 67 | mContext.sendBroadcast(new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE, resultFileUri)); 68 | } 69 | 70 | return resultFileUri; 71 | } 72 | 73 | @Override 74 | protected void onPostExecute(Uri resultFilename) { 75 | super.onPostExecute(resultFilename); 76 | Toast.makeText(mContext, resultFilename.getPath(), Toast.LENGTH_LONG).show(); 77 | } 78 | 79 | } 80 | -------------------------------------------------------------------------------- /studio/app/src/main/java/nl/sogeti/android/gpstracker/actions/tasks/KmzSharing.java: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------------------------ 2 | ** Ident: Delivery Center Java 3 | ** Author: rene 4 | ** Copyright: (c) Jul 9, 2011 Sogeti Nederland B.V. All Rights Reserved. 5 | **------------------------------------------------------------------------------ 6 | ** Sogeti Nederland B.V. | No part of this file may be reproduced 7 | ** Distributed Software Engineering | or transmitted in any form or by any 8 | ** Lange Dreef 17 | means, electronic or mechanical, for the 9 | ** 4131 NJ Vianen | purpose, without the express written 10 | ** The Netherlands | permission of the copyright holder. 11 | *------------------------------------------------------------------------------ 12 | * 13 | * This file is part of OpenGPSTracker. 14 | * 15 | * OpenGPSTracker is free software: you can redistribute it and/or modify 16 | * it under the terms of the GNU General Public License as published by 17 | * the Free Software Foundation, either version 3 of the License, or 18 | * (at your option) any later version. 19 | * 20 | * OpenGPSTracker is distributed in the hope that it will be useful, 21 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 22 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 23 | * GNU General Public License for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License 26 | * along with OpenGPSTracker. If not, see . 27 | * 28 | */ 29 | package nl.sogeti.android.gpstracker.actions.tasks; 30 | 31 | import android.content.Context; 32 | import android.net.Uri; 33 | 34 | import nl.sogeti.android.gpstracker.R; 35 | import nl.sogeti.android.gpstracker.actions.ShareTrack; 36 | import nl.sogeti.android.gpstracker.actions.utils.ProgressListener; 37 | 38 | /** 39 | * ???? 40 | * 41 | * @author rene (c) Jul 9, 2011, Sogeti B.V. 42 | * @version $Id:$ 43 | */ 44 | public class KmzSharing extends KmzCreator { 45 | 46 | public KmzSharing(Context context, Uri trackUri, String chosenFileName, ProgressListener listener) { 47 | super(context, trackUri, chosenFileName, listener); 48 | } 49 | 50 | @Override 51 | protected void onPostExecute(Uri resultFilename) { 52 | super.onPostExecute(resultFilename); 53 | ShareTrack.sendFile(mContext, resultFilename, getContentType(), mContext.getString(R.string.email_kmzbody)); 54 | } 55 | 56 | } 57 | -------------------------------------------------------------------------------- /studio/app/src/main/java/nl/sogeti/android/gpstracker/actions/utils/ProgressListener.java: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------------------------ 2 | ** Ident: Sogeti Smart Mobile Solutions 3 | ** Author: rene 4 | ** Copyright: (c) Apr 24, 2011 Sogeti Nederland B.V. All Rights Reserved. 5 | **------------------------------------------------------------------------------ 6 | ** Sogeti Nederland B.V. | No part of this file may be reproduced 7 | ** Distributed Software Engineering | or transmitted in any form or by any 8 | ** Lange Dreef 17 | means, electronic or mechanical, for the 9 | ** 4131 NJ Vianen | purpose, without the express written 10 | ** The Netherlands | permission of the copyright holder. 11 | *------------------------------------------------------------------------------ 12 | * 13 | * This file is part of OpenGPSTracker. 14 | * 15 | * OpenGPSTracker is free software: you can redistribute it and/or modify 16 | * it under the terms of the GNU General Public License as published by 17 | * the Free Software Foundation, either version 3 of the License, or 18 | * (at your option) any later version. 19 | * 20 | * OpenGPSTracker is distributed in the hope that it will be useful, 21 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 22 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 23 | * GNU General Public License for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License 26 | * along with OpenGPSTracker. If not, see . 27 | * 28 | */ 29 | package nl.sogeti.android.gpstracker.actions.utils; 30 | 31 | import android.app.Activity; 32 | import android.net.Uri; 33 | 34 | /** 35 | * Interface to which a Activity / Context can conform to receive progress 36 | * updates from async tasks 37 | * 38 | * @author rene (c) May 29, 2011, Sogeti B.V. 39 | * @version $Id:$ 40 | */ 41 | public interface ProgressListener { 42 | void setIndeterminate(boolean indeterminate); 43 | 44 | /** 45 | * Signifies the start of background task, will be followed by setProgress(int) calls. 46 | */ 47 | void started(); 48 | 49 | /** 50 | * Set the progress on the scale of 0...10000 51 | * 52 | * @param value 53 | * @see Activity.setProgress 54 | * @see Window.PROGRESS_END 55 | */ 56 | void setProgress(int value); 57 | 58 | /** 59 | * Signifies end of background task and the location of the result 60 | * 61 | * @param result 62 | */ 63 | void finished(Uri result); 64 | 65 | void showError(String task, String errorMessage, Exception exception); 66 | } 67 | -------------------------------------------------------------------------------- /studio/app/src/main/java/nl/sogeti/android/gpstracker/actions/utils/StatisticsDelegate.java: -------------------------------------------------------------------------------- 1 | package nl.sogeti.android.gpstracker.actions.utils; 2 | 3 | public interface StatisticsDelegate { 4 | void finishedCalculations(StatisticsCalulator calculated); 5 | } -------------------------------------------------------------------------------- /studio/app/src/main/java/nl/sogeti/android/gpstracker/actions/utils/ViewFlipper.java: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------------------------ 2 | ** Ident: Sogeti Smart Mobile Solutions 3 | ** Author: rene 4 | ** Copyright: (c) Apr 24, 2011 Sogeti Nederland B.V. All Rights Reserved. 5 | **------------------------------------------------------------------------------ 6 | ** Sogeti Nederland B.V. | No part of this file may be reproduced 7 | ** Distributed Software Engineering | or transmitted in any form or by any 8 | ** Lange Dreef 17 | means, electronic or mechanical, for the 9 | ** 4131 NJ Vianen | purpose, without the express written 10 | ** The Netherlands | permission of the copyright holder. 11 | *------------------------------------------------------------------------------ 12 | * 13 | * This file is part of OpenGPSTracker. 14 | * 15 | * OpenGPSTracker is free software: you can redistribute it and/or modify 16 | * it under the terms of the GNU General Public License as published by 17 | * the Free Software Foundation, either version 3 of the License, or 18 | * (at your option) any later version. 19 | * 20 | * OpenGPSTracker is distributed in the hope that it will be useful, 21 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 22 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 23 | * GNU General Public License for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License 26 | * along with OpenGPSTracker. If not, see . 27 | * 28 | */ 29 | package nl.sogeti.android.gpstracker.actions.utils; 30 | 31 | import android.content.Context; 32 | import android.os.Build; 33 | import android.util.AttributeSet; 34 | 35 | import timber.log.Timber; 36 | 37 | /** 38 | * Work around based on input from the comment section of 39 | * Issue 6191 41 | * 42 | * @author rene (c) May 8, 2010, Sogeti B.V. 43 | * @version $Id$ 44 | */ 45 | public class ViewFlipper extends android.widget.ViewFlipper { 46 | public ViewFlipper(Context context) { 47 | super(context); 48 | } 49 | 50 | public ViewFlipper(Context context, AttributeSet attrs) { 51 | super(context, attrs); 52 | } 53 | 54 | /** 55 | * On api level 7 unexpected exception occur during orientation switching. 56 | * These are java.lang.IllegalArgumentException: Receiver not registered: android.widget.ViewFlipper$id 57 | * exceptions. On level 7, 8 and 9 devices these are ignored. 58 | */ 59 | @Override 60 | protected void onDetachedFromWindow() { 61 | if (Build.VERSION.SDK_INT > 7) { 62 | try { 63 | super.onDetachedFromWindow(); 64 | } catch (IllegalArgumentException e) { 65 | Timber.w("Android project issue 6191 workaround."); 66 | /* Quick catch and continue on api level 7+, the Eclair 2.1 / 2.2 */ 67 | } finally { 68 | super.stopFlipping(); 69 | } 70 | } else { 71 | super.onDetachedFromWindow(); 72 | } 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /studio/app/src/main/java/nl/sogeti/android/gpstracker/settings/Helper.java: -------------------------------------------------------------------------------- 1 | package nl.sogeti.android.gpstracker.settings; 2 | 3 | public class Helper { 4 | 5 | public static final String BROADCAST_STREAM = "STREAM_ENABLED"; 6 | public static final String PRECISION_PREFERENCE = "precision"; 7 | public static final String CUSTOMPRECISIONTIME_PREFERENCE = "customprecisiontime"; 8 | public static final String CUSTOMPRECISIONDISTANCE_PREFERENCE = "customprecisiondistance"; 9 | 10 | public static final String BROADCAST_STREAM_TIME = "streambroadcast_time"; 11 | public static final String BROADCAST_STREAM_DISTANCE_METER = "streambroadcast_distance_meter_string"; 12 | public static final String CUSTOM_UPLOAD_BACKLOG = "CUSTOMUPLOAD_BACKLOG"; 13 | } 14 | -------------------------------------------------------------------------------- /studio/app/src/main/java/nl/sogeti/android/gpstracker/settings/SettingsFragment.java: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------------------------ 2 | ** Ident: Sogeti Smart Mobile Solutions 3 | ** Author: rene 4 | ** Copyright: (c) 2015 Sogeti Nederland B.V. All Rights Reserved. 5 | **------------------------------------------------------------------------------ 6 | ** Sogeti Nederland B.V. | No part of this file may be reproduced 7 | ** Distributed Software Engineering | or transmitted in any form or by any 8 | ** Lange Dreef 17 | means, electronic or mechanical, for the 9 | ** 4131 NJ Vianen | purpose, without the express written 10 | ** The Netherlands | permission of the copyright holder. 11 | *------------------------------------------------------------------------------ 12 | * 13 | * This file is part of OpenGPSTracker. 14 | * 15 | * OpenGPSTracker is free software: you can redistribute it and/or modify 16 | * it under the terms of the GNU General Public License as published by 17 | * the Free Software Foundation, either version 3 of the License, or 18 | * (at your option) any later version. 19 | * 20 | * OpenGPSTracker is distributed in the hope that it will be useful, 21 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 22 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 23 | * GNU General Public License for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License 26 | * along with OpenGPSTracker. If not, see . 27 | * 28 | */ 29 | package nl.sogeti.android.gpstracker.settings; 30 | 31 | import android.os.Bundle; 32 | import android.support.v7.preference.EditTextPreference; 33 | import android.support.v7.preference.ListPreference; 34 | import android.support.v7.preference.Preference; 35 | import android.support.v7.preference.PreferenceFragmentCompat; 36 | 37 | import java.util.regex.Pattern; 38 | 39 | import nl.sogeti.android.gpstracker.R; 40 | import nl.sogeti.android.gpstracker.integration.ServiceConstants; 41 | 42 | public class SettingsFragment extends PreferenceFragmentCompat { 43 | 44 | private EditTextPreference time; 45 | private EditTextPreference distance; 46 | private EditTextPreference streambroadcast_distance; 47 | private EditTextPreference streambroadcast_time; 48 | private EditTextPreference custumupload_backlog; 49 | 50 | @Override 51 | public void onCreatePreferences(Bundle bundle, String s) { 52 | addPreferencesFromResource(R.xml.settings); 53 | 54 | ListPreference precision = (ListPreference) findPreference(Helper.PRECISION_PREFERENCE); 55 | time = (EditTextPreference) findPreference(Helper.CUSTOMPRECISIONTIME_PREFERENCE); 56 | distance = (EditTextPreference) findPreference(Helper.CUSTOMPRECISIONDISTANCE_PREFERENCE); 57 | streambroadcast_distance = (EditTextPreference) findPreference(Helper.BROADCAST_STREAM_DISTANCE_METER); 58 | streambroadcast_time = (EditTextPreference) findPreference(Helper.BROADCAST_STREAM_TIME); 59 | custumupload_backlog = (EditTextPreference) findPreference(Helper.CUSTOM_UPLOAD_BACKLOG); 60 | setEnabledCustomValues(precision.getValue()); 61 | precision.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() { 62 | @Override 63 | public boolean onPreferenceChange(Preference preference, Object newValue) { 64 | setEnabledCustomValues(newValue); 65 | return true; 66 | } 67 | }); 68 | Preference.OnPreferenceChangeListener fiveDigits = new Preference.OnPreferenceChangeListener() { 69 | @Override 70 | public boolean onPreferenceChange(Preference preference, Object newValue) { 71 | String fpExpr = "\\d{1,5}"; 72 | return Pattern.matches(fpExpr, newValue.toString()); 73 | } 74 | }; 75 | Preference.OnPreferenceChangeListener twentyOneDigits = new Preference.OnPreferenceChangeListener() { 76 | @Override 77 | public boolean onPreferenceChange(Preference preference, Object newValue) { 78 | String fpExpr = "\\d{1,21}"; 79 | return Pattern.matches(fpExpr, newValue.toString()); 80 | } 81 | }; 82 | Preference.OnPreferenceChangeListener threeDigits = new Preference.OnPreferenceChangeListener() { 83 | @Override 84 | public boolean onPreferenceChange(Preference preference, Object newValue) { 85 | String fpExpr = "\\d{1,3}"; 86 | return Pattern.matches(fpExpr, newValue.toString()); 87 | } 88 | }; 89 | 90 | time.setOnPreferenceChangeListener(fiveDigits); 91 | distance.setOnPreferenceChangeListener(fiveDigits); 92 | streambroadcast_distance.setOnPreferenceChangeListener(fiveDigits); 93 | streambroadcast_time.setOnPreferenceChangeListener(twentyOneDigits); 94 | custumupload_backlog.setOnPreferenceChangeListener(threeDigits); 95 | } 96 | 97 | private void setEnabledCustomValues(Object newValue) { 98 | boolean customPrecision = Integer.toString(ServiceConstants.LOGGING_CUSTOM).equals(newValue); 99 | time.setEnabled(customPrecision); 100 | distance.setEnabled(customPrecision); 101 | } 102 | } -------------------------------------------------------------------------------- /studio/app/src/main/java/nl/sogeti/android/gpstracker/streaming/StreamUtils.java: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------------------------ 2 | ** Ident: Sogeti Smart Mobile Solutions 3 | ** Author: rene 4 | ** Copyright: (c) Apr 24, 2011 Sogeti Nederland B.V. All Rights Reserved. 5 | **------------------------------------------------------------------------------ 6 | ** Sogeti Nederland B.V. | No part of this file may be reproduced 7 | ** Distributed Software Engineering | or transmitted in any form or by any 8 | ** Lange Dreef 17 | means, electronic or mechanical, for the 9 | ** 4131 NJ Vianen | purpose, without the express written 10 | ** The Netherlands | permission of the copyright holder. 11 | *------------------------------------------------------------------------------ 12 | * 13 | * This file is part of OpenGPSTracker. 14 | * 15 | * OpenGPSTracker is free software: you can redistribute it and/or modify 16 | * it under the terms of the GNU General Public License as published by 17 | * the Free Software Foundation, either version 3 of the License, or 18 | * (at your option) any later version. 19 | * 20 | * OpenGPSTracker is distributed in the hope that it will be useful, 21 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 22 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 23 | * GNU General Public License for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License 26 | * along with OpenGPSTracker. If not, see . 27 | * 28 | */ 29 | package nl.sogeti.android.gpstracker.streaming; 30 | 31 | import android.content.Context; 32 | import android.content.SharedPreferences; 33 | import android.preference.PreferenceManager; 34 | 35 | import nl.sogeti.android.gpstracker.settings.Helper; 36 | import timber.log.Timber; 37 | 38 | 39 | public class StreamUtils { 40 | /** 41 | * Initialize all appropriate stream listeners 42 | * 43 | * @param ctx 44 | */ 45 | public static void initStreams(final Context ctx) { 46 | Timber.d("initStreams(Context)"); 47 | SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(ctx); 48 | boolean streams_enabled = sharedPreferences.getBoolean(Helper.BROADCAST_STREAM, false); 49 | if (streams_enabled && sharedPreferences.getBoolean("VOICEOVER_ENABLED", false)) { 50 | VoiceOver.initStreaming(ctx); 51 | } else { 52 | VoiceOver.shutdownStreaming(ctx); 53 | } 54 | if (streams_enabled && sharedPreferences.getBoolean("CUSTOMUPLOAD_ENABLED", false)) { 55 | CustomUpload.initStreaming(ctx); 56 | } else { 57 | CustomUpload.shutdownStreaming(ctx); 58 | } 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /studio/app/src/main/java/nl/sogeti/android/gpstracker/streaming/VoiceOver.java: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------------------------ 2 | ** Ident: Sogeti Smart Mobile Solutions 3 | ** Author: rene 4 | ** Copyright: (c) Apr 24, 2011 Sogeti Nederland B.V. All Rights Reserved. 5 | **------------------------------------------------------------------------------ 6 | ** Sogeti Nederland B.V. | No part of this file may be reproduced 7 | ** Distributed Software Engineering | or transmitted in any form or by any 8 | ** Lange Dreef 17 | means, electronic or mechanical, for the 9 | ** 4131 NJ Vianen | purpose, without the express written 10 | ** The Netherlands | permission of the copyright holder. 11 | *------------------------------------------------------------------------------ 12 | * 13 | * This file is part of OpenGPSTracker. 14 | * 15 | * OpenGPSTracker is free software: you can redistribute it and/or modify 16 | * it under the terms of the GNU General Public License as published by 17 | * the Free Software Foundation, either version 3 of the License, or 18 | * (at your option) any later version. 19 | * 20 | * OpenGPSTracker is distributed in the hope that it will be useful, 21 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 22 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 23 | * GNU General Public License for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License 26 | * along with OpenGPSTracker. If not, see . 27 | * 28 | */ 29 | package nl.sogeti.android.gpstracker.streaming; 30 | 31 | import android.content.BroadcastReceiver; 32 | import android.content.Context; 33 | import android.content.Intent; 34 | import android.content.IntentFilter; 35 | import android.speech.tts.TextToSpeech; 36 | 37 | import nl.sogeti.android.gpstracker.integration.ServiceConstants; 38 | import nl.sogeti.android.gpstracker.service.R; 39 | import timber.log.Timber; 40 | 41 | public class VoiceOver extends BroadcastReceiver implements TextToSpeech.OnInitListener { 42 | private static VoiceOver sVoiceOver = null; 43 | private TextToSpeech mTextToSpeech; 44 | private int mVoiceStatus = -1; 45 | private Context mContext; 46 | 47 | public VoiceOver(Context ctx) { 48 | mContext = ctx.getApplicationContext(); 49 | mTextToSpeech = new TextToSpeech(mContext, this); 50 | } 51 | 52 | public static synchronized void initStreaming(Context ctx) { 53 | if (sVoiceOver != null) { 54 | shutdownStreaming(ctx); 55 | } 56 | sVoiceOver = new VoiceOver(ctx); 57 | 58 | IntentFilter filter = new IntentFilter(ServiceConstants.STREAM_BROADCAST); 59 | ctx.registerReceiver(sVoiceOver, filter); 60 | } 61 | 62 | public static synchronized void shutdownStreaming(Context ctx) { 63 | if (sVoiceOver != null) { 64 | ctx.unregisterReceiver(sVoiceOver); 65 | sVoiceOver.onShutdown(); 66 | sVoiceOver = null; 67 | } 68 | } 69 | 70 | private void onShutdown() { 71 | mVoiceStatus = -1; 72 | mTextToSpeech.shutdown(); 73 | } 74 | 75 | @Override 76 | public void onInit(int status) { 77 | mVoiceStatus = status; 78 | } 79 | 80 | @Override 81 | public void onReceive(Context context, Intent intent) { 82 | if (mVoiceStatus == TextToSpeech.SUCCESS) { 83 | int meters = intent.getIntExtra(ServiceConstants.EXTRA_DISTANCE, 0); 84 | int minutes = intent.getIntExtra(ServiceConstants.EXTRA_TIME, 0); 85 | String myText = context.getString(R.string.voiceover_speaking, minutes, meters); 86 | if (!mTextToSpeech.isSpeaking()) { 87 | mTextToSpeech.speak(myText, TextToSpeech.QUEUE_ADD, null); 88 | } 89 | } else { 90 | Timber.w("Voice stream failed TTS not ready"); 91 | } 92 | } 93 | } -------------------------------------------------------------------------------- /studio/app/src/main/java/nl/sogeti/android/gpstracker/util/DateView.java: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------------------------ 2 | ** Ident: Sogeti Smart Mobile Solutions 3 | ** Author: rene 4 | ** Copyright: (c) Apr 24, 2011 Sogeti Nederland B.V. All Rights Reserved. 5 | **------------------------------------------------------------------------------ 6 | ** Sogeti Nederland B.V. | No part of this file may be reproduced 7 | ** Distributed Software Engineering | or transmitted in any form or by any 8 | ** Lange Dreef 17 | means, electronic or mechanical, for the 9 | ** 4131 NJ Vianen | purpose, without the express written 10 | ** The Netherlands | permission of the copyright holder. 11 | *------------------------------------------------------------------------------ 12 | * 13 | * This file is part of OpenGPSTracker. 14 | * 15 | * OpenGPSTracker is free software: you can redistribute it and/or modify 16 | * it under the terms of the GNU General Public License as published by 17 | * the Free Software Foundation, either version 3 of the License, or 18 | * (at your option) any later version. 19 | * 20 | * OpenGPSTracker is distributed in the hope that it will be useful, 21 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 22 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 23 | * GNU General Public License for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License 26 | * along with OpenGPSTracker. If not, see . 27 | * 28 | */ 29 | package nl.sogeti.android.gpstracker.util; 30 | 31 | import android.content.Context; 32 | import android.util.AttributeSet; 33 | import android.widget.TextView; 34 | 35 | import java.text.DateFormat; 36 | import java.util.Date; 37 | 38 | /** 39 | * An implementation for the XML element DateView that alters the textview in the 40 | * formating of the text when displaying a date in ms from 1970. 41 | * 42 | * @author rene (c) Jan 22, 2009, Sogeti B.V. 43 | * @version $Id$ 44 | */ 45 | public class DateView extends TextView { 46 | private Date mDate; 47 | 48 | /** 49 | * Constructor: create a new DateView. 50 | * 51 | * @param context 52 | */ 53 | public DateView(Context context) { 54 | super(context); 55 | } 56 | 57 | /** 58 | * Constructor: create a new DateView. 59 | * 60 | * @param context 61 | * @param attrs 62 | */ 63 | public DateView(Context context, AttributeSet attrs) { 64 | super(context, attrs); 65 | } 66 | 67 | /** 68 | * Constructor: create a new DateView. 69 | * 70 | * @param context 71 | * @param attrs 72 | * @param defStyle 73 | */ 74 | public DateView(Context context, AttributeSet attrs, int defStyle) { 75 | super(context, attrs, defStyle); 76 | } 77 | 78 | /* 79 | * (non-Javadoc) 80 | * @see android.widget.TextView#setText(java.lang.CharSequence, android.widget.TextView.BufferType) 81 | */ 82 | @Override 83 | public void setText(CharSequence charSeq, BufferType type) { 84 | // Behavior for the graphical editor 85 | if (this.isInEditMode()) { 86 | super.setText(charSeq, type); 87 | return; 88 | } 89 | 90 | 91 | long longVal; 92 | if (charSeq.length() == 0) { 93 | longVal = 0l; 94 | } else { 95 | try { 96 | longVal = Long.parseLong(charSeq.toString()); 97 | } catch (NumberFormatException e) { 98 | longVal = 0l; 99 | } 100 | } 101 | this.mDate = new Date(longVal); 102 | 103 | DateFormat dateFormat = android.text.format.DateFormat.getLongDateFormat(this.getContext() 104 | .getApplicationContext()); 105 | DateFormat timeFormat = android.text.format.DateFormat.getTimeFormat(this.getContext().getApplicationContext()); 106 | String text = timeFormat.format(this.mDate) + " " + dateFormat.format(mDate); 107 | super.setText(text, type); 108 | } 109 | 110 | } 111 | -------------------------------------------------------------------------------- /studio/app/src/main/java/nl/sogeti/android/gpstracker/util/ProgressFilterInputStream.java: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------------------------ 2 | ** Ident: Sogeti Smart Mobile Solutions 3 | ** Author: rene 4 | ** Copyright: (c) Apr 24, 2011 Sogeti Nederland B.V. All Rights Reserved. 5 | **------------------------------------------------------------------------------ 6 | ** Sogeti Nederland B.V. | No part of this file may be reproduced 7 | ** Distributed Software Engineering | or transmitted in any form or by any 8 | ** Lange Dreef 17 | means, electronic or mechanical, for the 9 | ** 4131 NJ Vianen | purpose, without the express written 10 | ** The Netherlands | permission of the copyright holder. 11 | *------------------------------------------------------------------------------ 12 | * 13 | * This file is part of OpenGPSTracker. 14 | * 15 | * OpenGPSTracker is free software: you can redistribute it and/or modify 16 | * it under the terms of the GNU General Public License as published by 17 | * the Free Software Foundation, either version 3 of the License, or 18 | * (at your option) any later version. 19 | * 20 | * OpenGPSTracker is distributed in the hope that it will be useful, 21 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 22 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 23 | * GNU General Public License for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License 26 | * along with OpenGPSTracker. If not, see . 27 | * 28 | */ 29 | package nl.sogeti.android.gpstracker.util; 30 | 31 | import java.io.FilterInputStream; 32 | import java.io.IOException; 33 | import java.io.InputStream; 34 | 35 | import nl.sogeti.android.gpstracker.actions.tasks.GpxParser; 36 | import nl.sogeti.android.gpstracker.actions.tasks.GpxParser.ProgressAdmin; 37 | 38 | /** 39 | * ???? 40 | * 41 | * @author rene (c) Dec 11, 2010, Sogeti B.V. 42 | * @version $Id$ 43 | */ 44 | public class ProgressFilterInputStream extends FilterInputStream { 45 | GpxParser mAsyncTask; 46 | long progress = 0; 47 | private ProgressAdmin mProgressAdmin; 48 | 49 | public ProgressFilterInputStream(InputStream is, ProgressAdmin progressAdmin) { 50 | super(is); 51 | mProgressAdmin = progressAdmin; 52 | } 53 | 54 | @Override 55 | public int read() throws IOException { 56 | int read = super.read(); 57 | incrementProgressBy(1); 58 | return read; 59 | } 60 | 61 | @Override 62 | public int read(byte[] buffer, int offset, int count) throws IOException { 63 | int read = super.read(buffer, offset, count); 64 | incrementProgressBy(read); 65 | return read; 66 | } 67 | 68 | private void incrementProgressBy(int bytes) { 69 | if (bytes > 0) { 70 | mProgressAdmin.addBytesProgress(bytes); 71 | } 72 | } 73 | 74 | } 75 | -------------------------------------------------------------------------------- /studio/app/src/main/java/nl/sogeti/android/gpstracker/util/UnicodeReader.java: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2008 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | package nl.sogeti.android.gpstracker.util; 16 | 17 | import java.io.IOException; 18 | import java.io.InputStream; 19 | import java.io.InputStreamReader; 20 | import java.io.PushbackInputStream; 21 | import java.io.Reader; 22 | 23 | public class UnicodeReader extends Reader { 24 | private static final int BOM_SIZE = 4; 25 | private final InputStreamReader reader; 26 | 27 | /** 28 | * Construct UnicodeReader 29 | * 30 | * @param in Input stream. 31 | * @param defaultEncoding Default encoding to be used if BOM is not found, or null to use system 32 | * default encoding. 33 | * @throws IOException If an I/O error occurs. 34 | */ 35 | public UnicodeReader(InputStream in, String defaultEncoding) throws IOException { 36 | byte bom[] = new byte[BOM_SIZE]; 37 | String encoding; 38 | int unread; 39 | PushbackInputStream pushbackStream = new PushbackInputStream(in, BOM_SIZE); 40 | int n = pushbackStream.read(bom, 0, bom.length); 41 | 42 | // Read ahead four bytes and check for BOM marks. 43 | if ((bom[0] == (byte) 0xEF) && (bom[1] == (byte) 0xBB) && (bom[2] == (byte) 0xBF)) { 44 | encoding = "UTF-8"; 45 | unread = n - 3; 46 | } else if ((bom[0] == (byte) 0xFE) && (bom[1] == (byte) 0xFF)) { 47 | encoding = "UTF-16BE"; 48 | unread = n - 2; 49 | } else if ((bom[0] == (byte) 0xFF) && (bom[1] == (byte) 0xFE)) { 50 | encoding = "UTF-16LE"; 51 | unread = n - 2; 52 | } else if ((bom[0] == (byte) 0x00) && (bom[1] == (byte) 0x00) && (bom[2] == (byte) 0xFE) && (bom[3] == (byte) 0xFF)) { 53 | encoding = "UTF-32BE"; 54 | unread = n - 4; 55 | } else if ((bom[0] == (byte) 0xFF) && (bom[1] == (byte) 0xFE) && (bom[2] == (byte) 0x00) && (bom[3] == (byte) 0x00)) { 56 | encoding = "UTF-32LE"; 57 | unread = n - 4; 58 | } else { 59 | encoding = defaultEncoding; 60 | unread = n; 61 | } 62 | 63 | // Unread bytes if necessary and skip BOM marks. 64 | if (unread > 0) { 65 | pushbackStream.unread(bom, (n - unread), unread); 66 | } else if (unread < -1) { 67 | pushbackStream.unread(bom, 0, 0); 68 | } 69 | 70 | // Use given encoding. 71 | if (encoding == null) { 72 | reader = new InputStreamReader(pushbackStream); 73 | } else { 74 | reader = new InputStreamReader(pushbackStream, encoding); 75 | } 76 | } 77 | 78 | public String getEncoding() { 79 | return reader.getEncoding(); 80 | } 81 | 82 | @Override 83 | public void close() throws IOException { 84 | reader.close(); 85 | } 86 | 87 | @Override 88 | public int read(char[] cbuf, int off, int len) throws IOException { 89 | return reader.read(cbuf, off, len); 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /studio/app/src/main/java/nl/sogeti/android/gpstracker/viewer/FixedMyLocationOverlay.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Written by Pieter @ android-developers on groups.google.com 3 | * 4 | * This file is part of OpenGPSTracker. 5 | * 6 | * OpenGPSTracker is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * OpenGPSTracker is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with OpenGPSTracker. If not, see . 18 | * 19 | */ 20 | package nl.sogeti.android.gpstracker.viewer; 21 | 22 | import android.content.Context; 23 | import android.graphics.Canvas; 24 | import android.graphics.Paint; 25 | import android.graphics.Paint.Style; 26 | import android.graphics.Point; 27 | import android.graphics.drawable.Drawable; 28 | import android.location.Location; 29 | 30 | import com.google.android.maps.GeoPoint; 31 | import com.google.android.maps.MapView; 32 | import com.google.android.maps.MyLocationOverlay; 33 | import com.google.android.maps.Projection; 34 | 35 | import nl.sogeti.android.gpstracker.R; 36 | 37 | /** 38 | * Fix for a ClassCastException found on some Google Maps API's implementations. 39 | * 40 | * @version $Id$ 41 | * @see www.spectrekking.com 42 | */ 43 | public class FixedMyLocationOverlay extends MyLocationOverlay { 44 | private boolean bugged = false; 45 | 46 | private Paint accuracyPaint; 47 | private Point center; 48 | private Point left; 49 | private Drawable drawable; 50 | private int width; 51 | private int height; 52 | 53 | public FixedMyLocationOverlay(Context context, MapView mapView) { 54 | super(context, mapView); 55 | } 56 | 57 | @Override 58 | protected void drawMyLocation(Canvas canvas, MapView mapView, Location lastFix, GeoPoint myLoc, long when) { 59 | if (!bugged) { 60 | try { 61 | super.drawMyLocation(canvas, mapView, lastFix, myLoc, when); 62 | } catch (Exception e) { 63 | bugged = true; 64 | } 65 | } 66 | 67 | if (bugged) { 68 | if (drawable == null) { 69 | if (accuracyPaint == null) { 70 | accuracyPaint = new Paint(); 71 | accuracyPaint.setAntiAlias(true); 72 | accuracyPaint.setStrokeWidth(2.0f); 73 | } 74 | drawable = mapView.getContext().getResources().getDrawable(R.drawable.mylocation); 75 | width = drawable.getIntrinsicWidth(); 76 | height = drawable.getIntrinsicHeight(); 77 | center = new Point(); 78 | left = new Point(); 79 | } 80 | Projection projection = mapView.getProjection(); 81 | 82 | double latitude = lastFix.getLatitude(); 83 | double longitude = lastFix.getLongitude(); 84 | float accuracy = lastFix.getAccuracy(); 85 | 86 | float[] result = new float[1]; 87 | 88 | Location.distanceBetween(latitude, longitude, latitude, longitude + 1, result); 89 | float longitudeLineDistance = result[0]; 90 | 91 | GeoPoint leftGeo = new GeoPoint((int) (latitude * 1e6), (int) ((longitude - accuracy / 92 | longitudeLineDistance) * 1e6)); 93 | projection.toPixels(leftGeo, left); 94 | projection.toPixels(myLoc, center); 95 | int radius = center.x - left.x; 96 | 97 | accuracyPaint.setColor(0xff6666ff); 98 | accuracyPaint.setStyle(Style.STROKE); 99 | canvas.drawCircle(center.x, center.y, radius, accuracyPaint); 100 | 101 | accuracyPaint.setColor(0x186666ff); 102 | accuracyPaint.setStyle(Style.FILL); 103 | canvas.drawCircle(center.x, center.y, radius, accuracyPaint); 104 | 105 | drawable.setBounds(center.x - width / 2, center.y - height / 2, center.x + width / 2, center.y + height / 2); 106 | drawable.draw(canvas); 107 | } 108 | } 109 | 110 | } -------------------------------------------------------------------------------- /studio/app/src/main/res/anim/slide_left_in.xml: -------------------------------------------------------------------------------- 1 | 15 | 16 | 17 | 21 | 22 | -------------------------------------------------------------------------------- /studio/app/src/main/res/anim/slide_left_out.xml: -------------------------------------------------------------------------------- 1 | 15 | 16 | 17 | 21 | 22 | -------------------------------------------------------------------------------- /studio/app/src/main/res/anim/slide_right_in.xml: -------------------------------------------------------------------------------- 1 | 15 | 16 | 17 | 21 | 22 | -------------------------------------------------------------------------------- /studio/app/src/main/res/anim/slide_right_out.xml: -------------------------------------------------------------------------------- 1 | 15 | 16 | 17 | 21 | 22 | -------------------------------------------------------------------------------- /studio/app/src/main/res/drawable-hdpi/btn_close_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcgroot/open-gpstracker/4c5f4ddda108bcf45756e797747f94c0b25e9471/studio/app/src/main/res/drawable-hdpi/btn_close_normal.png -------------------------------------------------------------------------------- /studio/app/src/main/res/drawable-hdpi/btn_close_pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcgroot/open-gpstracker/4c5f4ddda108bcf45756e797747f94c0b25e9471/studio/app/src/main/res/drawable-hdpi/btn_close_pressed.png -------------------------------------------------------------------------------- /studio/app/src/main/res/drawable-hdpi/btn_close_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcgroot/open-gpstracker/4c5f4ddda108bcf45756e797747f94c0b25e9471/studio/app/src/main/res/drawable-hdpi/btn_close_selected.png -------------------------------------------------------------------------------- /studio/app/src/main/res/drawable-hdpi/ic_menu_preferences.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcgroot/open-gpstracker/4c5f4ddda108bcf45756e797747f94c0b25e9471/studio/app/src/main/res/drawable-hdpi/ic_menu_preferences.png -------------------------------------------------------------------------------- /studio/app/src/main/res/drawable-hdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcgroot/open-gpstracker/4c5f4ddda108bcf45756e797747f94c0b25e9471/studio/app/src/main/res/drawable-hdpi/icon.png -------------------------------------------------------------------------------- /studio/app/src/main/res/drawable-hdpi/live.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcgroot/open-gpstracker/4c5f4ddda108bcf45756e797747f94c0b25e9471/studio/app/src/main/res/drawable-hdpi/live.png -------------------------------------------------------------------------------- /studio/app/src/main/res/drawable-hdpi/media_camera.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcgroot/open-gpstracker/4c5f4ddda108bcf45756e797747f94c0b25e9471/studio/app/src/main/res/drawable-hdpi/media_camera.png -------------------------------------------------------------------------------- /studio/app/src/main/res/drawable-hdpi/media_film.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcgroot/open-gpstracker/4c5f4ddda108bcf45756e797747f94c0b25e9471/studio/app/src/main/res/drawable-hdpi/media_film.png -------------------------------------------------------------------------------- /studio/app/src/main/res/drawable-hdpi/media_mark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcgroot/open-gpstracker/4c5f4ddda108bcf45756e797747f94c0b25e9471/studio/app/src/main/res/drawable-hdpi/media_mark.png -------------------------------------------------------------------------------- /studio/app/src/main/res/drawable-hdpi/media_notepad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcgroot/open-gpstracker/4c5f4ddda108bcf45756e797747f94c0b25e9471/studio/app/src/main/res/drawable-hdpi/media_notepad.png -------------------------------------------------------------------------------- /studio/app/src/main/res/drawable-hdpi/media_speech.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcgroot/open-gpstracker/4c5f4ddda108bcf45756e797747f94c0b25e9471/studio/app/src/main/res/drawable-hdpi/media_speech.png -------------------------------------------------------------------------------- /studio/app/src/main/res/drawable-ldpi/btn_close_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcgroot/open-gpstracker/4c5f4ddda108bcf45756e797747f94c0b25e9471/studio/app/src/main/res/drawable-ldpi/btn_close_normal.png -------------------------------------------------------------------------------- /studio/app/src/main/res/drawable-ldpi/btn_close_pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcgroot/open-gpstracker/4c5f4ddda108bcf45756e797747f94c0b25e9471/studio/app/src/main/res/drawable-ldpi/btn_close_pressed.png -------------------------------------------------------------------------------- /studio/app/src/main/res/drawable-ldpi/btn_close_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcgroot/open-gpstracker/4c5f4ddda108bcf45756e797747f94c0b25e9471/studio/app/src/main/res/drawable-ldpi/btn_close_selected.png -------------------------------------------------------------------------------- /studio/app/src/main/res/drawable-ldpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcgroot/open-gpstracker/4c5f4ddda108bcf45756e797747f94c0b25e9471/studio/app/src/main/res/drawable-ldpi/icon.png -------------------------------------------------------------------------------- /studio/app/src/main/res/drawable-mdpi/btn_close_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcgroot/open-gpstracker/4c5f4ddda108bcf45756e797747f94c0b25e9471/studio/app/src/main/res/drawable-mdpi/btn_close_normal.png -------------------------------------------------------------------------------- /studio/app/src/main/res/drawable-mdpi/btn_close_pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcgroot/open-gpstracker/4c5f4ddda108bcf45756e797747f94c0b25e9471/studio/app/src/main/res/drawable-mdpi/btn_close_pressed.png -------------------------------------------------------------------------------- /studio/app/src/main/res/drawable-mdpi/btn_close_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcgroot/open-gpstracker/4c5f4ddda108bcf45756e797747f94c0b25e9471/studio/app/src/main/res/drawable-mdpi/btn_close_selected.png -------------------------------------------------------------------------------- /studio/app/src/main/res/drawable-mdpi/ic_maps_indicator_current_position.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcgroot/open-gpstracker/4c5f4ddda108bcf45756e797747f94c0b25e9471/studio/app/src/main/res/drawable-mdpi/ic_maps_indicator_current_position.png -------------------------------------------------------------------------------- /studio/app/src/main/res/drawable-mdpi/ic_menu_preferences.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcgroot/open-gpstracker/4c5f4ddda108bcf45756e797747f94c0b25e9471/studio/app/src/main/res/drawable-mdpi/ic_menu_preferences.png -------------------------------------------------------------------------------- /studio/app/src/main/res/drawable-mdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcgroot/open-gpstracker/4c5f4ddda108bcf45756e797747f94c0b25e9471/studio/app/src/main/res/drawable-mdpi/icon.png -------------------------------------------------------------------------------- /studio/app/src/main/res/drawable-mdpi/live.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcgroot/open-gpstracker/4c5f4ddda108bcf45756e797747f94c0b25e9471/studio/app/src/main/res/drawable-mdpi/live.png -------------------------------------------------------------------------------- /studio/app/src/main/res/drawable-mdpi/media_camera.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcgroot/open-gpstracker/4c5f4ddda108bcf45756e797747f94c0b25e9471/studio/app/src/main/res/drawable-mdpi/media_camera.png -------------------------------------------------------------------------------- /studio/app/src/main/res/drawable-mdpi/media_film.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcgroot/open-gpstracker/4c5f4ddda108bcf45756e797747f94c0b25e9471/studio/app/src/main/res/drawable-mdpi/media_film.png -------------------------------------------------------------------------------- /studio/app/src/main/res/drawable-mdpi/media_mark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcgroot/open-gpstracker/4c5f4ddda108bcf45756e797747f94c0b25e9471/studio/app/src/main/res/drawable-mdpi/media_mark.png -------------------------------------------------------------------------------- /studio/app/src/main/res/drawable-mdpi/media_notepad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcgroot/open-gpstracker/4c5f4ddda108bcf45756e797747f94c0b25e9471/studio/app/src/main/res/drawable-mdpi/media_notepad.png -------------------------------------------------------------------------------- /studio/app/src/main/res/drawable-mdpi/media_speech.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcgroot/open-gpstracker/4c5f4ddda108bcf45756e797747f94c0b25e9471/studio/app/src/main/res/drawable-mdpi/media_speech.png -------------------------------------------------------------------------------- /studio/app/src/main/res/drawable-mdpi/mylocation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcgroot/open-gpstracker/4c5f4ddda108bcf45756e797747f94c0b25e9471/studio/app/src/main/res/drawable-mdpi/mylocation.png -------------------------------------------------------------------------------- /studio/app/src/main/res/drawable-mdpi/speedindexbar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcgroot/open-gpstracker/4c5f4ddda108bcf45756e797747f94c0b25e9471/studio/app/src/main/res/drawable-mdpi/speedindexbar.png -------------------------------------------------------------------------------- /studio/app/src/main/res/drawable-mdpi/stip.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcgroot/open-gpstracker/4c5f4ddda108bcf45756e797747f94c0b25e9471/studio/app/src/main/res/drawable-mdpi/stip.png -------------------------------------------------------------------------------- /studio/app/src/main/res/drawable-mdpi/stip2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcgroot/open-gpstracker/4c5f4ddda108bcf45756e797747f94c0b25e9471/studio/app/src/main/res/drawable-mdpi/stip2.png -------------------------------------------------------------------------------- /studio/app/src/main/res/drawable/btn_close.xml: -------------------------------------------------------------------------------- 1 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /studio/app/src/main/res/drawable/ic_graph_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /studio/app/src/main/res/drawable/ic_import_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /studio/app/src/main/res/drawable/ic_layers_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /studio/app/src/main/res/drawable/ic_list_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /studio/app/src/main/res/drawable/ic_navigation_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /studio/app/src/main/res/drawable/ic_navigation_48dp.xml: -------------------------------------------------------------------------------- 1 | 7 | 10 | 11 | -------------------------------------------------------------------------------- /studio/app/src/main/res/drawable/ic_pin_drop_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /studio/app/src/main/res/drawable/ic_pin_drop_48dp.xml: -------------------------------------------------------------------------------- 1 | 7 | 10 | 11 | -------------------------------------------------------------------------------- /studio/app/src/main/res/drawable/ic_search_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /studio/app/src/main/res/drawable/ic_share_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /studio/app/src/main/res/layout-land/graphtype.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 13 | 14 |