diff --git a/samples/SampleSyncAdapter/Android.mk b/samples/SampleSyncAdapter/Android.mk new file mode 100644 index 000000000..a27a68ffb --- /dev/null +++ b/samples/SampleSyncAdapter/Android.mk @@ -0,0 +1,16 @@ +LOCAL_PATH:= $(call my-dir) +include $(CLEAR_VARS) + +LOCAL_MODULE_TAGS := samples tests + +# Only compile source java files in this apk. +LOCAL_SRC_FILES := $(call all-java-files-under, src) + +LOCAL_PACKAGE_NAME := Voiper + +LOCAL_SDK_VERSION := current + +include $(BUILD_PACKAGE) + +# Use the folloing include to make our test apk. +include $(call all-makefiles-under,$(LOCAL_PATH)) diff --git a/samples/SampleSyncAdapter/AndroidManifest.xml b/samples/SampleSyncAdapter/AndroidManifest.xml new file mode 100644 index 000000000..7f9f83bdf --- /dev/null +++ b/samples/SampleSyncAdapter/AndroidManifest.xml @@ -0,0 +1,92 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/samples/SampleSyncAdapter/_index.html b/samples/SampleSyncAdapter/_index.html new file mode 100644 index 000000000..b0fbd4aab --- /dev/null +++ b/samples/SampleSyncAdapter/_index.html @@ -0,0 +1,26 @@ +

A sample that demonstrates how an application can communicate with cloud-based services and synchronize their data with data stored locally in a content provider. +The sample uses two related parts of the Android framework — the account manager and the synchronization manager (through a sync adapter).

+ +

The account manager allows sharing of credentials across multiple applications and services. +Users enter the credentials for each account only once — applications with the USE_CREDENTIALS permission can then query the account manager + to obtain an auth token for the account.The authenticator (a pluggable component of account manager) requests credentials from the user, validates them + with an authentication server running in the cloud, and then stores them to the AccountManager. +This sample demonstrates how to write an authenticator for your +service by extending the new AbstractAccountAuthenticator abstract class. +

+ +

The sync adapter (essential to the synchronization service) declares the account type and ContentProvider authority to the sync manager. +This sample demosntrates how to write your own sync adapters by extending the AbstractThreadedSyncAdapter +abstract class and implementing the onPerformSync() method that gets called whenever the sync manager issues a sync operation for that sync adapter. +

+ +

The service for this sample application is running at:
+http://samplesyncadapter.appspot.com/users +

+ +

When you install this sample application, a new syncable "SampleSyncAdapter" account will be added to your phone's account manager. +You can go to "Settings | Accounts & sync" to view the accounts that are stored in the account manager and to change their sync settings.

+ +Screenshot 1 +Screenshot 2 +Screenshot 3 \ No newline at end of file diff --git a/samples/SampleSyncAdapter/res/drawable/icon.png b/samples/SampleSyncAdapter/res/drawable/icon.png new file mode 100644 index 000000000..75024841d Binary files /dev/null and b/samples/SampleSyncAdapter/res/drawable/icon.png differ diff --git a/samples/SampleSyncAdapter/res/layout/login_activity.xml b/samples/SampleSyncAdapter/res/layout/login_activity.xml new file mode 100644 index 000000000..7408ffe97 --- /dev/null +++ b/samples/SampleSyncAdapter/res/layout/login_activity.xml @@ -0,0 +1,110 @@ + + + + + + + + + + + + + + + +