1
0
mirror of https://github.com/etesync/android synced 2024-11-22 16:08:13 +00:00

Main activity, minor changes

* Main activity with description and links
* Decrease MAX_UPDATES_BEFORE_COMMIT to 25 (may fix #25)
This commit is contained in:
rfc2822 2013-10-30 11:37:27 +01:00
parent e3ba460991
commit b6611131db
19 changed files with 201 additions and 18 deletions

View File

@ -20,9 +20,9 @@
android:allowBackup="false" android:allowBackup="false"
android:icon="@drawable/ic_launcher" android:icon="@drawable/ic_launcher"
android:label="@string/app_name" android:label="@string/app_name"
android:theme="@style/AppTheme"> android:theme="@style/AppTheme" >
<service <service
android:name=".syncadapter.AccountAuthenticatorService" android:name="at.bitfire.davdroid.syncadapter.AccountAuthenticatorService"
android:exported="false" > android:exported="false" >
<intent-filter> <intent-filter>
<action android:name="android.accounts.AccountAuthenticator" /> <action android:name="android.accounts.AccountAuthenticator" />
@ -33,7 +33,7 @@
android:resource="@xml/account_authenticator" /> android:resource="@xml/account_authenticator" />
</service> </service>
<service <service
android:name=".syncadapter.ContactsSyncAdapterService" android:name="at.bitfire.davdroid.syncadapter.ContactsSyncAdapterService"
android:exported="true" android:exported="true"
android:process=":sync" > android:process=":sync" >
<intent-filter> <intent-filter>
@ -48,7 +48,7 @@
android:resource="@xml/contacts" /> android:resource="@xml/contacts" />
</service> </service>
<service <service
android:name=".syncadapter.CalendarsSyncAdapterService" android:name="at.bitfire.davdroid.syncadapter.CalendarsSyncAdapterService"
android:exported="true" android:exported="true"
android:process=":sync" > android:process=":sync" >
<intent-filter> <intent-filter>
@ -61,7 +61,15 @@
</service> </service>
<activity <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" > android:excludeFromRecents="true" >
</activity> </activity>
</application> </application>

Binary file not shown.

After

Width:  |  Height:  |  Size: 711 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 554 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 902 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

View 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>

View 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>

View File

@ -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_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="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="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&amp;pk_kwd=main-activity">DAVdroid-Homepage</a>.
Dort finden Sie auch eine <a href="http://davdroid.bitfire.at/configuration?pk_campaign=davdroid-app&amp;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&amp;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&amp;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&amp;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> </resources>

View File

@ -3,10 +3,12 @@
<string name="app_name">DAVdroid</string> <string name="app_name">DAVdroid</string>
<string name="menu_settings">Settings</string> <string name="menu_settings">Settings</string>
<string-array name="http_protocols"> <string-array name="http_protocols">
<item >http://</item> <item>http://</item>
<item >https://</item> <item>https://</item>
</string-array> </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="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="user_name">User name:</string>
<string name="password">Password:</string> <string name="password">Password:</string>
@ -31,5 +33,55 @@
<string name="select_address_book">Select up to one address book (tap again to unselect):</string> <string name="select_address_book">Select up to one address book (tap again to unselect):</string>
<string name="select_calendars">Select your calendars:</string> <string name="select_calendars">Select your calendars:</string>
<string name="auth_preemptive">Preemptive authentication (recommended, but incompatible with Digest auth)</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&amp;pk_kwd=main-activity">DAVdroid homepage</a>.
There\'s a <a href="http://davdroid.bitfire.at/configuration?pk_campaign=davdroid-app&amp;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&amp;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&amp;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&amp;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> </resources>

View File

@ -1,10 +1,10 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" > <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" >
<Preference android:title="DAVdroid Web site" > <Preference android:title="@string/davdroid_help" >
<intent <intent
android:action="android.intent.action.VIEW" android:targetPackage="at.bitfire.davdroid"
android:data="http://davdroid.bitfire.at/?pk_campaign=davdroid-app&amp;pk_kwd=accounts" /> android:targetClass="at.bitfire.davdroid.MainActivity" />
</Preference> </Preference>
</PreferenceScreen> </PreferenceScreen>

View 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);
}
}

View File

@ -336,9 +336,9 @@ public class LocalCalendar extends LocalCollection<Event> {
where = StringUtils.join(terms, " AND "); where = StringUtils.join(terms, " AND ");
} else } else
where = entryColumnRemoteName() + " IS NOT NULL"; where = entryColumnRemoteName() + " IS NOT NULL";
Builder builder = ContentProviderOperation.newDelete(entriesURI()) 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 pendingOperations.add(builder
.withYieldAllowed(true) .withYieldAllowed(true)
.build()); .build());

View File

@ -166,12 +166,11 @@ public abstract class LocalCollection<ResourceType extends Resource> {
} }
public void commit() throws RemoteException, OperationApplicationException { public void commit() throws RemoteException, OperationApplicationException {
Log.i(TAG, "Committing " + pendingOperations.size() + " operations"); if (!pendingOperations.isEmpty()) {
Log.i(TAG, "Committing " + pendingOperations.size() + " operations");
if (!pendingOperations.isEmpty())
providerClient.applyBatch(pendingOperations); providerClient.applyBatch(pendingOperations);
pendingOperations.clear();
pendingOperations.clear(); }
} }

View File

@ -28,7 +28,7 @@ import at.bitfire.davdroid.webdav.PreconditionFailedException;
public class SyncManager { public class SyncManager {
private static final String TAG = "davdroid.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 Account account;
protected AccountManager accountManager; protected AccountManager accountManager;