{
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 |
19 |
20 |
25 |
26 |
27 |
31 |
32 |
37 |
38 |
43 |
44 |
45 |
46 |
47 |
--------------------------------------------------------------------------------
/studio/app/src/main/res/layout-land/insertnote.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
13 |
14 |
20 |
21 |
27 |
28 |
29 |
30 |
34 |
35 |
41 |
42 |
48 |
49 |
50 |
51 |
52 |
53 |
--------------------------------------------------------------------------------
/studio/app/src/main/res/layout-land/layerdialog.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
11 |
12 |
16 |
17 |
21 |
22 |
27 |
28 |
33 |
34 |
35 |
39 |
40 |
45 |
46 |
47 |
48 |
49 |
53 |
54 |
59 |
60 |
65 |
66 |
71 |
72 |
77 |
78 |
83 |
84 |
85 |
86 |
--------------------------------------------------------------------------------
/studio/app/src/main/res/layout-land/logcontrol.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
13 |
14 |
20 |
21 |
27 |
28 |
29 |
33 |
34 |
40 |
41 |
47 |
48 |
49 |
50 |
51 |
--------------------------------------------------------------------------------
/studio/app/src/main/res/layout/activity_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
14 |
--------------------------------------------------------------------------------
/studio/app/src/main/res/layout/contrib.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/studio/app/src/main/res/layout/control_appwidget.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
14 |
15 |
19 |
20 |
26 |
27 |
34 |
35 |
--------------------------------------------------------------------------------
/studio/app/src/main/res/layout/fragment_about.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
15 |
16 |
21 |
22 |
28 |
29 |
--------------------------------------------------------------------------------
/studio/app/src/main/res/layout/graphtype.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
13 |
14 |
19 |
20 |
25 |
26 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/studio/app/src/main/res/layout/insertnote.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
14 |
15 |
21 |
22 |
28 |
29 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/studio/app/src/main/res/layout/layerdialog.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
11 |
12 |
16 |
17 |
22 |
23 |
28 |
29 |
30 |
34 |
35 |
40 |
41 |
46 |
47 |
52 |
53 |
58 |
59 |
64 |
65 |
66 |
70 |
71 |
76 |
77 |
78 |
79 |
80 |
81 |
--------------------------------------------------------------------------------
/studio/app/src/main/res/layout/logcontrol.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
14 |
15 |
21 |
22 |
28 |
29 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/studio/app/src/main/res/layout/mediachooser.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/studio/app/src/main/res/layout/namedialog.xml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/studio/app/src/main/res/layout/notenamedialog.xml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/studio/app/src/main/res/layout/notetextdialog.xml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/studio/app/src/main/res/layout/savenotificationprogress.xml:
--------------------------------------------------------------------------------
1 |
8 |
9 |
15 |
16 |
20 |
21 |
27 |
28 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/studio/app/src/main/res/layout/section_header.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/studio/app/src/main/res/layout/statistics.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
10 |
14 |
15 |
18 |
19 |
22 |
23 |
26 |
27 |
28 |
31 |
32 |
35 |
36 |
39 |
40 |
41 |
44 |
45 |
48 |
49 |
52 |
53 |
54 |
57 |
58 |
61 |
62 |
65 |
66 |
67 |
70 |
71 |
74 |
75 |
78 |
79 |
80 |
83 |
84 |
87 |
88 |
91 |
92 |
93 |
96 |
97 |
100 |
101 |
104 |
105 |
106 |
109 |
110 |
113 |
114 |
117 |
118 |
119 |
122 |
123 |
126 |
127 |
130 |
131 |
132 |
136 |
137 |
141 |
142 |
146 |
147 |
151 |
152 |
156 |
157 |
158 |
159 |
--------------------------------------------------------------------------------
/studio/app/src/main/res/layout/toolbar.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/studio/app/src/main/res/layout/trackitem.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
16 |
17 |
25 |
26 |
35 |
36 |
48 |
49 |
60 |
61 |
--------------------------------------------------------------------------------
/studio/app/src/main/res/layout/tracklist.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
10 |
17 |
18 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/studio/app/src/main/res/values-de/array.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | - Aktiv
6 | - Pause
7 | - Angehalten
8 |
9 |
10 |
11 | - Eigene Werte
12 | - Fein
13 | - Normal
14 | - Mittel
15 | - Grob
16 |
17 |
18 |
19 | - Grün
20 | - Rot
21 | - Geschwindigkeit
22 | - Durchschnittsgeschwindigkeit speed
23 | - Waypoints
24 |
25 |
26 |
27 | - Maßeinheiten
28 | - Imperial (Meilen)
29 | - Metric (Meter)
30 | - Nautical (Knoten)
31 | - Pace (min/km)
32 | - Pace (min/mile)
33 |
34 |
35 |
36 | - KMZ - Google Earth, etc.
37 | - GPX - GPS Austausch Format
38 | - Text - Geschwindkeit- und Streckendaten
39 |
40 |
41 |
42 | - Auf SD-Karte speichern
43 | - Mit E-Mail-App senden
44 |
45 |
46 |
47 | - Auf SD-Karte speichern
48 | - Mit E-Mail-App senden
49 |
50 |
51 |
52 | - Tweet
53 | - SMS
54 | - Text senden
55 |
56 |
57 |
58 | - Identifiable (Empfohlen)
59 | - Public
60 | - Trackable (Bevorzugte Option über \'Private\')
61 | - Private
62 |
63 |
64 |
65 | - Werner Bogula
66 |
67 |
--------------------------------------------------------------------------------
/studio/app/src/main/res/values-de/units.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | km/h
4 | km
5 | meter
6 |
7 | Knoten
8 | Seemeile
9 |
10 | min/km
11 | min/mile
12 |
13 |
--------------------------------------------------------------------------------
/studio/app/src/main/res/values-en-rUS/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/studio/app/src/main/res/values-en-rUS/units.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | mph
4 | mile
5 | feet
6 |
7 | knot
8 | nautic mile
9 |
10 | min/km
11 | min/mile
12 |
--------------------------------------------------------------------------------
/studio/app/src/main/res/values-en-rUS/units_values.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | - 2.236936292
4 | - 0.000621371
5 | - 3.2808
6 |
7 |
--------------------------------------------------------------------------------
/studio/app/src/main/res/values-es/array.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | - Active
6 | - Paused
7 | - Stopped
8 |
9 |
10 |
11 | - Custom
12 | - Fine
13 | - Normal
14 | - Coarse
15 | - Global network
16 |
17 |
18 |
19 | - Green
20 | - Red
21 | - Speed
22 | - Average speed
23 | - Waypoints
24 |
25 |
26 |
27 | - Device locale
28 | - Imperial (miles)
29 | - Metric (meters)
30 | - Nautical (knots)
31 | - Pace (minutes per kilometer)
32 | - Pace (minutes per mile)
33 |
34 |
35 |
36 | - KMZ - Google Earth, etc.
37 | - GPX - the GPS Exchange Format
38 | - Text - Speed and distance summary
39 |
40 |
41 |
42 | - Store to SD Card
43 | - Send with an (email) application
44 |
45 |
46 |
47 | - Store to SD Card
48 | - Send with an (email) application
49 |
50 |
51 |
52 | - Tweet
53 | - SMS
54 | - Generic text send
55 |
56 |
57 |
58 | - Identifiable (Recommended)
59 | - Public
60 | - Trackable (Preferred over Private)
61 | - Private
62 |
63 |
64 |
65 | - Alfonso Montero López
66 |
67 |
--------------------------------------------------------------------------------
/studio/app/src/main/res/values-es/units.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | km/h
4 | km
5 | meter
6 |
7 | knot
8 | nautic mile
9 |
10 | min/km
11 | min/mile
12 |
13 |
--------------------------------------------------------------------------------
/studio/app/src/main/res/values-fr/array.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | - Actif
6 | - Pause
7 | - Arrêt
8 |
9 |
10 |
11 | - Personalisé
12 | - Fin
13 | - Normal
14 | - Brut
15 | - Global
16 |
17 |
18 |
19 | - Vert
20 | - Rouge
21 | - Vitesse
22 | - Vitesse moyenne
23 | - Points de parcours
24 |
25 |
26 |
27 | - Défaut dispositif
28 | - Impériale (milles)
29 | - Métrique (mètres)
30 | - Nautique (noeuds)
31 | - Vitesse (min/km)
32 | - Vitesse (min/noeuds)
33 |
34 |
35 |
36 | - KMZ - Google Earth, etc.
37 | - GPX - Format échange GPS
38 | - Texte - Sommaire vitesse et distance
39 |
40 |
41 |
42 | - Enregistrer sur Carte SD
43 | - Envoyer par email
44 |
45 |
46 |
47 | - Enregistrer sur Carte SD
48 | - Envoyer par email
49 |
50 |
51 |
52 | - Tweet
53 | - SMS
54 | - Envoyer par texte
55 |
56 |
57 |
58 | - Identifiables (recommandé)
59 | - Publique
60 | - Traceable (préféré en lieu de option \'Privé\' )
61 | - Privé
62 |
63 |
64 |
65 | - Paul Meier
66 |
67 |
--------------------------------------------------------------------------------
/studio/app/src/main/res/values-fr/units.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | km/h
4 | km
5 | mètres
6 |
7 | noeuds
8 | milles nautiques
9 |
10 | min/km
11 | min/milles
12 |
13 |
--------------------------------------------------------------------------------
/studio/app/src/main/res/values-it/array.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | - Attivo
6 | - Pausa
7 | - Fermo
8 |
9 |
10 |
11 | - Personalizzato
12 | - Fine
13 | - Normale
14 | - Grezzo
15 | - Rete globale
16 |
17 |
18 |
19 | - Verde
20 | - Rosso
21 | - Velocità
22 | - Velocità media
23 | - Punto
24 |
25 |
26 |
27 | - Dispositivo locale
28 | - Imperiale (miglie)
29 | - Metrico (metri)
30 | - Nautico (nodi)
31 | - Andatura (minuti per chilometro)
32 | - Andatura (minuti per miglia)
33 |
34 |
35 |
36 | - KMZ - Google Earth, etc.
37 | - GPX - Formato scambio GPS
38 | - Testo - Sommario distanza e velocità
39 |
40 |
41 |
42 | - Salvare su scheda SD
43 | - Invio con applicazione (email)
44 |
45 |
46 |
47 | - Salvare su scheda SD
48 | - Invio con applicazione (email)
49 |
50 |
51 |
52 | - Tweet
53 | - SMS
54 | - Invio testo generico
55 |
56 |
57 |
58 | - Identificabile (Raccomandato)
59 | - Pubblico
60 | - Tracciabile (Preferito a Privato
61 | - Privato
62 |
63 |
64 |
65 | - Paul Meier
66 |
67 |
--------------------------------------------------------------------------------
/studio/app/src/main/res/values-it/units.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | km/h
4 | km
5 | metri
6 |
7 | nodi
8 | miglie nautiche
9 |
10 | min/km
11 | min/miglia
12 |
13 |
--------------------------------------------------------------------------------
/studio/app/src/main/res/values-nl/array.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | - Actief
6 | - Pause
7 | - Gestopt
8 |
9 |
10 |
11 | - Aangepast
12 | - Fijn
13 | - Normaal
14 | - Grof
15 | - Globaal
16 |
17 |
18 |
19 | - Groen
20 | - Rood
21 | - Snelheid
22 | - Gemiddelde snelheid
23 | - Meetpunten
24 |
25 |
26 |
27 | - Standaard
28 | - Engelse
29 | - Meters
30 | - Zeevaart
31 | - Tempo (minuten per kilometer)
32 | - Tempo (minuten per mile)
33 |
34 |
35 |
36 | - KMZ - Google Earth, etc.
37 | - GPX - GPS Exchange formaat
38 | - Afbeelding en text - Snelheid en afstands samenvatting
39 |
40 |
41 |
42 | - Opslaan op SD Card
43 | - Verstuur met een (email) applicatie
44 |
45 |
46 |
47 | - Opslaan op SD Card
48 | - Verstuur met een (email) applicatie
49 |
50 |
51 |
52 | - Tweet
53 | - SMS
54 | - Overige tekst applicaties
55 |
56 |
57 |
58 | - Identifiable (aanbevolen)
59 | - Public
60 | - Trackable (Beter dan \'Private\' optie)
61 | - Private
62 |
63 |
64 |
65 | - René de Groot
66 |
67 |
68 |
--------------------------------------------------------------------------------
/studio/app/src/main/res/values-nl/units.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | km/u
4 | km
5 | meter
6 |
7 | knopen
8 | zeemijl
9 |
10 | min/km
11 | min/mile
12 |
13 | hectare/h
14 | acre/h
15 |
16 |
--------------------------------------------------------------------------------
/studio/app/src/main/res/values-pl/array.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | - Aktywne
6 | - Zatrzymane
7 | - Zakończone
8 |
9 |
10 |
11 | - Własna
12 | - Dokładnie
13 | - Normalnie
14 | - Z grubsza
15 | - Globalnie (z sieci komórkowej)
16 |
17 |
18 |
19 | - Zielony
20 | - Czerwony
21 | - Prędkość
22 | - Średnia prędkość
23 | - Punkty orientacyjne
24 |
25 |
26 |
27 | - Z ustawień urządzenia
28 | - Imperialne (mile)
29 | - Metryczne (metry)
30 | - Morskie (węzły)
31 | - Tempo (minuty na kilometr)
32 | - Tempo (minuty na milę)
33 |
34 |
35 |
36 | - KMZ - Google Earth, itp.
37 | - GPX - GPS Exchange Format
38 | - Tekst - Podsumowanie prędkości i dystansu
39 |
40 |
41 |
42 | - Zapisz na karcie SD
43 | - Wyślij programem pocztowym
44 |
45 |
46 |
47 | - Zapisz na karcie SD
48 | - Wyślij programem pocztowym
49 |
50 |
51 |
52 | - Tweetuj
53 | - SMS
54 | - Wyślij w formacie tekstowym
55 |
56 |
57 |
58 | - Zidentyfikowany (rekomendowany)
59 | - Publiczny
60 | - Niezidentyfikowany
61 | - Prywatny
62 |
63 |
64 |
65 | - Marcin Kost
66 |
67 |
68 |
--------------------------------------------------------------------------------
/studio/app/src/main/res/values-pl/units.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | km/h
4 | km
5 | metrów
6 |
7 | węzły
8 | mile morskie
9 |
10 | min/km
11 | min/milę
12 |
13 |
--------------------------------------------------------------------------------
/studio/app/src/main/res/values-v14/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 0dp
4 |
--------------------------------------------------------------------------------
/studio/app/src/main/res/values-zh-rCN/array.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
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 | - KMZ - 锁眼加值语言
37 | - GPX - GPS的交换格式
38 | - 文本 - 速度和距离的摘要
39 |
40 |
41 |
42 | - 保存到SD卡
43 | - 使用一个(Email)程序发送
44 |
45 |
46 |
47 | - 保存到SD卡
48 | - 使用一个(Email)程序发送
49 |
50 |
51 |
52 | - 推
53 | - 短信
54 | - 通用文本发送
55 |
56 |
57 |
58 | - 可识别 (推荐)
59 | - 公共
60 | - 可追踪
61 | - 私有
62 |
63 |
64 |
65 | - 安智网汉化 (bbs.goapk.com)
66 | - NetDragon Websoft Inc. http://www.nd.com.cn/
67 |
68 |
--------------------------------------------------------------------------------
/studio/app/src/main/res/values-zh-rCN/units.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 公里/时
4 | 公里
5 | 米
6 |
7 | 节
8 | 海里
9 |
10 | 分钟/千米
11 | 分钟/英里
12 |
13 |
--------------------------------------------------------------------------------
/studio/app/src/main/res/values-zh-rTW/array.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
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 | - KMZ - 鎖眼加值語言
37 | - GPX - GPS的交換格式
38 | - 文字 - 速度和距離的概觀
39 |
40 |
41 |
42 | - 儲存到SD卡
43 | - 使用一個(Email)程式傳送
44 |
45 |
46 |
47 | - 儲存到SD卡
48 | - 使用一個(Email)程式傳送
49 |
50 |
51 |
52 | - Tweet
53 | - 短信
54 | - 通用文字傳送
55 |
56 |
57 |
58 | - 可辨識 (推薦)
59 | - 公共
60 | - 可追蹤
61 | - 私有
62 |
63 |
64 |
65 | - 安智網漢化 (bbs.goapk.com)
66 | - NetDragon Websoft Inc. http://www.nd.com.cn/
67 |
68 |
--------------------------------------------------------------------------------
/studio/app/src/main/res/values-zh-rTW/units.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 公里/時
4 | 公里
5 | 米
6 |
7 | 節
8 | 海裡
9 |
10 | 分鐘/千米
11 | 分鐘/英里
12 |
13 |
--------------------------------------------------------------------------------
/studio/app/src/main/res/values/array.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | - Green
5 | - Red
6 | - Speed
7 | - Average speed
8 | - Waypoints
9 |
10 |
11 |
12 | - Device locale
13 | - Imperial (miles)
14 | - Metric (meters)
15 | - Nautical (knots)
16 | - Pace (minutes per kilometer)
17 | - Pace (minutes per mile)
18 |
19 |
20 |
21 | - KMZ - Google Earth, etc.
22 | - GPX - the GPS Exchange Format
23 | - Image and text - Speed and distance summary
24 |
25 |
26 |
27 | - Store to SD Card
28 | - Send with an (email) application
29 |
30 |
31 |
32 | - Store to SD Card
33 | - Send with an (email) application
34 |
35 |
36 |
37 | - Tweet
38 | - SMS
39 | - Generic text send
40 |
41 |
42 |
43 | - Identifiable (Recommended)
44 | - Public
45 | - Trackable (Preferred over Private)
46 | - Private
47 |
48 |
49 |
50 | - René de Groot
51 |
52 |
--------------------------------------------------------------------------------
/studio/app/src/main/res/values/array_values.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | - 0
6 | - 1
7 | - 2
8 | - 3
9 | - 4
10 |
11 |
12 |
13 | - 0
14 | - 1
15 | - 2
16 | - 3
17 | - 4
18 |
19 |
20 |
21 | - 0
22 | - 1
23 | - 2
24 | - 3
25 | - 4
26 | - 5
27 |
28 |
29 |
30 | - René de Groot
31 | - Tom Van Braeckel
32 |
33 |
34 |
35 | - René de Groot
36 |
37 |
38 |
39 | - Program icons: The Android Open Source Project
40 | - Bubbles icons: ICONS etc. MySiteMyWay
41 |
42 |
43 |
--------------------------------------------------------------------------------
/studio/app/src/main/res/values/attrs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/studio/app/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 8dp
4 |
5 | 24dp
6 |
--------------------------------------------------------------------------------
/studio/app/src/main/res/values/donottranslate_units_values.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | - 3.6
4 | - 0.001
5 | - 1.0
6 |
7 | - 1.943844
8 | - 0.000539957
9 |
10 | - 0.271143793
11 | - 0.36
12 |
13 |
--------------------------------------------------------------------------------
/studio/app/src/main/res/values/palette.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #C29C00
4 | #ffa800
5 | #ffd100
6 |
7 | #FFF2BD
8 | #212121
9 | #727272
10 | #212121
11 | #B6B6B6
12 |
13 | #38300a
14 |
--------------------------------------------------------------------------------
/studio/app/src/main/res/values/settings.ml.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/studio/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
8 |
16 |
17 |
24 |
25 |
28 |
--------------------------------------------------------------------------------
/studio/app/src/main/res/values/units.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | km/h
4 | km
5 | meter
6 |
7 | knot
8 | nautic mile
9 |
10 | min/km
11 | min/mile
12 |
13 | hectare/h
14 | acre/h
15 |
16 |
--------------------------------------------------------------------------------
/studio/app/src/main/res/xml/control_appwidget_info.xml:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/studio/app/src/main/res/xml/file_paths.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/studio/app/src/main/res/xml/searchable.xml:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/studio/app/src/test/java/nl/sogeti/android/gpstracker/actions/tasks/XmlCreatorTest.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.actions.tasks;
30 |
31 | import junit.framework.Assert;
32 |
33 | import org.junit.Test;
34 |
35 | public class XmlCreatorTest {
36 |
37 | @Test
38 | public void testCleanFilename() {
39 | String dirty = "abc=+:;/123";
40 | String clean = XmlCreator.cleanFilename(dirty, "ERROR");
41 | Assert.assertEquals("Cleaned", "abc123", clean);
42 | }
43 |
44 | @Test
45 | public void testCleanFilenameEmpty() {
46 | String dirty = "";
47 | String clean = XmlCreator.cleanFilename(dirty, "Untitled");
48 | Assert.assertEquals("Cleaned", "Untitled", clean);
49 | }
50 |
51 | @Test
52 | public void testCleanFilenameNull() {
53 | String dirty = null;
54 | String clean = XmlCreator.cleanFilename(dirty, "Untitled2");
55 | Assert.assertEquals("Cleaned", "Untitled2", clean);
56 | }
57 |
58 | @Test
59 | public void testCleanFilenameAllSpecial() {
60 | String dirty = "!!??";
61 | String clean = XmlCreator.cleanFilename(dirty, "Untitled3");
62 | Assert.assertEquals("Cleaned", "Untitled3", clean);
63 | }
64 | }
65 |
--------------------------------------------------------------------------------
/studio/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 | buildscript {
3 | apply from: 'versions.gradle'
4 |
5 | repositories {
6 | jcenter()
7 | }
8 | dependencies {
9 | // Update checkable at https://jcenter.bintray.com/com/android/tools/build/gradle/
10 | classpath "com.android.tools.build:gradle:$rootProject.gradlePluginVersion"
11 | }
12 | }
13 |
14 | allprojects {
15 | repositories {
16 | jcenter()
17 | }
18 | }
19 |
20 | task clean(type: Delete) {
21 | delete rootProject.buildDir
22 | }
23 |
--------------------------------------------------------------------------------
/studio/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 |
3 | # IDE (e.g. Android Studio) users:
4 | # Gradle settings configured through the IDE *will override*
5 | # any settings specified in this file.
6 |
7 | # For more details on how to configure your build environment visit
8 | # http://www.gradle.org/docs/current/userguide/build_environment.html
9 |
10 | # Specifies the JVM arguments used for the daemon process.
11 | # The setting is particularly useful for tweaking memory settings.
12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m
13 | org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -Dfile.encoding=UTF-8
14 |
15 | # When configured, Gradle will run in incubating parallel mode.
16 | # This option should only be used with decoupled projects. More details, visit
17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
18 | org.gradle.parallel=false
19 |
20 | org.gradle.daemon=true
--------------------------------------------------------------------------------
/studio/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rcgroot/open-gpstracker/4c5f4ddda108bcf45756e797747f94c0b25e9471/studio/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/studio/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Thu Oct 22 21:36:28 CEST 2015
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
7 |
--------------------------------------------------------------------------------
/studio/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
10 | DEFAULT_JVM_OPTS=""
11 |
12 | APP_NAME="Gradle"
13 | APP_BASE_NAME=`basename "$0"`
14 |
15 | # Use the maximum available, or set MAX_FD != -1 to use that value.
16 | MAX_FD="maximum"
17 |
18 | warn ( ) {
19 | echo "$*"
20 | }
21 |
22 | die ( ) {
23 | echo
24 | echo "$*"
25 | echo
26 | exit 1
27 | }
28 |
29 | # OS specific support (must be 'true' or 'false').
30 | cygwin=false
31 | msys=false
32 | darwin=false
33 | case "`uname`" in
34 | CYGWIN* )
35 | cygwin=true
36 | ;;
37 | Darwin* )
38 | darwin=true
39 | ;;
40 | MINGW* )
41 | msys=true
42 | ;;
43 | esac
44 |
45 | # For Cygwin, ensure paths are in UNIX format before anything is touched.
46 | if $cygwin ; then
47 | [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
48 | fi
49 |
50 | # Attempt to set APP_HOME
51 | # Resolve links: $0 may be a link
52 | PRG="$0"
53 | # Need this for relative symlinks.
54 | while [ -h "$PRG" ] ; do
55 | ls=`ls -ld "$PRG"`
56 | link=`expr "$ls" : '.*-> \(.*\)$'`
57 | if expr "$link" : '/.*' > /dev/null; then
58 | PRG="$link"
59 | else
60 | PRG=`dirname "$PRG"`"/$link"
61 | fi
62 | done
63 | SAVED="`pwd`"
64 | cd "`dirname \"$PRG\"`/" >&-
65 | APP_HOME="`pwd -P`"
66 | cd "$SAVED" >&-
67 |
68 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
69 |
70 | # Determine the Java command to use to start the JVM.
71 | if [ -n "$JAVA_HOME" ] ; then
72 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
73 | # IBM's JDK on AIX uses strange locations for the executables
74 | JAVACMD="$JAVA_HOME/jre/sh/java"
75 | else
76 | JAVACMD="$JAVA_HOME/bin/java"
77 | fi
78 | if [ ! -x "$JAVACMD" ] ; then
79 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
80 |
81 | Please set the JAVA_HOME variable in your environment to match the
82 | location of your Java installation."
83 | fi
84 | else
85 | JAVACMD="java"
86 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
87 |
88 | Please set the JAVA_HOME variable in your environment to match the
89 | location of your Java installation."
90 | fi
91 |
92 | # Increase the maximum file descriptors if we can.
93 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
94 | MAX_FD_LIMIT=`ulimit -H -n`
95 | if [ $? -eq 0 ] ; then
96 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
97 | MAX_FD="$MAX_FD_LIMIT"
98 | fi
99 | ulimit -n $MAX_FD
100 | if [ $? -ne 0 ] ; then
101 | warn "Could not set maximum file descriptor limit: $MAX_FD"
102 | fi
103 | else
104 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
105 | fi
106 | fi
107 |
108 | # For Darwin, add options to specify how the application appears in the dock
109 | if $darwin; then
110 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
111 | fi
112 |
113 | # For Cygwin, switch paths to Windows format before running java
114 | if $cygwin ; then
115 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
116 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
117 |
118 | # We build the pattern for arguments to be converted via cygpath
119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
120 | SEP=""
121 | for dir in $ROOTDIRSRAW ; do
122 | ROOTDIRS="$ROOTDIRS$SEP$dir"
123 | SEP="|"
124 | done
125 | OURCYGPATTERN="(^($ROOTDIRS))"
126 | # Add a user-defined pattern to the cygpath arguments
127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
129 | fi
130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
131 | i=0
132 | for arg in "$@" ; do
133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
135 |
136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
138 | else
139 | eval `echo args$i`="\"$arg\""
140 | fi
141 | i=$((i+1))
142 | done
143 | case $i in
144 | (0) set -- ;;
145 | (1) set -- "$args0" ;;
146 | (2) set -- "$args0" "$args1" ;;
147 | (3) set -- "$args0" "$args1" "$args2" ;;
148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
154 | esac
155 | fi
156 |
157 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
158 | function splitJvmOpts() {
159 | JVM_OPTS=("$@")
160 | }
161 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
162 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
163 |
164 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
165 |
--------------------------------------------------------------------------------
/studio/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/studio/maps-api-key.txt:
--------------------------------------------------------------------------------
1 | Bedankt voor uw aanmelding voor een code voor de Android Maps-API.
2 |
3 | Uw code is:
4 |
5 | 0bmdf4-ggC50QWBY1OgGRutQ9bIboIy11OczZbw
6 |
7 | Deze code werkt voor alle toepassingen die zijn ondertekend met uw certificaat met het referentuenummer:
8 |
9 | 82:79:79:A6:B9:01:E9:7F:12:40:A7:0A:7D:1B:2F:39
10 |
11 | Hier volgt een voorbeeld van XML-opmaak om u aan de slag te helpen met het maken van fantastische kaarten:
12 |
13 |
18 |
19 |
20 | Raadpleeg de API-documentatie voor meer informatie.
--------------------------------------------------------------------------------
/studio/service/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/studio/service/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.library'
2 |
3 | android {
4 | compileSdkVersion "$rootProject.compileSdkVersion"
5 | buildToolsVersion "$rootProject.buildToolsVersion"
6 |
7 | compileOptions {
8 | sourceCompatibility JavaVersion.VERSION_1_7
9 | targetCompatibility JavaVersion.VERSION_1_7
10 | }
11 |
12 | defaultConfig {
13 | minSdkVersion 15
14 | targetSdkVersion 15
15 | versionCode 1
16 | versionName "1.0"
17 | }
18 | buildTypes {
19 | debug {
20 | buildConfigField 'boolean', 'IS_EMULATED', 'Boolean.valueOf(true)'
21 | }
22 | release {
23 | buildConfigField 'boolean', 'IS_EMULATED', 'Boolean.valueOf(false)'
24 | shrinkResources true
25 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
26 | }
27 | }
28 | lintOptions {
29 | abortOnError false
30 | }
31 | }
32 |
33 | dependencies {
34 | compile fileTree(include: ['*.jar'], dir: 'libs')
35 | compile "com.android.support:support-v4:$rootProject.supportLibraryVersion"
36 | compile "com.android.support:appcompat-v7:$rootProject.supportLibraryVersion"
37 | compile "com.jakewharton.timber:timber:$rootProject.timberVersion"
38 |
39 | androidTestCompile 'org.mockito:mockito-core:1.10.19'
40 | androidTestCompile 'com.crittercism.dexmaker:dexmaker:1.4'
41 | androidTestCompile 'com.crittercism.dexmaker:dexmaker-dx:1.4'
42 | androidTestCompile 'com.crittercism.dexmaker:dexmaker-mockito:1.4'
43 | }
44 |
--------------------------------------------------------------------------------
/studio/service/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 /Applications/android-sdk-mac_86/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 |
--------------------------------------------------------------------------------
/studio/service/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
17 |
23 |
24 |
25 |
31 |
32 |
38 |
39 |
40 |
43 |
44 |
45 |
46 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
--------------------------------------------------------------------------------
/studio/service/src/main/aidl/nl/sogeti/android/gpstracker/integration/IGPSLoggerServiceRemote.aidl:
--------------------------------------------------------------------------------
1 | package nl.sogeti.android.gpstracker.integration;
2 |
3 | import android.net.Uri;
4 | import android.location.Location;
5 |
6 | interface IGPSLoggerServiceRemote {
7 |
8 | long getTrackId();
9 | int loggingState();
10 | boolean isMediaPrepared();
11 | Uri storeMediaUri(in Uri mediaUri);
12 | Uri storeMetaData(in String key, in String value);
13 | Location getLastWaypoint();
14 | float getTrackedDistance();
15 | }
--------------------------------------------------------------------------------
/studio/service/src/main/java/nl/sogeti/android/gpstracker/service/logger/LoggingConstants.java:
--------------------------------------------------------------------------------
1 | package nl.sogeti.android.gpstracker.service.logger;
2 |
3 | /**
4 | * Created by grootren on 13-11-15.
5 | */
6 | public class LoggingConstants {
7 | static final long GLOBAL_INTERVAL = 300000l;
8 | static final float FINE_DISTANCE = 5F;
9 | static final long FINE_INTERVAL = 1000l;
10 | static final float FINE_ACCURACY = 20f;
11 | static final float NORMAL_DISTANCE = 10F;
12 | static final long NORMAL_INTERVAL = 15000l;
13 | static final float NORMAL_ACCURACY = 30f;
14 | static final float COARSE_DISTANCE = 25F;
15 | static final long COARSE_INTERVAL = 30000l;
16 | static final float COARSE_ACCURACY = 75f;
17 | static final float GLOBAL_DISTANCE = 500F;
18 | static final float GLOBAL_ACCURACY = 1000f;
19 | static final String SERVICESTATE_DISTANCE = "SERVICESTATE_DISTANCE";
20 | static final String SERVICESTATE_STATE = "SERVICESTATE_STATE";
21 | static final String SERVICESTATE_PRECISION = "SERVICESTATE_PRECISION";
22 | static final String SERVICESTATE_SEGMENTID = "SERVICESTATE_SEGMENTID";
23 | static final String SERVICESTATE_TRACKID = "SERVICESTATE_TRACKID";
24 | }
25 |
--------------------------------------------------------------------------------
/studio/service/src/main/java/nl/sogeti/android/gpstracker/service/logger/PowerManager.java:
--------------------------------------------------------------------------------
1 | package nl.sogeti.android.gpstracker.service.logger;
2 |
3 | import android.content.Context;
4 |
5 | import nl.sogeti.android.gpstracker.integration.ServiceConstants;
6 |
7 |
8 | /**
9 | * Created by rene on 27-12-15.
10 | */
11 | public class PowerManager {
12 |
13 | private static final String TAG = "WakeLockTag";
14 | private final Context mContext;
15 | private android.os.PowerManager.WakeLock mWakeLock;
16 |
17 | PowerManager(Context context) {
18 | this.mContext = context;
19 | }
20 |
21 | public void updateWakeLock(int loggingState) {
22 | if (loggingState == ServiceConstants.STATE_LOGGING) {
23 | android.os.PowerManager pm = (android.os.PowerManager) mContext.getSystemService(Context.POWER_SERVICE);
24 | if (this.mWakeLock != null) {
25 | this.mWakeLock.release();
26 | this.mWakeLock = null;
27 | }
28 | this.mWakeLock = pm.newWakeLock(android.os.PowerManager.PARTIAL_WAKE_LOCK, TAG);
29 | this.mWakeLock.acquire();
30 | } else {
31 | if (this.mWakeLock != null) {
32 | this.mWakeLock.release();
33 | this.mWakeLock = null;
34 | }
35 | }
36 | }
37 |
38 | public void release() {
39 | if (this.mWakeLock != null) {
40 | this.mWakeLock.release();
41 | this.mWakeLock = null;
42 | }
43 | }
44 |
45 | @Override
46 | protected void finalize() throws Throwable {
47 | super.finalize();
48 | if (mWakeLock != null) {
49 | mWakeLock.release();
50 | }
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/studio/service/src/main/java/nl/sogeti/android/gpstracker/service/startstop/BootReceiver.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Written by Tom van Braeckel @ http://code.google.com/u/tomvanbraeckel/
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.service.startstop;
21 |
22 | import android.content.BroadcastReceiver;
23 | import android.content.Context;
24 | import android.content.Intent;
25 |
26 | import nl.sogeti.android.gpstracker.service.logger.GPSLoggerService;
27 | import nl.sogeti.android.gpstracker.service.logger.LoggerPersistence;
28 | import timber.log.Timber;
29 |
30 | public class BootReceiver extends BroadcastReceiver {
31 | @Override
32 | public void onReceive(Context context, Intent intent) {
33 | Timber.d("BootReceiver.onReceive(), probably ACTION_BOOT_COMPLETED");
34 | String action = intent.getAction();
35 |
36 | // start on BOOT_COMPLETED
37 | if (action.equals(Intent.ACTION_BOOT_COMPLETED)) {
38 | Timber.d("BootReceiver received ACTION_BOOT_COMPLETED");
39 | LoggerPersistence persistence = new LoggerPersistence(context);
40 | // check in the settings if we need to auto start
41 | boolean startImmediately = persistence.shouldLogAtBoot();
42 |
43 | if (startImmediately) {
44 | Timber.d("Starting LoggerMap activity...");
45 | context.startService(new Intent(context, GPSLoggerService.class));
46 | } else {
47 | Timber.i("Not starting Logger Service. Adjust the settings if you wanted this !");
48 | }
49 | } else {
50 | // this shouldn't happen !
51 | Timber.w("OpenGPSTracker's BootReceiver received " + action + ", but it's only able to respond to " +
52 | Intent.ACTION_BOOT_COMPLETED + ". This shouldn't happen !");
53 | }
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/studio/service/src/main/java/nl/sogeti/android/gpstracker/service/startstop/DockReceiver.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.service.startstop;
30 |
31 | import android.content.BroadcastReceiver;
32 | import android.content.Context;
33 | import android.content.Intent;
34 | import android.os.Bundle;
35 |
36 | import nl.sogeti.android.gpstracker.integration.ServiceConstants;
37 | import nl.sogeti.android.gpstracker.service.logger.GPSLoggerService;
38 | import nl.sogeti.android.gpstracker.service.logger.LoggerPersistence;
39 | import timber.log.Timber;
40 |
41 | public class DockReceiver extends BroadcastReceiver {
42 | @Override
43 | public void onReceive(Context context, Intent intent) {
44 | String action = intent.getAction();
45 | if (action.equals(Intent.ACTION_DOCK_EVENT)) {
46 | Bundle extras = intent.getExtras();
47 | boolean start = false;
48 | boolean stop = false;
49 | if (extras != null && extras.containsKey(Intent.EXTRA_DOCK_STATE)) {
50 | int dockstate = extras.getInt(Intent.EXTRA_DOCK_STATE, -1);
51 | LoggerPersistence persistence = new LoggerPersistence(context);
52 | if (dockstate == Intent.EXTRA_DOCK_STATE_CAR) {
53 | start = persistence.shouldLogAtDockCar();
54 | } else if (dockstate == Intent.EXTRA_DOCK_STATE_UNDOCKED) {
55 | stop = persistence.shouldLogAtUndockCar();
56 | }
57 | }
58 | if (start) {
59 | Intent serviceIntent = new Intent(context, GPSLoggerService.class);
60 | serviceIntent.putExtra(ServiceConstants.Commands.COMMAND, ServiceConstants.Commands.EXTRA_COMMAND_START);
61 | context.startService(serviceIntent);
62 | } else if (stop) {
63 | Intent serviceIntent = new Intent(context, GPSLoggerService.class);
64 | serviceIntent.putExtra(ServiceConstants.Commands.COMMAND, ServiceConstants.Commands.EXTRA_COMMAND_STOP);
65 | context.startService(serviceIntent);
66 | }
67 | } else {
68 | Timber.w("OpenGPSTracker's BootReceiver received " + action + ", but it's only able to respond to " +
69 | Intent.ACTION_BOOT_COMPLETED + ". This shouldn't happen !");
70 | }
71 | }
72 | }
73 |
--------------------------------------------------------------------------------
/studio/service/src/main/java/nl/sogeti/android/gpstracker/service/startstop/PowerReceiver.java:
--------------------------------------------------------------------------------
1 | /*------------------------------------------------------------------------------
2 | ** Author: Tobias Jahn
3 | ** Copyright: (c) Dec 1, 2012 Tobias Jahn, All Rights Reserved.
4 | **------------------------------------------------------------------------------
5 | *
6 | * This file is part of OpenGPSTracker.
7 | *
8 | * OpenGPSTracker is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * (at your option) any later version.
12 | *
13 | * OpenGPSTracker is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with OpenGPSTracker. If not, see .
20 | *
21 | */
22 | package nl.sogeti.android.gpstracker.service.startstop;
23 |
24 | import android.content.BroadcastReceiver;
25 | import android.content.Context;
26 | import android.content.Intent;
27 |
28 | import nl.sogeti.android.gpstracker.integration.ServiceConstants;
29 | import nl.sogeti.android.gpstracker.service.logger.GPSLoggerService;
30 | import nl.sogeti.android.gpstracker.service.logger.LoggerPersistence;
31 | import timber.log.Timber;
32 |
33 | public class PowerReceiver extends BroadcastReceiver {
34 | @Override
35 | public void onReceive(Context context, Intent intent) {
36 | boolean start = false;
37 | boolean stop = false;
38 | String action = intent.getAction();
39 | Timber.d("OpenGPSTracker's PowerReceiver received: " + action);
40 | LoggerPersistence persistence = new LoggerPersistence(context);
41 | if (Intent.ACTION_POWER_CONNECTED.equals(action)) {
42 | start = persistence.shouldLogAtPowerConnected();
43 | } else if (Intent.ACTION_POWER_DISCONNECTED.equals(action)) {
44 | stop = persistence.shouldLogAtPowerDisconnected();
45 | } else {
46 | Timber.w("OpenGPSTracker's PowerReceiver received " + action + ", but it's only able to respond to " +
47 | Intent.ACTION_POWER_CONNECTED + " and " + Intent.ACTION_POWER_DISCONNECTED
48 | + ". This shouldn't happen!");
49 | }
50 |
51 | if (start) {
52 | Intent serviceIntent = new Intent(context, GPSLoggerService.class);
53 | serviceIntent.putExtra(ServiceConstants.Commands.COMMAND, ServiceConstants.Commands.EXTRA_COMMAND_START);
54 | context.startService(serviceIntent);
55 | } else if (stop) {
56 | Intent serviceIntent = new Intent(context, GPSLoggerService.class);
57 | serviceIntent.putExtra(ServiceConstants.Commands.COMMAND, ServiceConstants.Commands.EXTRA_COMMAND_STOP);
58 | context.startService(serviceIntent);
59 | }
60 | }
61 | }
--------------------------------------------------------------------------------
/studio/service/src/main/res/drawable/ic_maps_indicator_current_position.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rcgroot/open-gpstracker/4c5f4ddda108bcf45756e797747f94c0b25e9471/studio/service/src/main/res/drawable/ic_maps_indicator_current_position.png
--------------------------------------------------------------------------------
/studio/service/src/main/res/drawable/ic_pause_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/studio/service/src/main/res/drawable/ic_play_arrow_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/studio/service/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Open GPS Tracker
4 | Logging: %1$s (%2$s with %3$d satellites)
5 | Logging: %1$s (Precision %2$s)
6 | Logging: %1$s (%2$s with cell tower and wifi)
7 | GPS is disabled, logging is without effect.
8 | GPS is enabled, commencing logging.
9 | Network is disabled, network location logging is without effect.
10 | Network positioning is disabled, logging is without effect.
11 | Network positioning is enabled, commencing logging.
12 | Receiving no location information
13 | The last upload of track progress failed
14 |
15 | - Custom
16 | - Fine
17 | - Normal
18 | - Coarse
19 | - Global network
20 |
21 |
22 | - Active
23 | - Paused
24 | - Stopped
25 |
26 | In the last %1$d minutes covered a distance of %2$d meter
27 | Start tracking
28 | Pause tracking
29 | Resume tracking
30 | Stop tracking
31 |
32 | start and stop GPS tracking
33 | Allows the application to control the recording
34 | of GPS tracks.
35 | read and write GPS recorded tracks
36 | Allows the application to read and write stored tracks and
37 | create new tracks.
38 |
39 |
--------------------------------------------------------------------------------
/studio/service/src/main/res/values/strings_integration.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Access to start and stop the GPS logger in Open GPS Tracker is required to continue.
4 | Access to the tracks stored in Open GPS Tracker is required to continue.
5 | Missing installation
6 | The original Open GPS Tracker is required to run this application
7 | Install
8 |
9 |
10 |
--------------------------------------------------------------------------------
/studio/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app', ':service'
2 |
--------------------------------------------------------------------------------
/studio/versions.gradle:
--------------------------------------------------------------------------------
1 | ext {
2 | // Building
3 | buildToolsVersion = "25.0.2"
4 | gradlePluginVersion = '2.3.2'
5 | compileSdkVersion = "Google Inc.:Google APIs:24"
6 |
7 | // App support
8 | supportLibraryVersion = '24.2.1'
9 | timberVersion = '4.1.2'
10 |
11 | // Testing
12 | junitVersion = '4.12'
13 | }
--------------------------------------------------------------------------------