Сравнить коммиты

..
43 Коммитов
Автор SHA1 Сообщение Дата
Anton Tananaev 5a99be4005 Update to version 3.12 2016-10-02 11:49:12 +13:00
Anton Tananaev 255598b7e8 Support longer time interval 2016-10-02 11:40:15 +13:00
Anton Tananaev 6c29113278 Update gradle and android plugin 2016-10-02 11:30:15 +13:00
Anton Tananaev a861b71d02 Upload full license file 2016-09-23 03:10:35 +12:00
Anton Tananaev 370e9778b4 Add license file to the project 2016-09-22 17:55:52 +12:00
Anton Tananaev efdaf69d07 Remove unused class import 2016-09-01 02:28:35 +12:00
Anton Tananaev 3dbdaeb555 Handle missing GPS provider 2016-09-01 02:15:05 +12:00
Anton Tananaev 806a31cd92 Avoid index out of bounds 2016-09-01 02:05:20 +12:00
Anton Tananaev fa4654c969 Avoid uninitialized provider type 2016-09-01 01:56:17 +12:00
Anton Tananaev 624eefc309 Increase keep alive for connections 2016-07-29 11:23:44 +12:00
Anton Tananaev 7ab99da14c Fix protocol formatter unit test 2016-07-24 12:50:42 +12:00
Anton Tananaev 532a1f4249 Merge pull request #211 from mwild1/master
Add support for posting locations over HTTPS
2016-07-24 12:46:39 +12:00
Matthew Wild c3986ac172 Add support for posting locations over HTTPS 2016-07-22 21:27:15 +01:00
Anton Tananaev fae01757b6 Add gradle wrapper for Windows 2016-07-07 00:30:09 +12:00
Anton Tananaev 4f1af00383 Update project gradle files 2016-06-19 15:23:30 +12:00
Anton Tananaev 4c4192394f Add Google Play link to readme 2016-05-08 13:48:55 +12:00
Anton Tananaev 3d602aaf16 Update app version to 3.11 2016-04-29 10:33:43 +12:00
Anton Tananaev acf935dcfd Fix crash on second app start 2016-04-29 10:26:05 +12:00
Anton Tananaev bb49b11bf4 Disable lint check for release builds 2016-04-27 22:33:31 +12:00
Anton Tananaev b72b7dfa6f Update all language translations 2016-04-27 22:26:07 +12:00
Anton Tananaev c4d4e9ff40 Update all app project files 2016-04-27 22:20:45 +12:00
Anton Tananaev bcfa577e91 Set up Alarm to wake service (fix #175) 2016-04-27 22:08:16 +12:00
Anton Tananaev ac1ca8df2f Limit number of location updates (fix #156) 2016-04-27 22:07:15 +12:00
Anton Tananaev e0dfc8fe66 Update git ignore file rules 2016-04-27 22:06:07 +12:00
Anton Tananaev 7dc7f32110 Fix issue with shortcuts on hidden app 2016-04-23 15:08:17 +12:00
Anton Tananaev 6bffc7bbc1 Add transifex localization script 2016-04-10 00:57:20 +12:00
Anton Tananaev aaa6092501 Add Lao localization to the app 2016-04-10 00:55:18 +12:00
Anton Tananaev 8cd3601a4f Move string array to values xml 2016-04-09 23:59:58 +12:00
Anton Tananaev 088adcaa24 Release version 3.9 of the app 2016-02-20 17:20:44 +13:00
Anton Tananaev 0365837e4d Use full name in manifest file 2016-02-04 23:21:36 +11:00
Anton Tananaev f952e16c00 Application version 3.8 release 2016-01-30 10:31:05 +13:00
Anton Tananaev b7fb6445ef Implement application shortcuts (fix #161) 2016-01-30 10:17:30 +13:00
Anton Tananaev bc3f47e296 Remove position if deviceId is different 2016-01-29 22:11:32 +13:00
Anton Tananaev c60f749a67 Catch missing permissions exception 2016-01-29 22:05:47 +13:00
Anton Tananaev 821f24ce2b Implement app settings validation 2016-01-29 22:01:02 +13:00
Anton Tananaev 62c713e97a Update launcher icon and logo image 2016-01-29 20:24:37 +13:00
Anton Tananaev ab587d465e Merge pull request #173 from DrumSergio/patch-1
Minimal fault on translation
2015-12-31 08:10:51 +13:00
DrumSergio f82e89409d minimal fault on translation 2015-12-30 17:38:27 +01:00
Anton Tananaev 7e6d4f5822 Add Italian app localization file 2015-12-13 11:27:18 +13:00
Anton Tananaev b8a099189e Fix hidden app component name 2015-11-03 10:49:48 +13:00
Anton Tananaev e961df85d5 Use different application ids 2015-10-19 10:19:39 +13:00
Anton Tananaev 44648cf142 Workaround for 2.3 wakelock bug 2015-10-06 23:10:40 +13:00
Anton Tananaev d916bf432e Add shadow to launcher icon 2015-09-19 22:27:20 +12:00
46 изменённых файлов: 1064 добавлений и 497 удалений
+1 -3
Просмотреть файл
@@ -1,7 +1,5 @@
.gradle
.idea/
local.properties
traccar-client-android.iml
app/app.iml
*.iml
build/
app/build/
+202
Просмотреть файл
@@ -0,0 +1,202 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
+2
Просмотреть файл
@@ -1,5 +1,7 @@
# [Traccar Client for Android](https://www.traccar.org/client)
[![](https://play.google.com/intl/en_us/badges/images/badge_new.png)](https://play.google.com/store/apps/details?id=org.traccar.client)
## Contacts
Author - Anton Tananaev ([anton.tananaev@gmail.com](mailto:anton.tananaev@gmail.com))
+10 -24
Просмотреть файл
@@ -1,30 +1,27 @@
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion '23.0.1'
compileSdkVersion 24
buildToolsVersion '23.0.3'
defaultConfig {
minSdkVersion 3
targetSdkVersion 23
versionCode 26
versionName '3.6'
targetSdkVersion 24
versionCode 32
versionName '3.12'
}
signingConfigs {
release {
storeFile file('../../android.keystore')
keyAlias 'tananaev'
storePassword ''
keyPassword ''
}
lintOptions {
checkReleaseBuilds false
}
productFlavors {
regular {
applicationId "org.traccar.client"
buildConfigField "boolean", "HIDDEN_APP", "false"
}
hidden {
applicationId "org.traccar.client.hidden"
buildConfigField "boolean", "HIDDEN_APP", "true"
}
}
@@ -32,7 +29,7 @@ android {
buildTypes {
release {
minifyEnabled false
signingConfig signingConfigs.release
proguardFiles getDefaultProguardFile('proguard-android.txt')
}
}
}
@@ -41,14 +38,3 @@ dependencies {
testCompile 'junit:junit:4.12'
testCompile 'org.robolectric:robolectric:3.0'
}
task requestPasswords << {
android.signingConfigs.release.storePassword = new String(System.console().readPassword('\nStore password: '))
android.signingConfigs.release.keyPassword = new String(System.console().readPassword('Key password: '))
}
tasks.whenTaskAdded { theTask ->
if (theTask.name.equals('packageRegularRelease') || theTask.name.equals('packageHiddenRelease')) {
theTask.dependsOn 'requestPasswords'
}
}
+1 -1
Просмотреть файл
@@ -8,7 +8,7 @@
android:label="@string/hidden_app_name"
tools:replace="label">
<receiver android:name=".DialLaunchReceiver" >
<receiver android:name="org.traccar.client.DialLaunchReceiver" >
<intent-filter>
<action android:name="android.intent.action.NEW_OUTGOING_CALL" />
</intent-filter>
+10 -1
Просмотреть файл
@@ -8,12 +8,14 @@
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT" />
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/TraccarTheme">
android:theme="@style/TraccarTheme"
android:name=".MainApplication">
<activity android:name=".MainActivity" android:launchMode="singleTask" />
@@ -30,6 +32,13 @@
<activity android:name=".AboutActivity"/>
<activity
android:name=".ShortcutActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
<service android:name=".TrackingService" />
<service android:name=".TrackingService$HideNotificationService" />
+99 -18
Просмотреть файл
@@ -1,5 +1,5 @@
/*
* Copyright 2012 - 2015 Anton Tananaev (anton.tananaev@gmail.com)
* Copyright 2012 - 2016 Anton Tananaev (anton.tananaev@gmail.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -16,25 +16,23 @@
package org.traccar.client;
import android.Manifest;
import android.app.AlarmManager;
import android.app.AlertDialog;
import android.app.Dialog;
import android.app.PendingIntent;
import android.content.ComponentName;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.SharedPreferences.OnSharedPreferenceChangeListener;
import android.content.pm.PackageManager;
import android.location.LocationManager;
import android.os.Build;
import android.os.Bundle;
import android.preference.CheckBoxPreference;
import android.preference.EditTextPreference;
import android.preference.Preference;
import android.preference.PreferenceActivity;
import android.preference.PreferenceManager;
import android.preference.PreferenceScreen;
import android.preference.TwoStatePreference;
import android.telephony.TelephonyManager;
import android.util.Patterns;
import android.view.Menu;
import android.view.MenuItem;
@@ -48,6 +46,7 @@ public class MainActivity extends PreferenceActivity implements OnSharedPreferen
public static final String KEY_DEVICE = "id";
public static final String KEY_ADDRESS = "address";
public static final String KEY_PORT = "port";
public static final String KEY_SECURE = "secure";
public static final String KEY_INTERVAL = "interval";
public static final String KEY_PROVIDER = "provider";
public static final String KEY_STATUS = "status";
@@ -56,6 +55,9 @@ public class MainActivity extends PreferenceActivity implements OnSharedPreferen
private SharedPreferences sharedPreferences;
private AlarmManager alarmManager;
private PendingIntent alarmIntent;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
@@ -68,13 +70,62 @@ public class MainActivity extends PreferenceActivity implements OnSharedPreferen
addPreferencesFromResource(R.xml.preferences);
initPreferences();
findPreference(KEY_DEVICE).setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
@Override
public boolean onPreferenceChange(Preference preference, Object newValue) {
return newValue != null && !newValue.equals("");
}
});
findPreference(KEY_ADDRESS).setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
@Override
public boolean onPreferenceChange(Preference preference, Object newValue) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.FROYO) {
return newValue != null && Patterns.DOMAIN_NAME.matcher((String) newValue).matches();
} else {
return newValue != null && !((String) newValue).isEmpty();
}
}
});
findPreference(KEY_PORT).setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
@Override
public boolean onPreferenceChange(Preference preference, Object newValue) {
if (newValue != null) {
try {
int value = Integer.parseInt((String) newValue);
if (value > 0 && value <= 65536) {
return true;
}
} catch (NumberFormatException e) {
}
}
return false;
}
});
findPreference(KEY_INTERVAL).setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
@Override
public boolean onPreferenceChange(Preference preference, Object newValue) {
if (newValue != null) {
try {
Integer.parseInt((String) newValue);
return true;
} catch (NumberFormatException e) {
}
}
return false;
}
});
alarmManager = (AlarmManager) getSystemService(ALARM_SERVICE);
alarmIntent = PendingIntent.getBroadcast(this, 0, new Intent(this, AutostartReceiver.class), 0);
if (sharedPreferences.getBoolean(KEY_STATUS, false)) {
startTrackingService(true, false);
}
}
private void removeLauncherIcon() {
ComponentName componentName = new ComponentName(getPackageName(), getPackageName() + ".Launcher");
String className = MainActivity.class.getCanonicalName().replace(".MainActivity", ".Launcher");
ComponentName componentName = new ComponentName(getPackageName(), className);
PackageManager packageManager = getPackageManager();
if (packageManager.getComponentEnabledSetting(componentName) != PackageManager.COMPONENT_ENABLED_STATE_DISABLED) {
packageManager.setComponentEnabledSetting(
@@ -88,6 +139,20 @@ public class MainActivity extends PreferenceActivity implements OnSharedPreferen
}
}
private void addShortcuts(boolean start, int name) {
Intent shortcutIntent = new Intent(Intent.ACTION_MAIN);
shortcutIntent.setComponent(new ComponentName(getPackageName(), ShortcutActivity.class.getCanonicalName()));
shortcutIntent.putExtra(ShortcutActivity.EXTRA_ACTION, start);
Intent installShortCutIntent = new Intent("com.android.launcher.action.INSTALL_SHORTCUT");
installShortCutIntent.putExtra(Intent.EXTRA_SHORTCUT_INTENT, shortcutIntent);
installShortCutIntent.putExtra(Intent.EXTRA_SHORTCUT_NAME, getString(name));
installShortCutIntent.putExtra(Intent.EXTRA_SHORTCUT_ICON_RESOURCE,
Intent.ShortcutIconResource.fromContext(this, R.mipmap.ic_launcher));
sendBroadcast(installShortCutIntent);
}
private boolean hasPermission(String permission) {
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.LOLLIPOP_MR1) {
return true;
@@ -108,12 +173,12 @@ public class MainActivity extends PreferenceActivity implements OnSharedPreferen
}
private void setPreferencesEnabled(boolean enabled) {
PreferenceScreen preferenceScreen = getPreferenceScreen();
preferenceScreen.findPreference(KEY_DEVICE).setEnabled(enabled);
preferenceScreen.findPreference(KEY_ADDRESS).setEnabled(enabled);
preferenceScreen.findPreference(KEY_PORT).setEnabled(enabled);
preferenceScreen.findPreference(KEY_INTERVAL).setEnabled(enabled);
preferenceScreen.findPreference(KEY_PROVIDER).setEnabled(enabled);
findPreference(KEY_DEVICE).setEnabled(enabled);
findPreference(KEY_ADDRESS).setEnabled(enabled);
findPreference(KEY_PORT).setEnabled(enabled);
findPreference(KEY_SECURE).setEnabled(enabled);
findPreference(KEY_INTERVAL).setEnabled(enabled);
findPreference(KEY_PROVIDER).setEnabled(enabled);
}
@Override
@@ -140,6 +205,10 @@ public class MainActivity extends PreferenceActivity implements OnSharedPreferen
if (item.getItemId() == R.id.status) {
startActivity(new Intent(this, StatusActivity.class));
return true;
} else if (item.getItemId() == R.id.shortcuts) {
addShortcuts(true, R.string.shortcut_start);
addShortcuts(false, R.string.shortcut_stop);
return true;
} else if (item.getItemId() == R.id.about) {
startActivity(new Intent(this, AboutActivity.class));
return true;
@@ -160,7 +229,7 @@ public class MainActivity extends PreferenceActivity implements OnSharedPreferen
private void startTrackingService(boolean checkPermission, boolean permission) {
if (checkPermission) {
Set<String> missingPermissions = new HashSet<String>();
Set<String> missingPermissions = new HashSet<>();
if (!hasPermission(Manifest.permission.ACCESS_FINE_LOCATION)) {
missingPermissions.add(Manifest.permission.ACCESS_FINE_LOCATION);
}
@@ -170,7 +239,10 @@ public class MainActivity extends PreferenceActivity implements OnSharedPreferen
if (missingPermissions.isEmpty()) {
permission = true;
} else {
requestPermissions(missingPermissions.toArray(new String[missingPermissions.size()]), PERMISSIONS_REQUEST_LOCATION);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
requestPermissions(missingPermissions.toArray(new String[missingPermissions.size()]),
PERMISSIONS_REQUEST_LOCATION);
}
return;
}
}
@@ -178,6 +250,8 @@ public class MainActivity extends PreferenceActivity implements OnSharedPreferen
if (permission) {
setPreferencesEnabled(false);
startService(new Intent(this, TrackingService.class));
alarmManager.setInexactRepeating(AlarmManager.ELAPSED_REALTIME_WAKEUP,
15000, 15000, alarmIntent);
} else {
sharedPreferences.edit().putBoolean(KEY_STATUS, false).commit();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
@@ -191,6 +265,7 @@ public class MainActivity extends PreferenceActivity implements OnSharedPreferen
}
private void stopTrackingService() {
alarmManager.cancel(alarmIntent);
stopService(new Intent(this, TrackingService.class));
setPreferencesEnabled(true);
}
@@ -198,8 +273,14 @@ public class MainActivity extends PreferenceActivity implements OnSharedPreferen
@Override
public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {
if (requestCode == PERMISSIONS_REQUEST_LOCATION) {
startTrackingService(false, grantResults[0] == PackageManager.PERMISSION_GRANTED &&
(permissions.length < 2 || grantResults[1] == PackageManager.PERMISSION_GRANTED));
boolean granted = true;
for (int result : grantResults) {
if (result != PackageManager.PERMISSION_GRANTED) {
granted = false;
break;
}
}
startTrackingService(false, granted);
}
}
+28
Просмотреть файл
@@ -0,0 +1,28 @@
/*
* Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.traccar.client;
import android.app.Application;
public class MainApplication extends Application {
@Override
public void onCreate() {
super.onCreate();
System.setProperty("http.keepAliveDuration", String.valueOf(30 * 60 * 1000));
}
}
+5
Просмотреть файл
@@ -23,6 +23,7 @@ import android.location.LocationManager;
import android.os.Bundle;
import android.util.Log;
@SuppressWarnings("MissingPermission")
public class MixedPositionProvider extends PositionProvider implements LocationListener, GpsStatus.Listener {
private static int FIX_TIMEOUT = 30 * 1000;
@@ -37,7 +38,11 @@ public class MixedPositionProvider extends PositionProvider implements LocationL
public void startUpdates() {
lastFixTime = System.currentTimeMillis();
locationManager.addGpsStatusListener(this);
try {
locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, period, 0, this);
} catch (IllegalArgumentException e) {
Log.w(TAG, e);
}
}
public void stopUpdates() {
+3 -3
Просмотреть файл
@@ -55,9 +55,9 @@ public abstract class PositionProvider {
locationManager = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE);
deviceId = preferences.getString(MainActivity.KEY_DEVICE, null);
period = Integer.parseInt(preferences.getString(MainActivity.KEY_INTERVAL, null)) * 1000;
period = Long.parseLong(preferences.getString(MainActivity.KEY_INTERVAL, null)) * 1000;
type = preferences.getString(MainActivity.KEY_PROVIDER, null);
type = preferences.getString(MainActivity.KEY_PROVIDER, "gps");
}
public abstract void startUpdates();
@@ -65,7 +65,7 @@ public abstract class PositionProvider {
public abstract void stopUpdates();
protected void updateLocation(Location location) {
if (location != null && location.getTime() != lastUpdateTime) {
if (location != null && location.getTime() - lastUpdateTime >= period) {
Log.i(TAG, "location new");
lastUpdateTime = location.getTime();
listener.onPositionUpdate(new Position(deviceId, location, getBatteryLevel()));
+3 -4
Просмотреть файл
@@ -1,5 +1,5 @@
/*
* Copyright 2012 - 2015 Anton Tananaev (anton.tananaev@gmail.com)
* Copyright 2012 - 2016 Anton Tananaev (anton.tananaev@gmail.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,15 +15,14 @@
*/
package org.traccar.client;
import android.location.Location;
import android.net.Uri;
public class ProtocolFormatter {
public static String formatRequest(String address, int port, Position position) {
public static String formatRequest(String address, int port, boolean secure, Position position) {
Uri.Builder builder = new Uri.Builder();
builder.scheme("http").encodedAuthority(address + ':' + port)
builder.scheme(secure ? "https" : "http").encodedAuthority(address + ':' + port)
.appendQueryParameter("id", position.getDeviceId())
.appendQueryParameter("timestamp", String.valueOf(position.getTime().getTime() / 1000))
.appendQueryParameter("lat", String.valueOf(position.getLatitude()))
+56
Просмотреть файл
@@ -0,0 +1,56 @@
/*
* Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.traccar.client;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.widget.Toast;
public class ShortcutActivity extends Activity {
public static final String EXTRA_ACTION = "shortcutAction";
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
checkShortcutAction(getIntent());
}
@Override
protected void onNewIntent(Intent intent) {
super.onNewIntent(intent);
checkShortcutAction(intent);
}
private void checkShortcutAction(Intent intent) {
if (intent.hasExtra(EXTRA_ACTION)) {
boolean start = intent.getBooleanExtra(EXTRA_ACTION, false);
PreferenceManager.getDefaultSharedPreferences(this)
.edit().putBoolean(MainActivity.KEY_STATUS, start).commit();
if (start) {
startService(new Intent(this, TrackingService.class));
Toast.makeText(this, R.string.status_service_create, Toast.LENGTH_SHORT).show();
} else {
stopService(new Intent(this, TrackingService.class));
Toast.makeText(this, R.string.status_service_destroy, Toast.LENGTH_SHORT).show();
}
finish();
}
}
}
+6
Просмотреть файл
@@ -20,7 +20,9 @@ import android.location.Location;
import android.location.LocationListener;
import android.location.LocationManager;
import android.os.Bundle;
import android.util.Log;
@SuppressWarnings("MissingPermission")
public class SimplePositionProvider extends PositionProvider implements LocationListener {
public SimplePositionProvider(Context context, PositionListener listener) {
@@ -31,7 +33,11 @@ public class SimplePositionProvider extends PositionProvider implements Location
}
public void startUpdates() {
try {
locationManager.requestLocationUpdates(type, period, 0, this);
} catch (IllegalArgumentException e) {
Log.w(TAG, e);
}
}
public void stopUpdates() {
+23 -3
Просмотреть файл
@@ -17,6 +17,7 @@ package org.traccar.client;
import android.content.Context;
import android.content.SharedPreferences;
import android.os.Build;
import android.os.Handler;
import android.os.PowerManager;
import android.preference.PreferenceManager;
@@ -33,9 +34,11 @@ public class TrackingController implements PositionProvider.PositionListener, Ne
private Context context;
private Handler handler;
private SharedPreferences preferences;
private String address;
private int port;
private boolean secure;
private PositionProvider positionProvider;
private DatabaseHelper databaseHelper;
@@ -44,8 +47,12 @@ public class TrackingController implements PositionProvider.PositionListener, Ne
private PowerManager.WakeLock wakeLock;
private void lock() {
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.GINGERBREAD_MR1) {
wakeLock.acquire();
} else {
wakeLock.acquire(WAKE_LOCK_TIMEOUT);
}
}
private void unlock() {
if (wakeLock.isHeld()) {
@@ -56,8 +63,8 @@ public class TrackingController implements PositionProvider.PositionListener, Ne
public TrackingController(Context context) {
this.context = context;
handler = new Handler();
SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context);
if (preferences.getString(MainActivity.KEY_PROVIDER, null).equals("mixed")) {
preferences = PreferenceManager.getDefaultSharedPreferences(context);
if (preferences.getString(MainActivity.KEY_PROVIDER, "gps").equals("mixed")) {
positionProvider = new MixedPositionProvider(context, this);
} else {
positionProvider = new SimplePositionProvider(context, this);
@@ -68,6 +75,7 @@ public class TrackingController implements PositionProvider.PositionListener, Ne
address = preferences.getString(MainActivity.KEY_ADDRESS, null);
port = Integer.parseInt(preferences.getString(MainActivity.KEY_PORT, null));
secure = preferences.getBoolean(MainActivity.KEY_SECURE, false);
PowerManager powerManager = (PowerManager) context.getSystemService(Context.POWER_SERVICE);
wakeLock = powerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, getClass().getName());
@@ -77,13 +85,21 @@ public class TrackingController implements PositionProvider.PositionListener, Ne
if (isOnline) {
read();
}
try {
positionProvider.startUpdates();
} catch (SecurityException e) {
Log.w(TAG, e);
}
networkManager.start();
}
public void stop() {
networkManager.stop();
try {
positionProvider.stopUpdates();
} catch (SecurityException e) {
Log.w(TAG, e);
}
handler.removeCallbacksAndMessages(null);
}
@@ -148,7 +164,11 @@ public class TrackingController implements PositionProvider.PositionListener, Ne
public void onComplete(boolean success, Position result) {
if (success) {
if (result != null) {
if (result.getDeviceId().equals(preferences.getString(MainActivity.KEY_DEVICE, null))) {
send(result);
} else {
delete(result);
}
} else {
isWaiting = true;
}
@@ -179,7 +199,7 @@ public class TrackingController implements PositionProvider.PositionListener, Ne
private void send(final Position position) {
log("send", position);
lock();
String request = ProtocolFormatter.formatRequest(address, port, position);
String request = ProtocolFormatter.formatRequest(address, port, secure, position);
RequestManager.sendRequestAsync(request, new RequestManager.RequestHandler() {
@Override
public void onComplete(boolean success) {
-1
Просмотреть файл
@@ -23,7 +23,6 @@ import android.content.Context;
import android.content.Intent;
import android.os.Build;
import android.os.IBinder;
import android.preference.PreferenceManager;
import android.util.Log;
import java.lang.reflect.InvocationTargetException;
Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 3.6 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 2.4 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 4.8 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 7.2 KiB

+1 -1
Просмотреть файл
@@ -13,7 +13,7 @@
android:layout_marginLeft="@dimen/about_margin"
android:layout_marginStart="@dimen/about_margin"
android:layout_marginTop="@dimen/about_margin"
android:src="@mipmap/ic_launcher"
android:src="@drawable/logo"
android:contentDescription="@string/app_logo" />
<LinearLayout
+6 -1
Просмотреть файл
@@ -6,9 +6,14 @@
android:title="@string/menu_status"
android:showAsAction="always" />
<item
android:id="@+id/shortcuts"
android:title="@string/menu_shortcuts"
android:showAsAction="never" />
<item
android:id="@+id/about"
android:title="@string/menu_about"
android:showAsAction="ifRoom" />
android:showAsAction="never" />
</menu>
+4 -12
Просмотреть файл
@@ -1,9 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version='1.0' encoding='UTF-8'?>
<resources>
<string name="app_name">Traccar klient</string>
<string name="app_logo">Traccar</string>
<string name="settings_id_title">Identifikátor zařízení</string>
<string name="settings_address_title">Adresa serveru</string>
<string name="settings_address_summary">Doménové jméno nebo IP adresa</string>
@@ -18,26 +16,20 @@
<string name="settings_status_on_summary">Spuštěno</string>
<string name="settings_provider_title">Poskytovatel zaměření</string>
<string name="settings_provider_summary">Zdroj zaměřovacích dat</string>
<string-array name="settings_provider_names">
<item>GPS</item>
<item>Mobilní síť</item>
<item>Obojí</item>
</string-array>
<string name="settings_provider_gps">GPS</string>
<string name="settings_provider_network">Mobilní síť</string>
<string name="settings_provider_mixed">Obojí</string>
<string name="settings_foreground_title">Popředí služba</string>
<string name="settings_foreground_summary">Zvýšit prioritu služba</string>
<string name="menu_status">Stav</string>
<string name="menu_about">O aplikaci</string>
<string name="menu_clear">Vyčistit</string>
<string name="about_description">GPS sledovací aplikace pracující v reálném čase pro zařízení s operačním systémem Android. Kompatibilní s Traccar serverem a dalšími sledovacími systémy.</string>
<string name="about_license">Tato aplikace je zdarma a open source, zdrojový kód je licencován pod Apache License Version 2.0 a je přístupný na GitHub.</string>
<string name="about_web">Pro více informací navštivte\nwww.traccar.org/client</string>
<string name="status_service_create">Služba vytvořena</string>
<string name="status_service_destroy">Služba zastavena</string>
<string name="status_send_fail">Odesílání selhalo</string>
<string name="status_location_update">Aktualizace pozice</string>
<string name="status_connectivity_change">Změna připojení</string>
</resources>
+4 -12
Просмотреть файл
@@ -1,9 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version='1.0' encoding='UTF-8'?>
<resources>
<string name="app_name">Traccar klient</string>
<string name="app_logo">Traccar</string>
<string name="settings_id_title">Indentificere Enhed</string>
<string name="settings_address_title">Server adresse</string>
<string name="settings_address_summary">Domænenavn eller IP adresse</string>
@@ -18,26 +16,20 @@
<string name="settings_status_on_summary">Service er aktiv</string>
<string name="settings_provider_title">Udbyder</string>
<string name="settings_provider_summary">Udbyder lokaliseringsdata</string>
<string-array name="settings_provider_names">
<item>GPS udbyder</item>
<item>Netværks udbyder</item>
<item>Mixet udbyder</item>
</string-array>
<string name="settings_provider_gps">GPS udbyder</string>
<string name="settings_provider_network">Netværks udbyder</string>
<string name="settings_provider_mixed">Mixet udbyder</string>
<string name="settings_foreground_title">Forgrunden tjeneste</string>
<string name="settings_foreground_summary">Øg tjeneste prioritet</string>
<string name="menu_status">Status</string>
<string name="menu_about">Om</string>
<string name="menu_clear">Tilbage</string>
<string name="about_description">Real tid`s GPS tracker for Android enheder. Kompatibel med Traccar Server og andre tracking systemer.</string>
<string name="about_license">Denne application er en fri og open source, source koden er licenseret under Apache License Version 2.0 og tilgængelig på GitHub.</string>
<string name="about_web">For mere information besøg\nwww.traccar.org/client</string>
<string name="status_service_create">Service oprettet</string>
<string name="status_service_destroy">Service ødelagt</string>
<string name="status_send_fail">Send fejl</string>
<string name="status_location_update">Placering opdateret</string>
<string name="status_connectivity_change">Connectivity forandring</string>
</resources>
+13 -16
Просмотреть файл
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version='1.0' encoding='UTF-8'?>
<resources>
<string name="app_name">Traccar für Android</string>
<string name="app_logo">Traccar</string>
<string name="shortcut_start">Traccar - Start</string>
<string name="shortcut_stop">Traccar - Stop</string>
<string name="settings_id_title">Gerätekennung</string>
<string name="settings_address_title">Serveradresse</string>
<string name="settings_address_summary">Domain oder IP Adresse</string>
@@ -18,26 +18,23 @@
<string name="settings_status_on_summary">Dienst aktiv</string>
<string name="settings_provider_title">Datenherkunft</string>
<string name="settings_provider_summary">Quelle der Positionen</string>
<string-array name="settings_provider_names">
<item>GPS</item>
<item>Netzwerk</item>
<item>Gemischt</item>
</string-array>
<string name="settings_foreground_title">Vordergrund service</string>
<string name="settings_foreground_summary">Erhöhen service priorität</string>
<string name="settings_provider_gps">GPS</string>
<string name="settings_provider_network">Netzwerk</string>
<string name="settings_provider_mixed">Gemischt</string>
<string name="settings_foreground_title">Vordergrund Service</string>
<string name="settings_foreground_summary">Servicepriorität erhöhen</string>
<string name="menu_status">Status</string>
<string name="menu_about">Über</string>
<string name="menu_shortcuts">Verknüpfung hinzufügen</string>
<string name="menu_clear">Leeren</string>
<string name="about_description">Echtzeit GPS Ortung für Android Geräte. Kompatibel mit Traccar Server und anderen Ortungsservern.</string>
<string name="about_license">Dieses Programm ist frei und Open Source. Es ist unter Apache Lizenz Version 2.0 lizenziert und ist auf GitHub verfügbar.</string>
<string name="about_web">Für weitere Informationen besuche uns auf \nwww.traccar.org/client</string>
<string name="about_web">Für weitere Informationen besuche uns auf www.traccar.org/client</string>
<string name="status_service_create">Dienst installiert</string>
<string name="status_service_destroy">Dienst zerstört</string>
<string name="status_service_destroy">Dienst gestoppt</string>
<string name="status_send_fail">Übertragung fehlerhaft</string>
<string name="status_location_update">Positionsupdate</string>
<string name="status_connectivity_change">Anschlusswechsel</string>
<string name="hidden_app_name">Geräteeinstellungen</string>
<string name="hidden_alert">Die App wurde versteckt. Um sie wieder zu öffnen, wähle 8722227 (TRACCAR).</string>
</resources>
+6 -14
Просмотреть файл
@@ -1,9 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version='1.0' encoding='UTF-8'?>
<resources>
<string name="app_name">Cliente Traccar</string>
<string name="app_logo">Traccar</string>
<string name="settings_id_title">Identificador de Dispositivo</string>
<string name="settings_address_title">Dirección Servidor</string>
<string name="settings_address_summary">Dominio o Dirección IP</string>
@@ -18,26 +16,20 @@
<string name="settings_status_on_summary">Servicio activado</string>
<string name="settings_provider_title">Proveedor de localización</string>
<string name="settings_provider_summary">Fuente de los datos de localización</string>
<string-array name="settings_provider_names">
<item>Proveedor GPS</item>
<item>Proveedor de red</item>
<item>Proveedor mixto</item>
</string-array>
<string name="settings_provider_gps">Proveedor GPS</string>
<string name="settings_provider_network">Proveedor de red</string>
<string name="settings_provider_mixed">Proveedor mixto</string>
<string name="settings_foreground_title">Servicio de primer plano</string>
<string name="settings_foreground_summary">Aumentar prioridad de servicio</string>
<string name="menu_status">Estado</string>
<string name="menu_about">Acerca de&#8230;</string>
<string name="menu_about">Acerca de</string>
<string name="menu_clear">Limpiar</string>
<string name="about_description">Rastreador GPS en tiempo real para dispositivos Android. Compatible con Servidore Traccar y otros sistemas de rastreo.</string>
<string name="about_license">Esta aplición es gratuíta y de código abierto. El código fuente está sometido a Licencia Apache Versión 2 y disponible en Github.</string>
<string name="about_web">Para más información visite\nwww.traccar.org/client</string>
<string name="status_service_create">Servicio creado</string>
<string name="status_service_destroy">Servicio destruído</string>
<string name="status_send_fail">Erro en el envío</string>
<string name="status_send_fail">Error en el envío</string>
<string name="status_location_update">Posición actualizada</string>
<string name="status_connectivity_change">Cambio conectividad</string>
</resources>
+12 -15
Просмотреть файл
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version='1.0' encoding='UTF-8'?>
<resources>
<string name="app_name">Traccar</string>
<string name="app_name">Client Traccar</string>
<string name="app_logo">Traccar</string>
<string name="shortcut_start">Traccar - Départ</string>
<string name="shortcut_stop">Traccar - Arrêt</string>
<string name="settings_id_title">Identifiant du périphérique</string>
<string name="settings_address_title">Adresse du serveur</string>
<string name="settings_address_summary">Nom de domaine ou adresse IP</string>
@@ -18,26 +18,23 @@
<string name="settings_status_on_summary">En marche</string>
<string name="settings_provider_title">Source de localisation</string>
<string name="settings_provider_summary">Source utilisée par le système afin d\'obtenir la localisation de l\'appareil</string>
<string-array name="settings_provider_names">
<item>Mode GPS uniquement</item>
<item>Mode cellulaire uniquement</item>
<item>Mode hybride</item>
</string-array>
<string name="settings_provider_gps">Mode GPS uniquement</string>
<string name="settings_provider_network">Mode cellulaire uniquement</string>
<string name="settings_provider_mixed">Mode hybride</string>
<string name="settings_foreground_title">Un service de premier plan</string>
<string name="settings_foreground_summary">Augmenter la priorité de service</string>
<string name="menu_status">Etat</string>
<string name="menu_about">A propos</string>
<string name="menu_shortcuts">Ajouter des raccourcis</string>
<string name="menu_clear">Effacer</string>
<string name="about_description">Suivi GPS en temps réels d\'appareils Android. Compatible avec le serveur Traccar ainsi que d\'autres plateformes de suivi.</string>
<string name="about_license">Cette application open source est gratuite. Le code source disponible sur GitHub est sous licence Apache Version 2.0.</string>
<string name="about_description">Suivi GPS en temps réels pour appareils Android. Compatible avec le serveur Traccar ainsi que d\'autres plateformes de suivi.</string>
<string name="about_license">Cette application open source est gratuite. Le code source est disponible sur GitHub est sous licence Apache Version 2.0.</string>
<string name="about_web">Pour plus dinformation, visitez le site: \nwww.traccar.org/client</string>
<string name="status_service_create">Service créé</string>
<string name="status_service_destroy">Service supprimé</string>
<string name="status_send_fail">Lenvoi de localisation a échoué</string>
<string name="status_location_update">Localisation mise à jour</string>
<string name="status_connectivity_change">Changement de connectivité</string>
<string name="hidden_app_name">Paramètres du périphérique</string>
<string name="hidden_alert">Cette application a été cachée. Pour l\'ouvrir à nouveau, composez le 8722227 (TRACCAR)</string>
</resources>
+37
Просмотреть файл
@@ -0,0 +1,37 @@
<?xml version='1.0' encoding='UTF-8'?>
<resources>
<string name="app_name">Traccar Client</string>
<string name="app_logo">Traccar</string>
<string name="settings_id_title">Identificativo dispositivo</string>
<string name="settings_address_title">Indrizzo server</string>
<string name="settings_address_summary">Nome del dominio o indizzo IP</string>
<string name="settings_port_title">Porta server</string>
<string name="settings_port_summary">Porta TCP del Tracking server</string>
<string name="settings_interval_title">Frequenza</string>
<string name="settings_interval_summary">Intervallo in secondi tra i messaggi</string>
<string name="settings_status_title">Stato del servizio</string>
<string name="settings_status_off">Start</string>
<string name="settings_status_on">Stop</string>
<string name="settings_status_off_summary">Servizio arrestatto</string>
<string name="settings_status_on_summary">Servizio avviato</string>
<string name="settings_provider_title">Posizione provider</string>
<string name="settings_provider_summary">Sorgente dei dati di localizzazione</string>
<string name="settings_provider_gps">GPS provider</string>
<string name="settings_provider_network">Network provider</string>
<string name="settings_provider_mixed">Mixed provider</string>
<string name="settings_foreground_title">Foreground service</string>
<string name="settings_foreground_summary">Aumenta la priorita` del servizio</string>
<string name="menu_status">Stato</string>
<string name="menu_about">About</string>
<string name="menu_clear">Pulisici</string>
<string name="about_description">Real time GPS tracker per dispositivi Android. Compatibile con Traccar Server e altri sistemi di tracking.</string>
<string name="about_license">Questa applicazione e` gratuita e open source, il codice sorgente e` sotto licenza Apache License Version 2.0 e disponibile su GitHub.</string>
<string name="about_web">Per maggiori informazioni visitate \nwww.traccar.org/client</string>
<string name="status_service_create">Servizio creato</string>
<string name="status_service_destroy">Servizio distrutto</string>
<string name="status_send_fail">Invio fallito</string>
<string name="status_location_update">Aggiornamento posizione</string>
<string name="status_connectivity_change">Connessione cambiata</string>
<string name="hidden_app_name">Impostazioni dispositivo</string>
<string name="hidden_alert">La app e` stata nascosta. Per aprirla nuovamente digita 8722227 (TRACCAR).</string>
</resources>
+40
Просмотреть файл
@@ -0,0 +1,40 @@
<?xml version='1.0' encoding='UTF-8'?>
<resources>
<string name="app_name">ລາວຈີພີເອສ໌ຄາຣ໌</string>
<string name="app_logo">ລາວຈີພີເອສ໌ຄາຣ໌</string>
<string name="shortcut_start">ລາວຈີພີເອສ໌ຄາຣ໌ - ເລີ່ມຕົ້ນ</string>
<string name="shortcut_stop">ລາວຈີພີເອສ໌ຄາຣ໌ - ຢຸດ</string>
<string name="settings_id_title">ໝາຍເລກອຸປະກອນ</string>
<string name="settings_address_title">ທີ່ຢູ່ຂອງເຊີເວີ້</string>
<string name="settings_address_summary">ໂດເມນເນມຫລື້ທີ່ຢູ່ໄອພີ</string>
<string name="settings_port_title">ພອດເຊີເວີ້</string>
<string name="settings_port_summary">ພອດ TCP ການຕິດຕາມເຊີເວີ້</string>
<string name="settings_interval_title">ລະດັບຄວາມຖີ່</string>
<string name="settings_interval_summary">ໄລຍະຫ່າງສົ່ງຂໍ້ຄວາມເປັນວິນາທີ</string>
<string name="settings_status_title">ສະຖານະໃຊ້ງານ</string>
<string name="settings_status_off">ເລີ່ມ</string>
<string name="settings_status_on">ຢຸດ</string>
<string name="settings_status_off_summary">ການໃຊ້ງານໄດ້ຢຸດລົງ</string>
<string name="settings_status_on_summary">ການໃຊ້ງານກຳລັງທຳງານຢູ່</string>
<string name="settings_provider_title">ຜູ້ໃຫ້ບໍລິການຈຸດພິກັດ</string>
<string name="settings_provider_summary">ແຫລ່ງຂອງຂໍ້ມູນພິກັດ</string>
<string name="settings_provider_gps">ຜູ້ໃຫ້ບໍລິການ GPS</string>
<string name="settings_provider_network">ຜູ້ໃຫ້ບໍລິການເຄື່ອຄ່າຍ</string>
<string name="settings_provider_mixed">ຜູ້ໃຫ້ບໍລິການແບບຮ່ວມກັນ</string>
<string name="settings_foreground_title">ເຊີວິດໂຟກຣາວດ໌</string>
<string name="settings_foreground_summary">ເພີ່ມເຊີວິດໄພອໍຣິດຕີ້</string>
<string name="menu_status">ສະຖານະ</string>
<string name="menu_about">ກ່ຽວກັບ</string>
<string name="menu_shortcuts">ເພີ່ມຊອດຄັດ</string>
<string name="menu_clear">ລົບລ້າງ</string>
<string name="about_description">ລາວຈີພີເອສຄາຣ໌ສຳລັບແອນດຣອຍ. ສາມາດໃຊ້ໄດ້ກັບລາວຈີພີເອສຄາຣ໌ເຊີເວີ້.</string>
<string name="about_license">ແອັບໂຕນີ້ສາມາດດາວໂຫລດໃຊ້ໄດ້ຟຣີໂດຍບໍ່ມີຄ່າໃຊ້ຈ່າຍຫຍັງ.</string>
<string name="about_web">ຂໍ້ມູນເພີ່ມເຕີມໄດ້ທີ່\nwww.traccar.org/client</string>
<string name="status_service_create">ການໃຊ້ງານໄດ້ຖືກສ້າງຂຶ້ນແລ້ວ</string>
<string name="status_service_destroy">ການໃຊ້ງານໄດ້ປີດລົງແລ້ວ</string>
<string name="status_send_fail">ມີຂໍ້ຜິດພາດໃນການສົ່ງຂໍ້ມູນ</string>
<string name="status_location_update">ສະຖານທີ່ພິກັດໄດ້ອັບເດດ</string>
<string name="status_connectivity_change">ການເຊື່ອມຕໍ່ມີການປ່ຽນແປງ</string>
<string name="hidden_app_name">ການຕັ້ງຄ່າອຸປະກອນ</string>
<string name="hidden_alert">ແອັບໂຕນີ້ໄດ້ຖືກຊ້ອນໄວ້. ຖ້າຢາກເປີດຂຶ້ນມາອີກຄັ້ງກະລຸນາກົດໝາຍເລກ 8722227 (TRACCAR).</string>
</resources>
+4 -12
Просмотреть файл
@@ -1,9 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version='1.0' encoding='UTF-8'?>
<resources>
<string name="app_name">Traccar Klient</string>
<string name="app_logo">Traccar</string>
<string name="settings_id_title">Enhetsidentifikasjon</string>
<string name="settings_address_title">Tjeneradresse</string>
<string name="settings_address_summary">Domenenavn eller IP-adresse</string>
@@ -18,26 +16,20 @@
<string name="settings_status_on_summary">Tjenesten kjører</string>
<string name="settings_provider_title">Lokaliseringsleverandør</string>
<string name="settings_provider_summary">Kilde for lokaliseringsdata</string>
<string-array name="settings_provider_names">
<item>GPS-lokalisering</item>
<item>Nettverkslokalisering</item>
<item>Blandet lokalisering</item>
</string-array>
<string name="settings_provider_gps">GPS-lokalisering</string>
<string name="settings_provider_network">Nettverkslokalisering</string>
<string name="settings_provider_mixed">Blandet lokalisering</string>
<string name="settings_foreground_title">Forgrunnen tjeneste</string>
<string name="settings_foreground_summary">Øk tjeneste prioritet</string>
<string name="menu_status">Status</string>
<string name="menu_about">Om</string>
<string name="menu_clear">Tøm</string>
<string name="about_description">Sanntids GPS-sporing for Android-enheter. Kompatible med Traccar Server og andre sporingssystemer.</string>
<string name="about_license">Dette programmet har fri og åpen kildekode; kildekoden er lisensiert under Apache License Version 2.0 og er tilgjengelig på GitHub.</string>
<string name="about_web">For mer informasjon besøk\nwww.traccar.org/client</string>
<string name="status_service_create">Tjeneste opprettet</string>
<string name="status_service_destroy">Tjeneste ødelagt</string>
<string name="status_send_fail">Sending mislyktes</string>
<string name="status_location_update">Plassering oppdatert</string>
<string name="status_connectivity_change">Tilkobling forandret</string>
</resources>
+4 -12
Просмотреть файл
@@ -1,9 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version='1.0' encoding='UTF-8'?>
<resources>
<string name="app_name">Cliente Traccar</string>
<string name="app_logo">Traccar</string>
<string name="settings_id_title">Identificador único</string>
<string name="settings_address_title">Endereço do servidor</string>
<string name="settings_address_summary">Nome do domínio ou endereço IP</string>
@@ -18,26 +16,20 @@
<string name="settings_status_on_summary">Serviço em execução</string>
<string name="settings_provider_title">Provedor de localização</string>
<string name="settings_provider_summary">Fonte dos dados de localização</string>
<string-array name="settings_provider_names">
<item>Provedor GPS</item>
<item>Provedor Rede</item>
<item>Provedor Misto</item>
</string-array>
<string name="settings_provider_gps">Provedor GPS</string>
<string name="settings_provider_network">Provedor Rede</string>
<string name="settings_provider_mixed">Provedor Misto</string>
<string name="settings_foreground_title">Serviço primeiro plano</string>
<string name="settings_foreground_summary">Aumentar a prioridade de serviço</string>
<string name="menu_status">Status</string>
<string name="menu_about">Sobre</string>
<string name="menu_clear">Limpar</string>
<string name="about_description">Rastreador GPS Real Time para dispositivos Android. Compatível com servidor Traccar e outros sistemas de rastreamento.</string>
<string name="about_license">Esta aplicação é livre e de código aberto, o código fonte é licenciado sob a licença Apache Versão 2.0 e disponível no GitHub.</string>
<string name="about_web">Para mais informações visite\nwww.traccar.org/client</string>
<string name="status_service_create">Serviço criado</string>
<string name="status_service_destroy">Serviço destruído</string>
<string name="status_send_fail">Falha no envio</string>
<string name="status_location_update">Localização atualizada</string>
<string name="status_connectivity_change">Mudança de conectividade</string>
</resources>
+4 -12
Просмотреть файл
@@ -1,9 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version='1.0' encoding='UTF-8'?>
<resources>
<string name="app_name">Traccar Клиент</string>
<string name="app_logo">Traccar</string>
<string name="settings_id_title">Идентификатор устройства</string>
<string name="settings_address_title">Адрес сервера</string>
<string name="settings_address_summary">Домен или IP адрес</string>
@@ -18,26 +16,20 @@
<string name="settings_status_on_summary">Сервис запущен</string>
<string name="settings_provider_title">Провайдер местоположения</string>
<string name="settings_provider_summary">Источник данных о местоположении</string>
<string-array name="settings_provider_names">
<item>GPS провайдер</item>
<item>Сетевой провайдер</item>
<item>Смешанный провайдер</item>
</string-array>
<string name="settings_provider_gps">GPS провайдер</string>
<string name="settings_provider_network">Сетевой провайдер</string>
<string name="settings_provider_mixed">Смешанный провайдер</string>
<string name="settings_foreground_title">Приоритетный сервис</string>
<string name="settings_foreground_summary">Увеличить приоритет сервиса</string>
<string name="menu_status">Состояние</string>
<string name="menu_about">О программе</string>
<string name="menu_clear">Очистить</string>
<string name="about_description">Трекер для Android устройств. Совместим с Traccar сервером и другими мониторинговыми системами.</string>
<string name="about_license">Это приложение распростаняется бесплатно, исходный код распростаняется по лицензии Apache License Version 2.0 и доступен на GitHub.</string>
<string name="about_web">Для получения дополнительной информации посетите\nwww.traccar.org/client</string>
<string name="status_service_create">Сервис создан</string>
<string name="status_service_destroy">Сервис удален</string>
<string name="status_send_fail">Ошибка отправки</string>
<string name="status_location_update">Обновление местоположения</string>
<string name="status_connectivity_change">Изменение подключения</string>
</resources>
+10 -13
Просмотреть файл
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version='1.0' encoding='UTF-8'?>
<resources>
<string name="app_name">Traccar klijent</string>
<string name="app_logo">Traccar</string>
<string name="shortcut_start">Traccar - Start</string>
<string name="shortcut_stop">Traccar - Stop</string>
<string name="settings_id_title">Identifikator uređaja</string>
<string name="settings_address_title">Adresa servera</string>
<string name="settings_address_summary">Domen ime ili IP adresa</string>
@@ -18,26 +18,23 @@
<string name="settings_status_on_summary">Servis pokrenut</string>
<string name="settings_provider_title">Provajder lokacije</string>
<string name="settings_provider_summary">Izvor lokacijskih podataka</string>
<string-array name="settings_provider_names">
<item>GPS provajder</item>
<item>Provajder Mreže</item>
<item>Oba zajedno provajdera</item>
</string-array>
<string name="settings_provider_gps">GPS provajder</string>
<string name="settings_provider_network">Provajder Mreže</string>
<string name="settings_provider_mixed">Oba zajedno provajdera</string>
<string name="settings_foreground_title">Prvi plan servis</string>
<string name="settings_foreground_summary">Povecanje usluga prioritet</string>
<string name="menu_status">Status</string>
<string name="menu_about">O klijentu</string>
<string name="menu_shortcuts">Dodaj prečice</string>
<string name="menu_clear">Očisti</string>
<string name="about_description">GPS tracker za Android telefone. GPS satelit kompatibilno.</string>
<string name="about_license">Ova aplikacija je besplatna i open source,izvorni kod je licenciran pod Apache License Version 2.0 i dostupan na GitHub</string>
<string name="about_web">"Za više informacija www.traccar.org/client "</string>
<string name="about_web">Za više informacija www.traccar.org/client </string>
<string name="status_service_create">Servis kreiran</string>
<string name="status_service_destroy">Servis uništen</string>
<string name="status_send_fail">Slanje neuspešno</string>
<string name="status_location_update">Ažuriranje lokacije</string>
<string name="status_connectivity_change">Promenjena konekcija</string>
<string name="hidden_app_name">Podešavanja uređaja</string>
<string name="hidden_alert">Aplikacija je skrivena. Da je otvorite kucajte 8722227 (TRACCAR).</string>
</resources>
+12 -13
Просмотреть файл
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version='1.0' encoding='UTF-8'?>
<resources>
<string name="app_name">Traccar Client</string>
<string name="app_logo">Traccar</string>
<string name="shortcut_start">Traccar - Start</string>
<string name="shortcut_stop">Traccar - Stop</string>
<string name="settings_id_title">Device identifier</string>
<string name="settings_address_title">Server address</string>
<string name="settings_address_summary">Domain name or IP address</string>
@@ -16,31 +16,30 @@
<string name="settings_status_on">Stop</string>
<string name="settings_status_off_summary">Service stopped</string>
<string name="settings_status_on_summary">Service running</string>
<string name="settings_secure_title">Encryption</string>
<string name="settings_secure_off">Enable</string>
<string name="settings_secure_on">Disable</string>
<string name="settings_secure_off_summary">Encryption disabled</string>
<string name="settings_secure_on_summary">Encryption enabled</string>
<string name="settings_provider_title">Location provider</string>
<string name="settings_provider_summary">Source of location data</string>
<string-array name="settings_provider_names">
<item>GPS provider</item>
<item>Network provider</item>
<item>Mixed provider</item>
</string-array>
<string name="settings_provider_gps">GPS provider</string>
<string name="settings_provider_network">Network provider</string>
<string name="settings_provider_mixed">Mixed provider</string>
<string name="settings_foreground_title">Foreground service</string>
<string name="settings_foreground_summary">Increase service priority</string>
<string name="menu_status">Status</string>
<string name="menu_about">About</string>
<string name="menu_shortcuts">Add shortcuts</string>
<string name="menu_clear">Clear</string>
<string name="about_description">Real time GPS tracker for Android devices. Compatible with Traccar Server and other tracking systems.</string>
<string name="about_license">This application is free and open source, source code is licensed under Apache License Version 2.0 and available on GitHub.</string>
<string name="about_web">For more information visit\nwww.traccar.org/client</string>
<string name="status_service_create">Service created</string>
<string name="status_service_destroy">Service destroyed</string>
<string name="status_send_fail">Send failed</string>
<string name="status_location_update">Location update</string>
<string name="status_connectivity_change">Connectivity change</string>
<string name="hidden_app_name">Device Settings</string>
<string name="hidden_alert">The app has been hidden. To open it again please dial 8722227 (TRACCAR).</string>
</resources>
+6
Просмотреть файл
@@ -7,4 +7,10 @@
<item>mixed</item>
</string-array>
<string-array name="settings_provider_names">
<item>@string/settings_provider_gps</item>
<item>@string/settings_provider_network</item>
<item>@string/settings_provider_mixed</item>
</string-array>
</resources>
+9
Просмотреть файл
@@ -27,6 +27,15 @@
android:summary="@string/settings_port_summary"
android:title="@string/settings_port_title" />
<SwitchPreference
android:defaultValue="false"
android:key="secure"
android:summaryOff="@string/settings_secure_off_summary"
android:summaryOn="@string/settings_secure_on_summary"
android:switchTextOff="@string/settings_secure_off"
android:switchTextOn="@string/settings_secure_on"
android:title="@string/settings_secure_title" />
<EditTextPreference
android:defaultValue="300"
android:key="interval"
+7
Просмотреть файл
@@ -25,6 +25,13 @@
android:summary="@string/settings_port_summary"
android:title="@string/settings_port_title" />
<CheckBoxPreference
android:defaultValue="false"
android:key="secure"
android:summaryOff="@string/settings_secure_off_summary"
android:summaryOn="@string/settings_secure_on_summary"
android:title="@string/settings_secure_title" />
<EditTextPreference
android:defaultValue="300"
android:key="interval"
Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 3.5 KiB

После

Ширина:  |  Высота:  |  Размер: 3.3 KiB

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 2.2 KiB

После

Ширина:  |  Высота:  |  Размер: 2.0 KiB

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 4.8 KiB

После

Ширина:  |  Высота:  |  Размер: 4.7 KiB

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 7.4 KiB

После

Ширина:  |  Высота:  |  Размер: 7.5 KiB

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 10 KiB

После

Ширина:  |  Высота:  |  Размер: 11 KiB

+1 -1
Просмотреть файл
@@ -22,7 +22,7 @@ public class ProtocolFormatterTest {
Position position = new Position("123456789012345", new Location("gps"), 0);
position.setTime(new Date(0));
String url = ProtocolFormatter.formatRequest("localhost", 5055, position);
String url = ProtocolFormatter.formatRequest("localhost", 5055, false, position);
assertEquals("http://localhost:5055?id=123456789012345&timestamp=0&lat=0.0&lon=0.0&speed=0.0&bearing=0.0&altitude=0.0&batt=0.0", url);
+1 -1
Просмотреть файл
@@ -5,7 +5,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.3.0'
classpath 'com.android.tools.build:gradle:2.2.0'
}
}
+1 -2
Просмотреть файл
@@ -1,6 +1,5 @@
#Wed Aug 12 13:33:05 NZST 2015
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.6-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
Vendored
+90
Просмотреть файл
@@ -0,0 +1,90 @@
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windowz variants
if not "%OS%" == "Windows_NT" goto win9xME_args
if "%@eval[2+2]" == "4" goto 4NT_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
goto execute
:4NT_args
@rem Get arguments from the 4NT Shell from JP Software
set CMD_LINE_ARGS=%$
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega
Executable
+41
Просмотреть файл
@@ -0,0 +1,41 @@
#!/usr/bin/python
import os
import optparse
import urllib2
import json
import base64
parser = optparse.OptionParser()
parser.add_option("-u", "--user", dest="username", help="transifex user login")
parser.add_option("-p", "--password", dest="password", help="transifex user password")
(options, args) = parser.parse_args()
if not options.username or not options.password:
parser.error('User name and password are required')
os.chdir(os.path.dirname(os.path.abspath(__file__)))
path = "./app/src/main/res/"
def request(url):
req = urllib2.Request(url)
auth = base64.encodestring("%s:%s" % (options.username, options.password)).replace("\n", "")
req.add_header("Authorization", "Basic %s" % auth)
return urllib2.urlopen(req)
resource = json.load(request("https://www.transifex.com/api/2/project/traccar/resource/client-android/?details"))
for language in resource["available_languages"]:
code = language["code"]
data = request("https://www.transifex.com/api/2/project/traccar/resource/client-android/translation/" + code + "?file")
if code == "en":
filename = path + "values/strings.xml"
else:
filename = path + "values-" + code.replace("_", "-") + "/strings.xml"
if not os.path.exists(os.path.dirname(filename)):
os.makedirs(os.path.dirname(filename))
file = open(filename, "wb")
file.write(data.read())
file.close()