Сравнить коммиты
| Автор | SHA1 | Дата | |
|---|---|---|---|
|
|
5a99be4005 | ||
|
|
255598b7e8 | ||
|
|
6c29113278 | ||
|
|
a861b71d02 | ||
|
|
370e9778b4 | ||
|
|
efdaf69d07 | ||
|
|
3dbdaeb555 | ||
|
|
806a31cd92 | ||
|
|
fa4654c969 | ||
|
|
624eefc309 | ||
|
|
7ab99da14c | ||
|
|
532a1f4249 | ||
|
|
c3986ac172 | ||
|
|
fae01757b6 | ||
|
|
4f1af00383 | ||
|
|
4c4192394f | ||
|
|
3d602aaf16 | ||
|
|
acf935dcfd | ||
|
|
bb49b11bf4 | ||
|
|
b72b7dfa6f | ||
|
|
c4d4e9ff40 | ||
|
|
bcfa577e91 | ||
|
|
ac1ca8df2f | ||
|
|
e0dfc8fe66 | ||
|
|
7dc7f32110 | ||
|
|
6bffc7bbc1 | ||
|
|
aaa6092501 | ||
|
|
8cd3601a4f | ||
|
|
088adcaa24 | ||
|
|
0365837e4d | ||
|
|
f952e16c00 | ||
|
|
b7fb6445ef | ||
|
|
bc3f47e296 | ||
|
|
c60f749a67 | ||
|
|
821f24ce2b | ||
|
|
62c713e97a | ||
|
|
ab587d465e | ||
|
|
f82e89409d | ||
|
|
7e6d4f5822 | ||
|
|
b8a099189e | ||
|
|
e961df85d5 | ||
|
|
44648cf142 | ||
|
|
d916bf432e | ||
|
|
09a62e639e | ||
|
|
d1912bd430 | ||
|
|
052320f981 | ||
|
|
140a3ebece | ||
|
|
603e7bb3e0 | ||
|
|
f81db810ff | ||
|
|
1ca71f80c6 | ||
|
|
5d101b6f6e | ||
|
|
dc949e0152 | ||
|
|
96d9127a4a | ||
|
|
2194290935 | ||
|
|
78bf7f3169 | ||
|
|
e2d0329635 | ||
|
|
a64da65c6f | ||
|
|
8a3d86c173 | ||
|
|
c78cac2da5 | ||
|
|
5f7a1a8bfd | ||
|
|
16f743e90a | ||
|
|
429dda1e37 | ||
|
|
0ac173c043 | ||
|
|
9ae90d2edc | ||
|
|
27a99a6af1 |
@@ -1,7 +1,5 @@
|
||||
.gradle
|
||||
.idea/
|
||||
local.properties
|
||||
traccar-client-android.iml
|
||||
app/app.iml
|
||||
*.iml
|
||||
build/
|
||||
app/build/
|
||||
|
||||
@@ -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.
|
||||
@@ -1,5 +1,7 @@
|
||||
# [Traccar Client for Android](https://www.traccar.org/client)
|
||||
|
||||
[](https://play.google.com/store/apps/details?id=org.traccar.client)
|
||||
|
||||
## Contacts
|
||||
|
||||
Author - Anton Tananaev ([anton.tananaev@gmail.com](mailto:anton.tananaev@gmail.com))
|
||||
|
||||
@@ -1,45 +1,40 @@
|
||||
apply plugin: 'com.android.application'
|
||||
|
||||
android {
|
||||
compileSdkVersion 22
|
||||
buildToolsVersion "22.0.1"
|
||||
compileSdkVersion 24
|
||||
buildToolsVersion '23.0.3'
|
||||
|
||||
defaultConfig {
|
||||
minSdkVersion 3
|
||||
targetSdkVersion 22
|
||||
versionCode 25
|
||||
versionName "3.5"
|
||||
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"
|
||||
}
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
signingConfig signingConfigs.release
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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("packageRelease")) {
|
||||
theTask.dependsOn "requestPasswords"
|
||||
}
|
||||
testCompile 'org.robolectric:robolectric:3.0'
|
||||
}
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<uses-permission android:name="android.permission.PROCESS_OUTGOING_CALLS" />
|
||||
|
||||
<application
|
||||
android:label="@string/hidden_app_name"
|
||||
tools:replace="label">
|
||||
|
||||
<receiver android:name="org.traccar.client.DialLaunchReceiver" >
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.NEW_OUTGOING_CALL" />
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
|
После Ширина: | Высота: | Размер: 5.5 KiB |
|
После Ширина: | Высота: | Размер: 3.3 KiB |
|
После Ширина: | Высота: | Размер: 8.0 KiB |
|
После Ширина: | Высота: | Размер: 14 KiB |
|
После Ширина: | Высота: | Размер: 20 KiB |
@@ -6,27 +6,43 @@
|
||||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
<uses-permission android:name="android.permission.READ_PHONE_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:label="@string/app_name" android:icon="@drawable/ic_launcher" android:allowBackup="true" android:theme="@style/TraccarTheme">
|
||||
<application
|
||||
android:allowBackup="true"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:label="@string/app_name"
|
||||
android:theme="@style/TraccarTheme"
|
||||
android:name=".MainApplication">
|
||||
|
||||
<activity android:name=".MainActivity">
|
||||
<activity android:name=".MainActivity" android:launchMode="singleTask" />
|
||||
|
||||
<activity-alias
|
||||
android:name=".Launcher"
|
||||
android:targetActivity=".MainActivity">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
</activity-alias>
|
||||
|
||||
<activity android:name=".StatusActivity">
|
||||
</activity>
|
||||
<activity android:name=".StatusActivity"/>
|
||||
|
||||
<activity android:name=".AboutActivity">
|
||||
<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" />
|
||||
|
||||
<receiver android:name=".AutostartReceiver">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.BOOT_COMPLETED" />
|
||||
|
||||
@@ -31,8 +31,7 @@ public class DatabaseHelper extends SQLiteOpenHelper {
|
||||
public static final String DATABASE_NAME = "traccar.db";
|
||||
|
||||
public interface DatabaseHandler<T> {
|
||||
void onSuccess(T result);
|
||||
void onFailure(RuntimeException error);
|
||||
void onComplete(boolean success, T result);
|
||||
}
|
||||
|
||||
private static abstract class DatabaseAsyncTask<T> extends AsyncTask<Void, Void, T> {
|
||||
@@ -58,11 +57,7 @@ public class DatabaseHelper extends SQLiteOpenHelper {
|
||||
|
||||
@Override
|
||||
protected void onPostExecute(T result) {
|
||||
if (error == null) {
|
||||
handler.onSuccess(result);
|
||||
} else {
|
||||
handler.onFailure(error);
|
||||
}
|
||||
handler.onComplete(error == null, result);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* Copyright 2015 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.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
|
||||
public class DialLaunchReceiver extends BroadcastReceiver {
|
||||
|
||||
private static final String LAUNCHER_NUMBER = "8722227"; // TRACCAR
|
||||
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
String phoneNumber = intent.getStringExtra(Intent.EXTRA_PHONE_NUMBER);
|
||||
if (phoneNumber.equals(LAUNCHER_NUMBER)) {
|
||||
setResultData(null);
|
||||
Intent appIntent = new Intent(context, MainActivity.class);
|
||||
appIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
context.startActivity(appIntent);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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,80 +15,179 @@
|
||||
*/
|
||||
package org.traccar.client;
|
||||
|
||||
import android.Manifest;
|
||||
import android.app.AlarmManager;
|
||||
import android.app.AlertDialog;
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.app.PendingIntent;
|
||||
import android.content.ComponentName;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.SharedPreferences.OnSharedPreferenceChangeListener;
|
||||
import android.location.LocationManager;
|
||||
import android.content.pm.PackageManager;
|
||||
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.telephony.TelephonyManager;
|
||||
import android.preference.TwoStatePreference;
|
||||
import android.util.Patterns;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Random;
|
||||
import java.util.Set;
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public class MainActivity extends PreferenceActivity implements OnSharedPreferenceChangeListener {
|
||||
|
||||
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";
|
||||
public static final String KEY_FOREGROUND = "foreground";
|
||||
|
||||
private boolean firstLaunch; // DELME
|
||||
private static final int PERMISSIONS_REQUEST_LOCATION = 2;
|
||||
|
||||
private SharedPreferences sharedPreferences;
|
||||
|
||||
private AlarmManager alarmManager;
|
||||
private PendingIntent alarmIntent;
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
firstLaunch = !PreferenceManager.getDefaultSharedPreferences(this).contains(KEY_PORT);
|
||||
|
||||
if (BuildConfig.HIDDEN_APP) {
|
||||
removeLauncherIcon();
|
||||
}
|
||||
|
||||
sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||
addPreferencesFromResource(R.xml.preferences);
|
||||
initPreferences();
|
||||
|
||||
if (getPreferenceScreen().getSharedPreferences().getBoolean(KEY_STATUS, false)) {
|
||||
setPreferencesEnabled(false);
|
||||
startService(new Intent(this, TrackingService.class));
|
||||
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() {
|
||||
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(
|
||||
componentName, PackageManager.COMPONENT_ENABLED_STATE_DISABLED, PackageManager.DONT_KILL_APP);
|
||||
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
||||
builder.setIcon(android.R.drawable.ic_dialog_alert);
|
||||
builder.setMessage(getString(R.string.hidden_alert));
|
||||
builder.setPositiveButton(android.R.string.ok, null);
|
||||
builder.show();
|
||||
}
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
return checkSelfPermission(permission) == PackageManager.PERMISSION_GRANTED;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
checkAndShowPortDialog(); // DELME
|
||||
getPreferenceScreen().getSharedPreferences().registerOnSharedPreferenceChangeListener(this);
|
||||
sharedPreferences.registerOnSharedPreferenceChangeListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPause() {
|
||||
super.onPause();
|
||||
getPreferenceScreen().getSharedPreferences().unregisterOnSharedPreferenceChangeListener(this);
|
||||
sharedPreferences.unregisterOnSharedPreferenceChangeListener(this);
|
||||
}
|
||||
|
||||
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);
|
||||
preferenceScreen.findPreference(KEY_FOREGROUND).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
|
||||
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
|
||||
if (key.equals(KEY_STATUS)) {
|
||||
if (sharedPreferences.getBoolean(KEY_STATUS, false)) {
|
||||
setPreferencesEnabled(false);
|
||||
startService(new Intent(this, TrackingService.class));
|
||||
startTrackingService(true, false);
|
||||
} else {
|
||||
stopService(new Intent(this, TrackingService.class));
|
||||
setPreferencesEnabled(true);
|
||||
stopTrackingService();
|
||||
}
|
||||
} else if (key.equals(KEY_DEVICE)) {
|
||||
findPreference(KEY_DEVICE).setSummary(sharedPreferences.getString(KEY_DEVICE, null));
|
||||
@@ -106,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;
|
||||
@@ -116,48 +219,69 @@ public class MainActivity extends PreferenceActivity implements OnSharedPreferen
|
||||
private void initPreferences() {
|
||||
PreferenceManager.setDefaultValues(this, R.xml.preferences, false);
|
||||
|
||||
TelephonyManager telephonyManager = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);
|
||||
String id = telephonyManager.getDeviceId();
|
||||
|
||||
SharedPreferences sharedPreferences = getPreferenceScreen().getSharedPreferences();
|
||||
|
||||
if (!sharedPreferences.contains(KEY_DEVICE)) {
|
||||
String id = String.valueOf(new Random().nextInt(900000) + 100000);
|
||||
sharedPreferences.edit().putString(KEY_DEVICE, id).commit();
|
||||
((EditTextPreference) findPreference(KEY_DEVICE)).setText(id);
|
||||
}
|
||||
findPreference(KEY_DEVICE).setSummary(sharedPreferences.getString(KEY_DEVICE, id));
|
||||
findPreference(KEY_DEVICE).setSummary(sharedPreferences.getString(KEY_DEVICE, null));
|
||||
}
|
||||
|
||||
// TEMPORARY PORT CHANGE DIALOG (DELME)
|
||||
private void startTrackingService(boolean checkPermission, boolean permission) {
|
||||
if (checkPermission) {
|
||||
Set<String> missingPermissions = new HashSet<>();
|
||||
if (!hasPermission(Manifest.permission.ACCESS_FINE_LOCATION)) {
|
||||
missingPermissions.add(Manifest.permission.ACCESS_FINE_LOCATION);
|
||||
}
|
||||
if (!hasPermission(Manifest.permission.ACCESS_COARSE_LOCATION)) {
|
||||
missingPermissions.add(Manifest.permission.ACCESS_COARSE_LOCATION);
|
||||
}
|
||||
if (missingPermissions.isEmpty()) {
|
||||
permission = true;
|
||||
} else {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||
requestPermissions(missingPermissions.toArray(new String[missingPermissions.size()]),
|
||||
PERMISSIONS_REQUEST_LOCATION);
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
private void checkAndShowPortDialog() {
|
||||
|
||||
String KEY_SHOWN_PORT_DIALOG = "portDialogHasBeenShown";
|
||||
|
||||
SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||
if (!preferences.getString(KEY_PORT, "5055").equals("5055")) {
|
||||
if (!firstLaunch) {
|
||||
if (!preferences.contains(KEY_SHOWN_PORT_DIALOG)) {
|
||||
showDialog(0);
|
||||
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) {
|
||||
TwoStatePreference preference = (TwoStatePreference) findPreference(KEY_STATUS);
|
||||
preference.setChecked(false);
|
||||
} else {
|
||||
CheckBoxPreference preference = (CheckBoxPreference) findPreference(KEY_STATUS);
|
||||
preference.setChecked(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
preferences.edit().putBoolean(KEY_SHOWN_PORT_DIALOG, true).commit();
|
||||
private void stopTrackingService() {
|
||||
alarmManager.cancel(alarmIntent);
|
||||
stopService(new Intent(this, TrackingService.class));
|
||||
setPreferencesEnabled(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Dialog onCreateDialog(int id) {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(this)
|
||||
.setMessage("Communication protocol used by the app has changed. Now it uses port 5055 on Traccar server. Do you want to change port to 5055?")
|
||||
.setPositiveButton("Yes", new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
PreferenceManager.getDefaultSharedPreferences(MainActivity.this).edit().putString(KEY_PORT, "5055").commit();
|
||||
public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {
|
||||
if (requestCode == PERMISSIONS_REQUEST_LOCATION) {
|
||||
boolean granted = true;
|
||||
for (int result : grantResults) {
|
||||
if (result != PackageManager.PERMISSION_GRANTED) {
|
||||
granted = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
startTrackingService(false, granted);
|
||||
}
|
||||
})
|
||||
.setNegativeButton("No", null);
|
||||
|
||||
return builder.create();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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() {
|
||||
|
||||
@@ -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()));
|
||||
|
||||
@@ -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()))
|
||||
|
||||
@@ -27,8 +27,7 @@ public class RequestManager {
|
||||
private static final int TIMEOUT = 15 * 1000;
|
||||
|
||||
public interface RequestHandler {
|
||||
void onSuccess();
|
||||
void onFailure();
|
||||
void onComplete(boolean success);
|
||||
}
|
||||
|
||||
private static class RequestAsyncTask extends AsyncTask<String, Void, Boolean> {
|
||||
@@ -46,11 +45,7 @@ public class RequestManager {
|
||||
|
||||
@Override
|
||||
protected void onPostExecute(Boolean result) {
|
||||
if (result) {
|
||||
handler.onSuccess();
|
||||
} else {
|
||||
handler.onFailure();
|
||||
}
|
||||
handler.onComplete(result);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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() {
|
||||
|
||||
@@ -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;
|
||||
@@ -35,6 +36,10 @@ public class TrackingController implements PositionProvider.PositionListener, Ne
|
||||
private Handler handler;
|
||||
private SharedPreferences preferences;
|
||||
|
||||
private String address;
|
||||
private int port;
|
||||
private boolean secure;
|
||||
|
||||
private PositionProvider positionProvider;
|
||||
private DatabaseHelper databaseHelper;
|
||||
private NetworkManager networkManager;
|
||||
@@ -42,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()) {
|
||||
@@ -55,7 +64,7 @@ public class TrackingController implements PositionProvider.PositionListener, Ne
|
||||
this.context = context;
|
||||
handler = new Handler();
|
||||
preferences = PreferenceManager.getDefaultSharedPreferences(context);
|
||||
if (preferences.getString(MainActivity.KEY_PROVIDER, null).equals("mixed")) {
|
||||
if (preferences.getString(MainActivity.KEY_PROVIDER, "gps").equals("mixed")) {
|
||||
positionProvider = new MixedPositionProvider(context, this);
|
||||
} else {
|
||||
positionProvider = new SimplePositionProvider(context, this);
|
||||
@@ -64,6 +73,10 @@ public class TrackingController implements PositionProvider.PositionListener, Ne
|
||||
networkManager = new NetworkManager(context, this);
|
||||
isOnline = networkManager.isOnline();
|
||||
|
||||
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());
|
||||
}
|
||||
@@ -72,26 +85,35 @@ 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);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPositionUpdate(Position position) {
|
||||
if (position != null) {
|
||||
StatusActivity.addMessage(context.getString(R.string.status_location_update));
|
||||
if (position != null) {
|
||||
write(position);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNetworkUpdate(boolean isOnline) {
|
||||
StatusActivity.addMessage(context.getString(R.string.status_connectivity_change));
|
||||
if (!this.isOnline && isOnline) {
|
||||
read();
|
||||
}
|
||||
@@ -122,16 +144,13 @@ public class TrackingController implements PositionProvider.PositionListener, Ne
|
||||
lock();
|
||||
databaseHelper.insertPositionAsync(position, new DatabaseHelper.DatabaseHandler<Void>() {
|
||||
@Override
|
||||
public void onSuccess(Void result) {
|
||||
public void onComplete(boolean success, Void result) {
|
||||
if (success) {
|
||||
if (isOnline && isWaiting) {
|
||||
read();
|
||||
isWaiting = false;
|
||||
}
|
||||
unlock();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(RuntimeException error) {
|
||||
unlock();
|
||||
}
|
||||
});
|
||||
@@ -142,18 +161,20 @@ public class TrackingController implements PositionProvider.PositionListener, Ne
|
||||
lock();
|
||||
databaseHelper.selectPositionAsync(new DatabaseHelper.DatabaseHandler<Position>() {
|
||||
@Override
|
||||
public void onSuccess(Position result) {
|
||||
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;
|
||||
}
|
||||
unlock();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(RuntimeException error) {
|
||||
} else {
|
||||
retry();
|
||||
}
|
||||
unlock();
|
||||
}
|
||||
});
|
||||
@@ -164,14 +185,12 @@ public class TrackingController implements PositionProvider.PositionListener, Ne
|
||||
lock();
|
||||
databaseHelper.deletePositionAsync(position.getId(), new DatabaseHelper.DatabaseHandler<Void>() {
|
||||
@Override
|
||||
public void onSuccess(Void result) {
|
||||
public void onComplete(boolean success, Void result) {
|
||||
if (success) {
|
||||
read();
|
||||
unlock();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(RuntimeException error) {
|
||||
} else {
|
||||
retry();
|
||||
}
|
||||
unlock();
|
||||
}
|
||||
});
|
||||
@@ -180,22 +199,16 @@ public class TrackingController implements PositionProvider.PositionListener, Ne
|
||||
private void send(final Position position) {
|
||||
log("send", position);
|
||||
lock();
|
||||
String request = ProtocolFormatter.formatRequest(
|
||||
preferences.getString(MainActivity.KEY_ADDRESS, null),
|
||||
Integer.parseInt(preferences.getString(MainActivity.KEY_PORT, null)),
|
||||
position);
|
||||
|
||||
String request = ProtocolFormatter.formatRequest(address, port, secure, position);
|
||||
RequestManager.sendRequestAsync(request, new RequestManager.RequestHandler() {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
public void onComplete(boolean success) {
|
||||
if (success) {
|
||||
delete(position);
|
||||
unlock();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure() {
|
||||
} else {
|
||||
StatusActivity.addMessage(context.getString(R.string.status_send_fail));
|
||||
retry();
|
||||
}
|
||||
unlock();
|
||||
}
|
||||
});
|
||||
|
||||
@@ -19,12 +19,15 @@ import android.annotation.TargetApi;
|
||||
import android.app.Notification;
|
||||
import android.app.PendingIntent;
|
||||
import android.app.Service;
|
||||
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;
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
public class TrackingService extends Service {
|
||||
|
||||
private static final String TAG = TrackingService.class.getSimpleName();
|
||||
@@ -32,7 +35,49 @@ public class TrackingService extends Service {
|
||||
|
||||
private TrackingController trackingController;
|
||||
|
||||
private boolean foreground;
|
||||
@SuppressWarnings("deprecation")
|
||||
private static Notification createNotification(Context context) {
|
||||
Intent notificationIntent = new Intent(context, MainActivity.class);
|
||||
PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, notificationIntent, 0);
|
||||
|
||||
Notification notification = new Notification(android.R.drawable.stat_notify_sync_noanim, null, 0);
|
||||
try {
|
||||
Method method = notification.getClass().getMethod("setLatestEventInfo", Context.class, CharSequence.class, CharSequence.class, PendingIntent.class);
|
||||
try {
|
||||
method.invoke(notification, context, context.getString(R.string.app_name), context.getString(R.string.settings_status_on_summary), pendingIntent);
|
||||
} catch (IllegalArgumentException | IllegalAccessException | InvocationTargetException e) {
|
||||
Log.w(TAG, e);
|
||||
}
|
||||
} catch (SecurityException | NoSuchMethodException e) {
|
||||
Log.w(TAG, e);
|
||||
}
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) {
|
||||
notification.priority = Notification.PRIORITY_MIN;
|
||||
}
|
||||
|
||||
return notification;
|
||||
}
|
||||
|
||||
@TargetApi(Build.VERSION_CODES.ECLAIR)
|
||||
public static class HideNotificationService extends Service {
|
||||
@Override
|
||||
public IBinder onBind(Intent intent) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate() {
|
||||
startForeground(NOTIFICATION_ID, createNotification(this));
|
||||
stopForeground(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int onStartCommand(Intent intent, int flags, int startId) {
|
||||
stopSelfResult(startId);
|
||||
return START_NOT_STICKY;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate() {
|
||||
@@ -42,7 +87,10 @@ public class TrackingService extends Service {
|
||||
trackingController = new TrackingController(this);
|
||||
trackingController.start();
|
||||
|
||||
foreground = PreferenceManager.getDefaultSharedPreferences(this).getBoolean(MainActivity.KEY_FOREGROUND, false);
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ECLAIR) {
|
||||
startForeground(NOTIFICATION_ID, createNotification(this));
|
||||
startService(new Intent(this, HideNotificationService.class));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -56,17 +104,6 @@ public class TrackingService extends Service {
|
||||
if (intent != null) {
|
||||
AutostartReceiver.completeWakefulIntent(intent);
|
||||
}
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ECLAIR && foreground) {
|
||||
Intent notificationIntent = new Intent(this, MainActivity.class);
|
||||
PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, notificationIntent, 0);
|
||||
|
||||
Notification notification = new Notification(android.R.drawable.stat_notify_sync_noanim, null, 0);
|
||||
notification.setLatestEventInfo(
|
||||
this, getString(R.string.app_name), getString(R.string.settings_status_on_summary), pendingIntent);
|
||||
|
||||
startForeground(NOTIFICATION_ID, notification);
|
||||
}
|
||||
}
|
||||
|
||||
@TargetApi(Build.VERSION_CODES.ECLAIR)
|
||||
@@ -81,7 +118,7 @@ public class TrackingService extends Service {
|
||||
Log.i(TAG, "service destroy");
|
||||
StatusActivity.addMessage(getString(R.string.status_service_destroy));
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ECLAIR && foreground) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ECLAIR) {
|
||||
stopForeground(true);
|
||||
}
|
||||
|
||||
|
||||
|
До Ширина: | Высота: | Размер: 3.5 KiB |
|
После Ширина: | Высота: | Размер: 3.6 KiB |
|
До Ширина: | Высота: | Размер: 1.7 KiB |
|
До Ширина: | Высота: | Размер: 2.2 KiB |
|
После Ширина: | Высота: | Размер: 2.4 KiB |
|
До Ширина: | Высота: | Размер: 4.8 KiB |
|
После Ширина: | Высота: | Размер: 4.8 KiB |
|
До Ширина: | Высота: | Размер: 7.4 KiB |
|
После Ширина: | Высота: | Размер: 7.2 KiB |
|
До Ширина: | Высота: | Размер: 10 KiB |
@@ -13,7 +13,7 @@
|
||||
android:layout_marginLeft="@dimen/about_margin"
|
||||
android:layout_marginStart="@dimen/about_margin"
|
||||
android:layout_marginTop="@dimen/about_margin"
|
||||
android:src="@drawable/ic_launcher"
|
||||
android:src="@drawable/logo"
|
||||
android:contentDescription="@string/app_logo" />
|
||||
|
||||
<LinearLayout
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
|
||||
@@ -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…</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>
|
||||
|
||||
@@ -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 d’information, 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">L’envoi 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>
|
||||
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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,28 +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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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"
|
||||
@@ -42,10 +51,4 @@
|
||||
android:summary="@string/settings_provider_summary"
|
||||
android:title="@string/settings_provider_title" />
|
||||
|
||||
<CheckBoxPreference
|
||||
android:defaultValue="true"
|
||||
android:key="foreground"
|
||||
android:summary="@string/settings_foreground_summary"
|
||||
android:title="@string/settings_foreground_title" />
|
||||
|
||||
</PreferenceScreen>
|
||||
@@ -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"
|
||||
@@ -40,10 +47,4 @@
|
||||
android:summary="@string/settings_provider_summary"
|
||||
android:title="@string/settings_provider_title" />
|
||||
|
||||
<CheckBoxPreference
|
||||
android:defaultValue="true"
|
||||
android:key="foreground"
|
||||
android:summary="@string/settings_foreground_summary"
|
||||
android:title="@string/settings_foreground_title" />
|
||||
|
||||
</PreferenceScreen>
|
||||
|
||||
|
После Ширина: | Высота: | Размер: 3.3 KiB |
|
После Ширина: | Высота: | Размер: 2.0 KiB |
|
После Ширина: | Высота: | Размер: 4.7 KiB |
|
После Ширина: | Высота: | Размер: 7.5 KiB |
|
После Ширина: | Высота: | Размер: 11 KiB |
@@ -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×tamp=0&lat=0.0&lon=0.0&speed=0.0&bearing=0.0&altitude=0.0&batt=0.0", url);
|
||||
|
||||
|
||||
@@ -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,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
|
||||
|
||||
@@ -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
|
||||
@@ -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()
|
||||