diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
new file mode 100644
index 00000000..b292118a
--- /dev/null
+++ b/CONTRIBUTING.md
@@ -0,0 +1,56 @@
+
+DAVdroid is free and open-source software, licensed under the [GPLv3 License](COPYING).
+If you like our project, please contribute to it.
+
+# How to contribute
+
+## Reporting issues
+
+An issue might be a bug, an enhancement request or something in between. If you think you
+have found a bug or if you want to request some enhancement, please:
+
+1. Read the [Configuration](http://davdroid.bitfire.at/configuration) and [FAQ](http://davdroid.bitfire.at/faq/)
+ pages carefully. The most common issues/usage challenges are explained there.
+2. Search the Web for the problem, maybe ask competent friends or in forums.
+3. Browse through the [open issues](https://github.com/rfc2822/davdroid/issues). You can
+ also search the issues in the search field on top of the page. Please have a look
+ into the closed issues, too, because many requests have already been handled (and can''t/won''t
+ be fixed, for instance).
+4. **[Fetch verbose logs](https://github.com/rfc2822/davdroid/wiki/How-to-view-the-logs) and prepare
+ them. Remove `Authorization: Basic xxxxxx` headers and other private data.** Extracting the
+ logs may be cumbersome work in the first time, but it''s absolutely necessary in order to
+ handle your issue.
+5. Create a new issue, containing
+ * a useful summary of the problem ("Crash when syncing contacts with large photos" instead of "CRASH PLEASE HELP"),
+ * your DAVdroid version and source ("DAVdroid 0.5.10 from F-Droid"),
+ * your Android version and device model ("Samsung Galaxy S2 running Android 4.4.2 (CyanogenMod 11-20140504-SNAPSHOT-M6-i9100)"),
+ * your CalDAV/CardDAV server software, version and hosting information ("OwnCloud 6, hosted on virtual server"),
+ * **verbose logs including the network traffic** (see step before). Enquote the logs with three backticks ```
+ before and after, or post them onto http://gist.github.com and provide a link.
+
+
+## Pull requests
+
+We''re very happy about pull requests for
+
+* source code,
+* documentation,
+* translation (strings).
+
+However, if you want to contribute source code, please talk with us in the
+corresponding issue before because will only merge pull requests that
+
+* match our product goals,
+* have the necessary code quality,
+* don''t interfere with other near-term future development.
+
+However, feel free to fork the repository and do your changes anyway
+(that''s why it''s open-source). Just don''t expect your strategic changes to be
+merged if there''s no consensus in the issue before.
+
+
+## Donations
+
+If you want to support this project, please also consider [donating to DAVdroid](http://davdroid.bitfire.at/donate)
+or [purchasing it in one of the commercial stores](http://davdroid.bitfire.at/download).
+
diff --git a/README.md b/README.md
index e1e0a80d..4e895139 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,13 @@
-Please see the [DAVdroid Web site](http://davdroid.bitfire.at) for more information.
+DAVDROID
+========
-Twitter: https://twitter.com/davdroidapp
+Please see the [DAVdroid Web site](http://davdroid.bitfire.at) for
+detailled information about DAVdroid.
+
+DAVdroid is licensed under the [GPLv3 License](COPYING).
+
+Twitter: [@davdroidapp](https://twitter.com/davdroidapp)
USED THIRD-PARTY LIBRARIES
diff --git a/res/drawable-hdpi/ic_action_new_event.png b/res/drawable-hdpi/ic_action_new_event.png
new file mode 100644
index 00000000..5a5d5587
Binary files /dev/null and b/res/drawable-hdpi/ic_action_new_event.png differ
diff --git a/res/drawable-mdpi/ic_action_new_event.png b/res/drawable-mdpi/ic_action_new_event.png
new file mode 100644
index 00000000..e8b7e41a
Binary files /dev/null and b/res/drawable-mdpi/ic_action_new_event.png differ
diff --git a/res/drawable-xhdpi/ic_action_new_event.png b/res/drawable-xhdpi/ic_action_new_event.png
new file mode 100644
index 00000000..f2435cb3
Binary files /dev/null and b/res/drawable-xhdpi/ic_action_new_event.png differ
diff --git a/res/drawable-xxhdpi/ic_action_new_event.png b/res/drawable-xxhdpi/ic_action_new_event.png
new file mode 100644
index 00000000..ebd24107
Binary files /dev/null and b/res/drawable-xxhdpi/ic_action_new_event.png differ
diff --git a/res/menu/debug_settings.xml b/res/menu/debug_settings.xml
new file mode 100644
index 00000000..79d4bc45
--- /dev/null
+++ b/res/menu/debug_settings.xml
@@ -0,0 +1,4 @@
+
+
diff --git a/res/values-de/strings.xml b/res/values-de/strings.xml
index 08525776..31f61826 100644
--- a/res/values-de/strings.xml
+++ b/res/values-de/strings.xml
@@ -115,5 +115,6 @@
Netzwerkverkehr aufzeichnen
Der gesamte Netzwerkverkehr wird in den Android-Logs mitgeschrieben (zur Fehlersuche)
Netzwerkverkehr wird nicht aufgezeichnet
-
+ Problem berichten
+
\ No newline at end of file
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 42964297..9d4b63f1 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -122,5 +122,6 @@
Log network traffic
All network traffic is being logged verbosely (debug mode)
Network traffic is not being logged
+ Report an issue
diff --git a/src/at/bitfire/davdroid/syncadapter/AddAccountActivity.java b/src/at/bitfire/davdroid/syncadapter/AddAccountActivity.java
index af6a0b2c..bd8cc8fd 100644
--- a/src/at/bitfire/davdroid/syncadapter/AddAccountActivity.java
+++ b/src/at/bitfire/davdroid/syncadapter/AddAccountActivity.java
@@ -42,9 +42,8 @@ public class AddAccountActivity extends Activity {
return true;
}
- public boolean showHelp(MenuItem item) {
+ public void showHelp(MenuItem item) {
startActivityForResult(new Intent(Intent.ACTION_VIEW, Uri.parse(Constants.WEB_URL_HELP)), 0);
- return true;
}
}
diff --git a/src/at/bitfire/davdroid/syncadapter/DavSyncAdapter.java b/src/at/bitfire/davdroid/syncadapter/DavSyncAdapter.java
index e9919eab..ebc3069c 100644
--- a/src/at/bitfire/davdroid/syncadapter/DavSyncAdapter.java
+++ b/src/at/bitfire/davdroid/syncadapter/DavSyncAdapter.java
@@ -25,11 +25,14 @@ import android.content.AbstractThreadedSyncAdapter;
import android.content.ContentProviderClient;
import android.content.ContentResolver;
import android.content.Context;
+import android.content.SharedPreferences;
import android.content.SyncResult;
import android.os.AsyncTask;
import android.os.Bundle;
+import android.preference.PreferenceManager;
import android.provider.Settings;
import android.util.Log;
+import at.bitfire.davdroid.Constants;
import at.bitfire.davdroid.resource.LocalCollection;
import at.bitfire.davdroid.resource.LocalStorageException;
import at.bitfire.davdroid.resource.RemoteCollection;
@@ -106,7 +109,11 @@ public abstract class DavSyncAdapter extends AbstractThreadedSyncAdapter impleme
httpClientLock.writeLock().lock();
if (httpClient == null) {
Log.d(TAG, "Creating new DavHttpClient");
- httpClient = DavHttpClient.create(getContext());
+ SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(getContext());
+ httpClient = DavHttpClient.create(
+ settings.getBoolean(Constants.SETTING_DISABLE_COMPRESSION, false),
+ settings.getBoolean(Constants.SETTING_NETWORK_LOGGING, false)
+ );
}
// prevent httpClient shutdown until we're ready by holding a read lock
diff --git a/src/at/bitfire/davdroid/syncadapter/GeneralSettingsActivity.java b/src/at/bitfire/davdroid/syncadapter/GeneralSettingsActivity.java
index ec476d44..816b65f6 100644
--- a/src/at/bitfire/davdroid/syncadapter/GeneralSettingsActivity.java
+++ b/src/at/bitfire/davdroid/syncadapter/GeneralSettingsActivity.java
@@ -2,11 +2,17 @@ package at.bitfire.davdroid.syncadapter;
import android.app.Activity;
import android.content.Context;
+import android.content.Intent;
+import android.net.Uri;
import android.os.Bundle;
import android.preference.PreferenceFragment;
+import android.view.Menu;
+import android.view.MenuInflater;
+import android.view.MenuItem;
import at.bitfire.davdroid.R;
public class GeneralSettingsActivity extends Activity {
+ final static String URL_REPORT_ISSUE = "https://github.com/rfc2822/davdroid/blob/master/CONTRIBUTING.md";
@Override
public void onCreate(Bundle savedInstanceState) {
@@ -16,7 +22,11 @@ public class GeneralSettingsActivity extends Activity {
.replace(android.R.id.content, new GeneralSettingsFragment())
.commit();
}
-
+
+ public void reportIssue(MenuItem item) {
+ startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(URL_REPORT_ISSUE)));
+ }
+
public static class GeneralSettingsFragment extends PreferenceFragment {
@Override
@@ -25,6 +35,13 @@ public class GeneralSettingsActivity extends Activity {
getPreferenceManager().setSharedPreferencesMode(Context.MODE_MULTI_PROCESS);
addPreferencesFromResource(R.xml.general_settings);
+
+ setHasOptionsMenu(true);
}
+
+ @Override
+ public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
+ inflater.inflate(R.menu.debug_settings, menu);
+ }
}
}
diff --git a/src/at/bitfire/davdroid/syncadapter/QueryServerDialogFragment.java b/src/at/bitfire/davdroid/syncadapter/QueryServerDialogFragment.java
index 4e1bc42a..163f7d2f 100644
--- a/src/at/bitfire/davdroid/syncadapter/QueryServerDialogFragment.java
+++ b/src/at/bitfire/davdroid/syncadapter/QueryServerDialogFragment.java
@@ -114,7 +114,9 @@ public class QueryServerDialogFragment extends DialogFragment implements LoaderC
args.getBoolean(EXTRA_AUTH_PREEMPTIVE)
);
- CloseableHttpClient httpClient = DavHttpClient.create(context);
+ // disable compression and enable network logging for debugging purposes
+ CloseableHttpClient httpClient = DavHttpClient.create(true, true);
+
try {
// (1/5) detect capabilities
WebDavResource base = new WebDavResource(httpClient, new URI(serverInfo.getProvidedURL()), serverInfo.getUserName(),
diff --git a/src/at/bitfire/davdroid/webdav/DavHttpClient.java b/src/at/bitfire/davdroid/webdav/DavHttpClient.java
index 5d01b6cb..8365ce35 100644
--- a/src/at/bitfire/davdroid/webdav/DavHttpClient.java
+++ b/src/at/bitfire/davdroid/webdav/DavHttpClient.java
@@ -10,9 +10,6 @@
******************************************************************************/
package at.bitfire.davdroid.webdav;
-import android.content.Context;
-import android.content.SharedPreferences;
-import android.preference.PreferenceManager;
import android.util.Log;
import at.bitfire.davdroid.Constants;
import ch.boye.httpclientandroidlib.client.config.RequestConfig;
@@ -41,13 +38,13 @@ public class DavHttpClient {
// use request defaults from AndroidHttpClient
defaultRqConfig = RequestConfig.copy(RequestConfig.DEFAULT)
.setConnectTimeout(20*1000)
- .setSocketTimeout(20*1000)
+ .setSocketTimeout(45*1000)
.setStaleConnectionCheckEnabled(false)
.build();
}
- public static CloseableHttpClient create(Context context) {
+ public static CloseableHttpClient create(boolean disableCompression, boolean logTraffic) {
PoolingHttpClientConnectionManager connectionManager = new PoolingHttpClientConnectionManager(socketFactoryRegistry);
// limits per DavHttpClient (= per DavSyncAdapter extends AbstractThreadedSyncAdapter)
connectionManager.setMaxTotal(3); // max. 3 connections in total
@@ -60,16 +57,16 @@ public class DavHttpClient {
.setRetryHandler(DavHttpRequestRetryHandler.INSTANCE)
.setUserAgent("DAVdroid/" + Constants.APP_VERSION)
.disableCookieManagement();
-
- // debug options
- SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(context);
- if (settings.getBoolean(Constants.SETTING_DISABLE_COMPRESSION, false))
- builder = builder.disableContentCompression();
- boolean networkLogging = settings.getBoolean(Constants.SETTING_NETWORK_LOGGING, false);
- Log.d(TAG, "Network logging: " + networkLogging);
- ManagedHttpClientConnectionFactory.INSTANCE.wirelog.enableDebug(networkLogging);
- ManagedHttpClientConnectionFactory.INSTANCE.log.enableDebug(networkLogging);
+ if (disableCompression) {
+ Log.d(TAG, "Disabling compression for debugging purposes");
+ builder = builder.disableContentCompression();
+ }
+
+ if (logTraffic)
+ Log.d(TAG, "Logging network traffic for debugging purposes");
+ ManagedHttpClientConnectionFactory.INSTANCE.wirelog.enableDebug(logTraffic);
+ ManagedHttpClientConnectionFactory.INSTANCE.log.enableDebug(logTraffic);
return builder.build();
}