Main activity, minor changes
* Main activity with description and links * Decrease MAX_UPDATES_BEFORE_COMMIT to 25 (may fix #25)
@ -22,7 +22,7 @@
|
||||
android:label="@string/app_name"
|
||||
android:theme="@style/AppTheme" >
|
||||
<service
|
||||
android:name=".syncadapter.AccountAuthenticatorService"
|
||||
android:name="at.bitfire.davdroid.syncadapter.AccountAuthenticatorService"
|
||||
android:exported="false" >
|
||||
<intent-filter>
|
||||
<action android:name="android.accounts.AccountAuthenticator" />
|
||||
@ -33,7 +33,7 @@
|
||||
android:resource="@xml/account_authenticator" />
|
||||
</service>
|
||||
<service
|
||||
android:name=".syncadapter.ContactsSyncAdapterService"
|
||||
android:name="at.bitfire.davdroid.syncadapter.ContactsSyncAdapterService"
|
||||
android:exported="true"
|
||||
android:process=":sync" >
|
||||
<intent-filter>
|
||||
@ -48,7 +48,7 @@
|
||||
android:resource="@xml/contacts" />
|
||||
</service>
|
||||
<service
|
||||
android:name=".syncadapter.CalendarsSyncAdapterService"
|
||||
android:name="at.bitfire.davdroid.syncadapter.CalendarsSyncAdapterService"
|
||||
android:exported="true"
|
||||
android:process=":sync" >
|
||||
<intent-filter>
|
||||
@ -61,7 +61,15 @@
|
||||
</service>
|
||||
|
||||
<activity
|
||||
android:name=".syncadapter.AddAccountActivity"
|
||||
android:name="at.bitfire.davdroid.MainActivity"
|
||||
android:label="@string/app_name" >
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<activity
|
||||
android:name="at.bitfire.davdroid.syncadapter.AddAccountActivity"
|
||||
android:excludeFromRecents="true" >
|
||||
</activity>
|
||||
</application>
|
||||
|
BIN
res/drawable-hdpi/ic_action_new_account.png
Normal file
After Width: | Height: | Size: 711 B |
BIN
res/drawable-hdpi/show_sync_settings.png
Normal file
After Width: | Height: | Size: 2.6 KiB |
BIN
res/drawable-hdpi/view_website.png
Normal file
After Width: | Height: | Size: 3.3 KiB |
BIN
res/drawable-mdpi/ic_action_new_account.png
Normal file
After Width: | Height: | Size: 554 B |
BIN
res/drawable-mdpi/show_sync_settings.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
res/drawable-mdpi/view_website.png
Normal file
After Width: | Height: | Size: 2.0 KiB |
BIN
res/drawable-xhdpi/ic_action_new_account.png
Normal file
After Width: | Height: | Size: 902 B |
BIN
res/drawable-xhdpi/show_sync_settings.png
Normal file
After Width: | Height: | Size: 2.7 KiB |
BIN
res/drawable-xhdpi/view_website.png
Normal file
After Width: | Height: | Size: 2.6 KiB |
15
res/layout/activity_main.xml
Normal file
@ -0,0 +1,15 @@
|
||||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".MainActivity" >
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text_info"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="20dp"
|
||||
android:linksClickable="true"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium" />
|
||||
|
||||
</ScrollView>
|
6
res/menu/main_activity.xml
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
|
||||
<item android:onClick="addAccount" android:title="@string/add_account" android:showAsAction="always" android:icon="@drawable/ic_action_new_account"></item>
|
||||
<item android:onClick="showSyncSettings" android:title="@string/show_sync_settings" android:showAsAction="always" android:icon="@drawable/show_sync_settings"></item>
|
||||
<item android:onClick="showWebsite" android:title="@string/show_website" android:showAsAction="always" android:icon="@drawable/view_website"></item>
|
||||
</menu>
|
@ -25,4 +25,56 @@
|
||||
<string name="select_address_book">Ein oder kein Adressbuch auswählen (nochmal berühren, um abzuwählen):</string>
|
||||
<string name="select_calendars">Kalender zur Synchronisation auswählen:</string>
|
||||
<string name="auth_preemptive">Präemptive Authentifizierung (empfohlen, aber nicht kompatibel mit Digest-Auth.)</string>
|
||||
|
||||
<string name="davdroid_help">Hilfe zu DAVdroid</string>
|
||||
<string name="show_sync_settings">Sync-Konten anzeigen</string>
|
||||
<string name="show_website">DAVdroid-Website</string>
|
||||
<string name="html_info"><![CDATA[
|
||||
<h1>Willkommen bei DAVdroid!</h1>
|
||||
|
||||
<p>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 werden dann automatisch in beide Richtungen synchronisiert.</p>
|
||||
|
||||
<p>Wenn Sie <a href="https://play.google.com/store/apps/details?id=at.bitfire.davdroid">DAVdroid über den
|
||||
Play-Store bezogen haben</a> und Android 4.1 oder Samsung-Geräte (wie zB das Galaxy Note, Note 10.1, S2, S3, S4, …)
|
||||
benutzen, müssen Sie möglicherweise den
|
||||
<a href="https://play.google.com/store/apps/details?id=at.bitfire.davdroid.jbworkaround">DAVdroid JB Workaround</a>
|
||||
installieren, um Datenverlust beim Neustart zu vermeiden (dies ist ein Android-Bug).</p>
|
||||
|
||||
<p>Weitere Informationen erhalten Sie auf der <a href="http://davdroid.bitfire.at?pk_campaign=davdroid-app&pk_kwd=main-activity">DAVdroid-Homepage</a>.
|
||||
Dort finden Sie auch eine <a href="http://davdroid.bitfire.at/configuration?pk_campaign=davdroid-app&pk_kwd=main-activity">Anleitung zum Einrichten</a>
|
||||
DAVdroid ist auf den Schutz der Privatsphäre ausgelegt (siehe <a href="http://davdroid.bitfire.at/privacy?pk_campaign=davdroid-app&pk_kwd=main-activity">Datenschutzrichtlinie</a>).</p>
|
||||
|
||||
<p><b>Bei Problemen lesen Sie bitte die <a href="http://davdroid.bitfire.at/configuration?pk_campaign=davdroid-app&pk_kwd=main-activity">häufig gestellten Fragen</a>.
|
||||
Im Falle eines Fehlers, der eindeutig durch DAVdroid verursacht wird, berichten Sie diesen wenn möglich auf
|
||||
<a href="https://github.com/rfc2822/davdroid">Github Issues</a>, anstatt uns direkt zu kontaktieren oder die App
|
||||
schlecht zu bewerten.</b></p>
|
||||
|
||||
<h1>Open-Source</h1>
|
||||
<p>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
|
||||
<a href="https://github.com/rfc2822/davdroid">auf Github verfügbar</a>, die App kann auch
|
||||
<a href="https://f-droid.org/app/at.bitfire.davdroid">über F-droid bezogen werden</a>.</p>
|
||||
|
||||
<p>Es ist jedoch viel Arbeit, die App zu entwickeln und besser zu machen. Daher haben wir uns entschlossen, sie
|
||||
auch gegen eine kleine Gebühr in die Stores (Google Play,
|
||||
<a href="http://apps.samsung.com/earth/topApps/topAppsDetail.as?productId=000000665458">Samsung Store</a>)
|
||||
zu stellen. Wenn Sie das Projekt unterstützen wollen, können Sie
|
||||
<a href="http://davdroid.bitfire.at/donate?pk_campaign=davdroid-app&pk_kwd=main-activity">für DAVdroid spenden</a> oder die App kaufen.</p>
|
||||
|
||||
<h1>Lizenz</h1>
|
||||
<p>Copyright (c) 2013 Richard Hirner (<a href="http://www.bitfire.at">bitfire web engineering</a>), alle Rechte
|
||||
vorbehalten. Dieses Programm ist freie Software. Sie können es unter den Bedingungen der <a href="http://www.gnu.org/licenses/gpl.html">GNU
|
||||
General Public License Version 3</a>, wie von der Free Software Foundation veröffentlicht, weitergeben und/oder modifizieren.
|
||||
Sofern Google Play oder Samsung Store andere Bedingungen benötigen, gelten für über den jeweiligen Markt heruntergeladene
|
||||
Apps diese Bedingungen.</p>
|
||||
|
||||
<h2>Benutzte Bibliotheken</h2>
|
||||
<p>
|
||||
* <a href="http://ical4j.sourceforge.net/">iCal4j<a> (<a href="http://sourceforge.net/p/ical4j/ical4j/ci/default/tree/LICENSE">New BSD License</a>)<br/>
|
||||
* <a href="http://wiki.modularity.net.au/ical4j/index.php?title=VCard">iCal4j-vcard</a> (<a href="http://sourceforge.net/p/ical4j/ical4j/ci/default/tree/LICENSE">New BSD License</a>)<br/>
|
||||
* <a href="http://simple.sourceforge.net/">Simple XML Serialization</a> (<a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>)<br/>
|
||||
* <a href="http://projectlombok.org/">Project Lombok</a> (<a href="http://opensource.org/licenses/mit-license.php">MIT License</a>)</p>
|
||||
]]></string>
|
||||
|
||||
</resources>
|
@ -3,10 +3,12 @@
|
||||
|
||||
<string name="app_name">DAVdroid</string>
|
||||
<string name="menu_settings">Settings</string>
|
||||
|
||||
<string-array name="http_protocols">
|
||||
<item>http://</item>
|
||||
<item>https://</item>
|
||||
</string-array>
|
||||
|
||||
<string name="http_warning">"If you don't use encryption (HTTPS), other people may easily intercept your login details, contacts and events."</string>
|
||||
<string name="user_name">User name:</string>
|
||||
<string name="password">Password:</string>
|
||||
@ -32,4 +34,54 @@
|
||||
<string name="select_calendars">Select your calendars:</string>
|
||||
<string name="auth_preemptive">Preemptive authentication (recommended, but incompatible with Digest auth)</string>
|
||||
|
||||
<string name="davdroid_help">DAVdroid Help</string>
|
||||
<string name="show_sync_settings">Manage sync accounts</string>
|
||||
<string name="show_website">DAVdroid Web site</string>
|
||||
<string name="html_info"><![CDATA[
|
||||
<h1>Welcome to DAVdroid!</h1>
|
||||
|
||||
<p>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 will be synchronized in both directions.</p>
|
||||
|
||||
<p>If you have bought <a href="https://play.google.com/store/apps/details?id=at.bitfire.davdroid">DAVdroid via
|
||||
Play Store</a> and use Android 4.1 or Samsung devices (for instance, Galaxy Note, Note 10.1, S2, S3, S4, …)
|
||||
you may have to install the
|
||||
<a href="https://play.google.com/store/apps/details?id=at.bitfire.davdroid.jbworkaround">DAVdroid JB Workaround</a>
|
||||
to prevent data-loss on reboot (it\'s an Android bug).</p>
|
||||
|
||||
<p>For more information, please see the <a href="http://davdroid.bitfire.at?pk_campaign=davdroid-app&pk_kwd=main-activity">DAVdroid homepage</a>.
|
||||
There\'s a <a href="http://davdroid.bitfire.at/configuration?pk_campaign=davdroid-app&pk_kwd=main-activity">Setup guide</a>, too. DAVdroid respects
|
||||
your privacy, see our <a href="http://davdroid.bitfire.at/privacy?pk_campaign=davdroid-app&pk_kwd=main-activity">Privacy Policy</a>.</p>
|
||||
|
||||
<p><b>In case of problems, please read the <a href="http://davdroid.bitfire.at/configuration?pk_campaign=davdroid-app&pk_kwd=main-activity">FAQ</a> first.
|
||||
If you encounter a bug that is clearly related to DAVdroid, enter it on
|
||||
<a href="https://github.com/rfc2822/davdroid">Github issues</a> instead of contacting us directly or giving a poor
|
||||
rating for the app.</b></p>
|
||||
|
||||
<h1>Open-source</h1>
|
||||
<p>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
|
||||
<a href="https://github.com/rfc2822/davdroid">available on Github</a>, and you can
|
||||
<a href="https://f-droid.org/app/at.bitfire.davdroid">download the app on F-droid</a>.</p>
|
||||
|
||||
<p>However, it was much work to create this app, so we have decided to put it into the stores (Google Play,
|
||||
<a href="http://apps.samsung.com/earth/topApps/topAppsDetail.as?productId=000000665458">Samsung Store</a>) for a small fee.
|
||||
If you want to support this project, please consider <a href="http://davdroid.bitfire.at/donate?pk_campaign=davdroid-app&pk_kwd=main-activity">donating to DAVdroid</a>
|
||||
or purchasing it.</p>
|
||||
|
||||
<h1>License</h1>
|
||||
<p>Copyright (c) 2013 Richard Hirner (<a href="http://www.bitfire.at">bitfire web engineering</a>). 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 <a
|
||||
href="http://www.gnu.org/licenses/gpl.html">http://www.gnu.org/licenses/gpl.html</a>. As far as Google Play or Samsung
|
||||
Store Store require other terms, the respective terms apply for versions that are downloaded via these services.</p>
|
||||
|
||||
<h2>Used third-party libraries</h2>
|
||||
<p>
|
||||
* <a href="http://ical4j.sourceforge.net/">iCal4j<a> (<a href="http://sourceforge.net/p/ical4j/ical4j/ci/default/tree/LICENSE">New BSD License</a>)<br/>
|
||||
* <a href="http://wiki.modularity.net.au/ical4j/index.php?title=VCard">iCal4j-vcard</a> (<a href="http://sourceforge.net/p/ical4j/ical4j/ci/default/tree/LICENSE">New BSD License</a>)<br/>
|
||||
* <a href="http://simple.sourceforge.net/">Simple XML Serialization</a> (<a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>)<br/>
|
||||
* <a href="http://projectlombok.org/">Project Lombok</a> (<a href="http://opensource.org/licenses/mit-license.php">MIT License</a>)</p>
|
||||
]]></string>
|
||||
|
||||
</resources>
|
||||
|
@ -1,10 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" >
|
||||
|
||||
<Preference android:title="DAVdroid Web site" >
|
||||
<Preference android:title="@string/davdroid_help" >
|
||||
<intent
|
||||
android:action="android.intent.action.VIEW"
|
||||
android:data="http://davdroid.bitfire.at/?pk_campaign=davdroid-app&pk_kwd=accounts" />
|
||||
android:targetPackage="at.bitfire.davdroid"
|
||||
android:targetClass="at.bitfire.davdroid.MainActivity" />
|
||||
</Preference>
|
||||
|
||||
</PreferenceScreen>
|
||||
|
51
src/at/bitfire/davdroid/MainActivity.java
Normal file
@ -0,0 +1,51 @@
|
||||
package at.bitfire.davdroid;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.provider.Settings;
|
||||
import android.text.Html;
|
||||
import android.text.method.LinkMovementMethod;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuInflater;
|
||||
import android.view.MenuItem;
|
||||
import android.widget.TextView;
|
||||
|
||||
public class MainActivity extends Activity {
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
setContentView(R.layout.activity_main);
|
||||
|
||||
TextView tv = (TextView)findViewById(R.id.text_info);
|
||||
tv.setText(Html.fromHtml(getString(R.string.html_info)));
|
||||
tv.setMovementMethod(LinkMovementMethod.getInstance());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCreateOptionsMenu(Menu menu) {
|
||||
MenuInflater inflater = getMenuInflater();
|
||||
inflater.inflate(R.menu.main_activity, menu);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
public void addAccount(MenuItem item) {
|
||||
Intent intent = new Intent(Settings.ACTION_ADD_ACCOUNT);
|
||||
startActivity(intent);
|
||||
}
|
||||
|
||||
public void showSyncSettings(MenuItem item) {
|
||||
Intent intent = new Intent(Settings.ACTION_SYNC_SETTINGS);
|
||||
startActivity(intent);
|
||||
}
|
||||
|
||||
public void showWebsite(MenuItem item) {
|
||||
Intent intent = new Intent(Intent.ACTION_VIEW);
|
||||
intent.setData(Uri.parse(Constants.WEB_URL_HELP + "&pk_kwd=main-activity"));
|
||||
startActivity(intent);
|
||||
}
|
||||
}
|
@ -338,7 +338,7 @@ public class LocalCalendar extends LocalCollection<Event> {
|
||||
where = entryColumnRemoteName() + " IS NOT NULL";
|
||||
|
||||
Builder builder = ContentProviderOperation.newDelete(entriesURI())
|
||||
.withSelection(Events.CALENDAR_ID + "=? AND (" + where + ")", new String[] { String.valueOf(id) });
|
||||
.withSelection(entryColumnParentID() + "=? AND (" + where + ")", new String[] { String.valueOf(id) });
|
||||
pendingOperations.add(builder
|
||||
.withYieldAllowed(true)
|
||||
.build());
|
||||
|
@ -166,13 +166,12 @@ public abstract class LocalCollection<ResourceType extends Resource> {
|
||||
}
|
||||
|
||||
public void commit() throws RemoteException, OperationApplicationException {
|
||||
if (!pendingOperations.isEmpty()) {
|
||||
Log.i(TAG, "Committing " + pendingOperations.size() + " operations");
|
||||
|
||||
if (!pendingOperations.isEmpty())
|
||||
providerClient.applyBatch(pendingOperations);
|
||||
|
||||
pendingOperations.clear();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// helpers
|
||||
|
@ -28,7 +28,7 @@ import at.bitfire.davdroid.webdav.PreconditionFailedException;
|
||||
|
||||
public class SyncManager {
|
||||
private static final String TAG = "davdroid.SyncManager";
|
||||
private static final int MAX_UPDATES_BEFORE_COMMIT = 100;
|
||||
private static final int MAX_UPDATES_BEFORE_COMMIT = 25;
|
||||
|
||||
protected Account account;
|
||||
protected AccountManager accountManager;
|
||||
|