diff --git a/app/src/main/java/at/bitfire/davdroid/log/ExternalFileLogger.java b/app/src/main/java/at/bitfire/davdroid/log/ExternalFileLogger.java
index 0cbd28b2..189bff87 100644
--- a/app/src/main/java/at/bitfire/davdroid/log/ExternalFileLogger.java
+++ b/app/src/main/java/at/bitfire/davdroid/log/ExternalFileLogger.java
@@ -8,6 +8,7 @@
package at.bitfire.davdroid.log;
+import android.app.Activity;
import android.content.Context;
import java.io.Closeable;
@@ -20,7 +21,7 @@ public class ExternalFileLogger extends CustomLogger implements Closeable {
public ExternalFileLogger(Context context, String fileName, boolean verbose) throws IOException {
this.verbose = verbose;
- File dir = context.getExternalFilesDir(null);
+ File dir = getDirectory(context);
if (dir == null)
throw new IOException("External media not available for log creation");
@@ -28,10 +29,13 @@ public class ExternalFileLogger extends CustomLogger implements Closeable {
writer = new PrintWriter(log);
}
+ public static File getDirectory(Context context) {
+ return context.getExternalFilesDir(null);
+ }
+
@Override
public void close() throws IOException {
writer.close();
}
-
}
diff --git a/app/src/main/java/at/bitfire/davdroid/ui/DebugInfoActivity.java b/app/src/main/java/at/bitfire/davdroid/ui/DebugInfoActivity.java
index b01b9277..541d1c67 100644
--- a/app/src/main/java/at/bitfire/davdroid/ui/DebugInfoActivity.java
+++ b/app/src/main/java/at/bitfire/davdroid/ui/DebugInfoActivity.java
@@ -52,9 +52,7 @@ public class DebugInfoActivity extends Activity implements LoaderManager.LoaderC
super.onCreate(savedInstanceState);
setContentView(R.layout.debug_info_activity);
-
tvReport = (TextView)findViewById(R.id.text_report);
- //tvReport.setText(report = generateReport(getIntent().getExtras()));
getLoaderManager().initLoader(0, getIntent().getExtras(), this);
}
@@ -186,9 +184,10 @@ public class DebugInfoActivity extends Activity implements LoaderManager.LoaderC
" Account: " + acc.name + "\n" +
" Address book synchronization: " + syncStatus(acc, ContactsContract.AUTHORITY) + "\n" +
" Calendar synchronization: " + syncStatus(acc, CalendarContract.AUTHORITY) + "\n" +
- " OpenTasks synchronization: " + syncStatus(acc, "org.dmfs.tasks") + "\n\n"
+ " OpenTasks synchronization: " + syncStatus(acc, "org.dmfs.tasks") + "\n"
);
}
+ report.append("\n");
try {
report.append(
diff --git a/app/src/main/java/at/bitfire/davdroid/ui/MainActivity.java b/app/src/main/java/at/bitfire/davdroid/ui/MainActivity.java
index 35a520c0..0ba80677 100644
--- a/app/src/main/java/at/bitfire/davdroid/ui/MainActivity.java
+++ b/app/src/main/java/at/bitfire/davdroid/ui/MainActivity.java
@@ -11,7 +11,6 @@ import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
-import android.os.Debug;
import android.provider.Settings;
import android.text.Html;
import android.text.method.LinkMovementMethod;
@@ -29,23 +28,65 @@ import at.bitfire.davdroid.ui.setup.AddAccountActivity;
public class MainActivity extends Activity {
- @Override
+ private static final String libraries =
+ "· Apache Commons – Apache License, Version 2.0" +
+ "· dnsjava – BSD License" +
+ "· ez-vcard – New BSD License
" +
+ "· iCal4j – New BSD License
" +
+ "· MemorizingTrustManager – MIT License
" +
+ "· okhttp – Apache License, Version 2.0" +
+ "· Project Lombok – MIT License
" +
+ "· SLF4j (Simple Logging Facade for Java) – MIT License";
+
+ @Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main_activity);
- TextView tvWorkaround = (TextView)findViewById(R.id.text_workaround);
- if (fromPlayStore()) {
- tvWorkaround.setVisibility(View.VISIBLE);
- tvWorkaround.setText(Html.fromHtml(getString(R.string.html_main_workaround)));
- tvWorkaround.setMovementMethod(LinkMovementMethod.getInstance());
- }
-
- TextView tvInfo = (TextView)findViewById(R.id.text_info);
- tvInfo.setText(Html.fromHtml(getString(R.string.html_main_info, BuildConfig.VERSION_NAME)));
- tvInfo.setMovementMethod(LinkMovementMethod.getInstance());
- }
+ TextView tv = (TextView)findViewById(R.id.text_store_specific);
+ if (installedFrom("org.fdroid.fdroid"))
+ setHtmlText(R.id.text_store_specific, R.string.main_fdroid_donation_html);
+ else if (installedFrom("com.android.vending"))
+ setHtmlText(R.id.text_store_specific, R.string.main_play_workaround_html);
+
+ setPlainText(R.id.text_welcome, R.string.main_welcome, BuildConfig.VERSION_NAME);
+ setHtmlText(R.id.text_what_is_davdroid, R.string.main_what_is_davdroid_html);
+ setHtmlText(R.id.text_how_to_setup, R.string.main_how_to_setup_html);
+ setHtmlText(R.id.text_support, R.string.main_support_html);
+ setHtmlText(R.id.text_open_source_disclaimer, R.string.main_open_source_disclaimer_html);
+ setHtmlText(R.id.text_license, R.string.main_license_html);
+ setPlainText(R.id.text_libraries_heading, R.string.main_used_libraries_heading);
+ setHtmlText(R.id.text_libraries_list, libraries);
+ }
+
+ private void setPlainText(int viewId, int stringId, Object... args) {
+ TextView tv = (TextView)findViewById(viewId);
+ tv.setVisibility(View.VISIBLE);
+ tv.setText(getString(stringId, args));
+ }
+
+ private void setHtmlText(int viewId, int stringId, Object... args) {
+ TextView tv = (TextView)findViewById(viewId);
+ tv.setVisibility(View.VISIBLE);
+ tv.setText(trim(Html.fromHtml(getString(stringId, args))));
+ tv.setMovementMethod(LinkMovementMethod.getInstance());
+ }
+
+ private void setHtmlText(int viewId, String html) {
+ TextView tv = (TextView)findViewById(viewId);
+ tv.setVisibility(View.VISIBLE);
+ tv.setText(trim(Html.fromHtml(html)));
+ tv.setMovementMethod(LinkMovementMethod.getInstance());
+ }
+
+ private CharSequence trim(CharSequence text) {
+ while (text.charAt(text.length() - 1) == '\n') {
+ text = text.subSequence(0, text.length() - 1);
+ }
+ return text;
+ }
+
@Override
public boolean onCreateOptionsMenu(Menu menu) {
@@ -79,9 +120,9 @@ public class MainActivity extends Activity {
}
- private boolean fromPlayStore() {
+ private boolean installedFrom(String packageName) {
try {
- return "com.android.vending".equals(getPackageManager().getInstallerPackageName("at.bitfire.davdroid"));
+ return packageName.equals(getPackageManager().getInstallerPackageName("at.bitfire.davdroid"));
} catch(IllegalArgumentException e) {
return false;
}
diff --git a/app/src/main/java/at/bitfire/davdroid/ui/settings/AccountFragment.java b/app/src/main/java/at/bitfire/davdroid/ui/settings/AccountFragment.java
index 73523a0c..75f52445 100644
--- a/app/src/main/java/at/bitfire/davdroid/ui/settings/AccountFragment.java
+++ b/app/src/main/java/at/bitfire/davdroid/ui/settings/AccountFragment.java
@@ -12,6 +12,8 @@ import android.accounts.Account;
import android.app.AlertDialog;
import android.app.DialogFragment;
import android.content.DialogInterface;
+import android.content.Intent;
+import android.net.Uri;
import android.os.Bundle;
import android.preference.EditTextPreference;
import android.preference.ListPreference;
@@ -22,6 +24,7 @@ import android.provider.CalendarContract;
import android.provider.ContactsContract;
import at.bitfire.davdroid.R;
+import at.bitfire.davdroid.log.ExternalFileLogger;
import at.bitfire.davdroid.syncadapter.AccountSettings;
import at.bitfire.ical4android.TaskProvider;
@@ -140,10 +143,11 @@ public class AccountFragment extends PreferenceFragment {
final SwitchPreference prefLogExternalFile = (SwitchPreference)findPreference("log_external_file");
prefLogExternalFile.setChecked(settings.logToExternalFile());
+ prefLogExternalFile.setSummaryOn(getString(R.string.settings_log_to_external_file_on, ExternalFileLogger.getDirectory(getActivity()).getPath()));
prefLogExternalFile.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
@Override
public boolean onPreferenceChange(Preference preference, Object newValue) {
- Boolean external = (Boolean)newValue;
+ Boolean external = (Boolean) newValue;
if (external) {
getFragmentManager().beginTransaction()
.add(LogExternalFileDialogFragment.newInstance(account), null)
@@ -151,7 +155,8 @@ public class AccountFragment extends PreferenceFragment {
return false;
} else {
settings.logToExternalFile(false);
- refresh(); return false;
+ refresh();
+ return false;
}
}
});
diff --git a/app/src/main/res/layout/main_activity.xml b/app/src/main/res/layout/main_activity.xml
index eb418730..9e754f55 100644
--- a/app/src/main/res/layout/main_activity.xml
+++ b/app/src/main/res/layout/main_activity.xml
@@ -19,19 +19,73 @@
android:orientation="vertical" >
Möglicherweise verschwinden alle Ihre DAVdroid-Accounts samt Kontakten und Terminen nach einem Neustart - des Geräts. Die Ursache ist ein Fehler in Android, - der zur irrtümlichen Entfernung von Accounts von Bezahlapps bei einem Neustart führt, da die Prüfung auf verwaiste - und damit zu löschende Accounts schon *vor* dem Entschlüsseln der App erfolgt.
-Betroffene Benutzer*Innen:
- * alle mit Android 4.1, die DAVdroid über Play Store bezogen haben;
- * einige mit Android 4.2, die DAVdroid über Play Store bezogen und bestimmte Geräte haben (zB die meisten Samsung-Geräte)
Möglicherweise verschwinden alle Ihre DAVdroid-Accounts samt Kontakten und Terminen während eines - DAVdroid-Updates, das von Play Store durchgeführt wird. Die Ursache ist ein - anderer Fehler in Android, - der zur irrtümlichen Entfernung von Accounts von Bezahlapps bei der Aktualisierung dieser Apps führt.
-Betroffene Benutzer*Innen:
- einige mit Android 4.4.2, die DAVdroid über Play Store bezogen haben (bekannt sind Nexus-Geräte und Moto G)
Sollten Sie von einem dieser Fehler betroffen sein, installieren - Sie den DAVdroid JB Workaround.
- ]]>DAVdroid ist ein Android 4+-CalDAV/CardDAV-Sync-Adapter. Um ihn zu verwenden, müssen Sie ein DAVdroid-Konto - für Ihren Server hinzufügen. Die Kontakte/Termine/Aufgaben werden dann automatisch in beide Richtungen synchronisiert. - Weitere Informationen erhalten Sie auf der DAVdroid-Homepage. - Dort finden Sie auch eine Anleitung zum Einrichten. - DAVdroid respektiert Ihre Privatsphäre (siehe Datenschutzrichtlinie).
- -Bei Problemen lesen Sie bitte die häufig gestellten Fragen. - Um Hilfe zu erhalten oder über DAVdroid-bezogene Themen zu diskutieren, gibt es unsere - DAVdroid-Foren. - Bitte erpressen Sie uns nicht mit schlechten Bewertungen in den App-Stores (das ist zwecklos und für beide Seiten demotivierend).
- -Wenn Sie eine Datenschutz-App (\"privacy guard\") benutzen (in CyanogenMod standardmäßig an), müssen Sie einstellen, - dass DAVdroid auf Kontakte und Kalender zugreifen darf.
- -DAVdroid ist von Anfang an als Open-Source-Projekt ausgelegt. Der Quellcode kann jederzeit selbst kompiliert und - die App unter den Bedingungen der GPLv3 verwendet werden. Der - Quellcode ist verfügbar; die App kann auch - über F-Droid bezogen werden.
- -Es bedeutet viel Arbeit, die App zu entwickeln und besser zu machen. Daher haben wir uns entschlossen, sie - auch gegen eine kleine Gebühr in die kommerziellen App-Stores zu stellen. Wenn Sie DAVdroid über F-Droid bezogen haben, - überlegen Sie bitte, ob Sie das Projekt mit - einer Spende unterstützen wollen.
- -Copyright © 2013 – 2015 Ricki Hirner, Bernhard Stockmann (bitfire web engineering), alle Rechte - vorbehalten. Dieses Programm ist freie Software. Sie können es unter den Bedingungen der GNU - General Public License Version 3, wie von der Free Software Foundation veröffentlicht, weitergeben und/oder modifizieren. - Sofern Google Play oder Samsung Store andere Bedingungen benötigen, gelten diese Bedingungen nur für über den jeweiligen - Markt heruntergeladene Apps.
- -Übersetzungen für andere Sprachen als Englisch und Deutsch - wurden von verschiedenen Personen beigetragen, die in der jeweiligen Sprachversion erwähnt sind.
- -
- * Apache HttpClient (Android port) – Apache License, Version 2.0
- * iCal4j – New BSD License
- * ez-vcard – New BSD License
- * Simple XML Serialization – Apache License, Version 2.0
- * Project Lombok – MIT License
- * dnsjava – BSD License
Puedes encontrar el problema de que todas tus cuentas de DAVdroid (incluyendo contactos y eventos) han desaparecido
diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml
index 4380cdd6..cfb004ee 100644
--- a/app/src/main/res/values-fr/strings.xml
+++ b/app/src/main/res/values-fr/strings.xml
@@ -12,7 +12,7 @@
La raison est un bug dans Android qui supprime les comptes d\'application payantes au démarrage à cause de l\'ordre de chargement des applications chiffrées; elles sont chargées après la tâche de destruction des comptes orphelins.
diff --git a/app/src/main/res/values-hu/strings.xml b/app/src/main/res/values-hu/strings.xml index c69dc622..629b243d 100644 --- a/app/src/main/res/values-hu/strings.xml +++ b/app/src/main/res/values-hu/strings.xml @@ -11,7 +11,7 @@Você pode encontrar problemas com todas as suas contas DAVdroid (incluindo contatos e eventos)
diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml
index 259ebb9f..5b8603a5 100644
--- a/app/src/main/res/values-ru/strings.xml
+++ b/app/src/main/res/values-ru/strings.xml
@@ -11,7 +11,7 @@
You may encounter the problem that all your DAVdroid accounts (including contacts and events) are gone - after rebooting your device. The reason is a bug in Android - that causes accounts of paid apps to be removed on start-up because the (encrypted) APK files are - loaded after checking for orphaned accounts.
-Affected users:
- * all Android 4.1 users who have got DAVdroid from Play Store;
- * Android 4.2 users who have got DAVdroid from Play Store only with certain devices (for instance, most Samsung devices)
- * maybe other users (LG G3 Android 4.4.2 for instance)
1. Accounts may be gone after a reboot:
+ affects Android 4.1, 4.2 with certain devices (for instance, most Samsung devices), possible some other devices. Most
+ recent Android versions work fine.
+
+ 2. Accounts may be gone after upgrading DAVdroid:
+ affects some Android 4.4.2 devices (known for Nexus devices and Moto G), possible a few other ones. Most recent Android
+ versions work fine.
You may encounter the problem that all your DAVdroid accounts (including contacts and events) when Play Store - updates DAVdroid. The reason is another bug in Android - that causes accounts of paid apps to be removed when upgrading for a similar reason.
-Affected users: some Android 4.4.2 users who have got DAVdroid from Play Store (known for Nexus devices and Moto G)
- -If you\'re affected by one of these bugs, please install the
+ If you have such issues, please install the
DAVdroid JB Workaround.
DAVdroid is an Android 4+ sync adapter for CalDAV/CardDAV. To use it, just add a DAVdroid account - for your CalDAV/CardDAV server and your contacts/events/tasks will be synchronized in both directions. - For more information, please see the DAVdroid homepage. - There\'s a setup guide, too. DAVdroid respects - your privacy, see our privacy policy.
+For more information, please see the DAVdroid homepage. + DAVdroid respects your privacy, see our privacy policy.
+ ]]>DAVdroid aims to support all standards-compliant CalDAV/CardDAV services. To see a list of tested services and related + setup info, together with some information about TLS and certificates, have a look at our + configuration page.
+ ]]>In case of problems, check the frequently asked questions first. To get assistance or discuss about DAVdroid-related topics, have a look in our DAVdroid forums. Please do not blackmail us with bad ratings in the stores (it\'s futile and discouraging for both sides).
- -If you use a privacy guard (default in CyanogenMod), please remember you have to allow contact and calendar access for DAVdroid.
- -DAVdroid is designed to be an open-source project from the very first beginning. It is always possible to compile the app yourself and use it for free without any obligations. The source code is - available, and you can download the app on F-Droid.
- -However, it was much work to create this app, so we have decided to put it into the commercial stores for a small fee. - If you have downloaded the app on F-Droid, please consider - donating to DAVdroid.
- -Copyright © 2013 – 2015 Ricki Hirner, Bernhard Stockmann (bitfire web engineering). All rights reserved. This program and the accompanying materials are made available under the terms of the GNU Public License v3.0 which accompanies this distribution, and is available at http://www.gnu.org/licenses/gpl.html. As far as Google Play, Samsung - Store or Amazon Appstore require other terms, the respective terms apply only to versions - that are downloaded using these services.
- -Translations to other languages than English and German have been contributed by - various people which are mentioned in their respective language version.
- -
- * Apache HttpClient (Android port) – Apache License, Version 2.0
- * iCal4j – New BSD License
- * ez-vcard – New BSD License
- * Simple XML Serialization – Apache License, Version 2.0
- * Project Lombok – MIT License
- * dnsjava – BSD License