├── .classpath ├── .gitignore ├── .project ├── .settings └── org.eclipse.jdt.core.prefs ├── AndroidManifest.xml ├── LICENSE ├── README.md ├── ic_launcher-web.png ├── libs ├── android-support-v4.jar ├── gson-2.3.jar ├── okhttp-2.0.0.jar ├── okhttp-urlconnection-2.0.0.jar ├── okio-1.0.1.jar └── retrofit-1.7.0.jar ├── proguard-project.txt ├── project.properties ├── res ├── drawable-hdpi │ ├── ic_action_refresh.png │ └── ic_launcher.png ├── drawable-mdpi │ ├── ic_action_new.png │ ├── ic_action_refresh.png │ └── ic_launcher.png ├── drawable-xhdpi │ ├── ic_action_refresh.png │ └── ic_launcher.png ├── drawable-xxhdpi │ ├── ic_action_refresh.png │ └── ic_launcher.png ├── layout │ ├── add_task.xml │ ├── main.xml │ └── task_list_row.xml ├── menu │ └── main.xml ├── values-v11 │ └── styles.xml ├── values-v14 │ └── styles.xml ├── values │ ├── strings.xml │ └── styles.xml └── xml │ └── syncadapter.xml └── src └── com └── rogansoft └── tasksdemo ├── AddTaskActivity.java ├── MainActivity.java ├── PrefsUtil.java ├── TaskArrayAdapter.java ├── Util.java ├── api ├── GoogleTaskApi.java ├── GoogleTaskApiService.java └── TaskApi.java ├── db └── TaskDb.java ├── domain ├── Task.java └── TaskList.java └── sync ├── TaskSyncAdapter.java ├── TaskSyncAdapterService.java ├── TaskSyncContentProvider.java ├── TaskSyncLocalDatastore.java └── TaskSyncRemoteDatastore.java /.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Built application files 2 | *.apk 3 | *.ap_ 4 | 5 | # Files for the Dalvik VM 6 | *.dex 7 | 8 | # Java class files 9 | *.class 10 | 11 | # Generated files 12 | bin/ 13 | gen/ 14 | 15 | # Gradle files 16 | .gradle/ 17 | build/ 18 | 19 | # Local configuration file (sdk path, etc) 20 | local.properties 21 | 22 | # Proguard folder generated by Eclipse 23 | proguard/ 24 | 25 | # Log Files 26 | *.log 27 | -------------------------------------------------------------------------------- /.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | SyncManagerDemoGoogleTasks 4 | 5 | 6 | 7 | 8 | 9 | com.android.ide.eclipse.adt.ResourceManagerBuilder 10 | 11 | 12 | 13 | 14 | com.android.ide.eclipse.adt.PreCompilerBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.jdt.core.javabuilder 20 | 21 | 22 | 23 | 24 | com.android.ide.eclipse.adt.ApkBuilder 25 | 26 | 27 | 28 | 29 | 30 | com.android.ide.eclipse.adt.AndroidNature 31 | org.eclipse.jdt.core.javanature 32 | 33 | 34 | -------------------------------------------------------------------------------- /.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 3 | org.eclipse.jdt.core.compiler.compliance=1.6 4 | org.eclipse.jdt.core.compiler.source=1.6 5 | -------------------------------------------------------------------------------- /AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 9 | 10 | 12 | 14 | 16 | 18 | 19 | 24 | 25 | 27 | 28 | 30 | 31 | 32 | 33 | 34 | 35 | 37 | 38 | 39 | 43 | 44 | 45 | 46 | 48 | 49 | 50 | 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 sschendel 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | SyncManagerAndroid-DemoGoogleTasks 2 | ================================== 3 | 4 | Android Google Task app to demonstrate use of [SyncManagerAndroid][repo-syncman] library. 5 | 6 | Overview 7 | -------------------- 8 | Simple [Google Tasks API][gtasks] integrated app that demostrates synchronization of Google Task data between local SQLite database and remote RESTful Google Tasks API. 9 | 10 | 11 | Some key Android concepts demonstrated 12 | -------------------- 13 | * Android sync framework integration - with sync implementation provided by [SyncManagerAndroid][repo-syncman] 14 | * SQLite database 15 | * Retrofit REST client integration 16 | * Custom ArrayAdapter 17 | 18 | Libraries used 19 | -------------------- 20 | * [SyncManagerAndroid][repo-syncman] - 2-way sync library 21 | * [Retrofit][repo-retrofit] - REST client from [Square][gh-square] 22 | 23 | [repo-syncman]: https://github.com/sschendel/SyncManagerAndroid 24 | [repo-retrofit]: http://square.github.io/retrofit/ 25 | [gh-square]: http://square.github.io/ 26 | [gtasks]: https://developers.google.com/google-apps/tasks/ 27 | -------------------------------------------------------------------------------- /ic_launcher-web.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sschendel/SyncManagerAndroid-DemoGoogleTasks/d59e894e3d520d17c6dfdc073fbf2e194b4498fb/ic_launcher-web.png -------------------------------------------------------------------------------- /libs/android-support-v4.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sschendel/SyncManagerAndroid-DemoGoogleTasks/d59e894e3d520d17c6dfdc073fbf2e194b4498fb/libs/android-support-v4.jar -------------------------------------------------------------------------------- /libs/gson-2.3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sschendel/SyncManagerAndroid-DemoGoogleTasks/d59e894e3d520d17c6dfdc073fbf2e194b4498fb/libs/gson-2.3.jar -------------------------------------------------------------------------------- /libs/okhttp-2.0.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sschendel/SyncManagerAndroid-DemoGoogleTasks/d59e894e3d520d17c6dfdc073fbf2e194b4498fb/libs/okhttp-2.0.0.jar -------------------------------------------------------------------------------- /libs/okhttp-urlconnection-2.0.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sschendel/SyncManagerAndroid-DemoGoogleTasks/d59e894e3d520d17c6dfdc073fbf2e194b4498fb/libs/okhttp-urlconnection-2.0.0.jar -------------------------------------------------------------------------------- /libs/okio-1.0.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sschendel/SyncManagerAndroid-DemoGoogleTasks/d59e894e3d520d17c6dfdc073fbf2e194b4498fb/libs/okio-1.0.1.jar -------------------------------------------------------------------------------- /libs/retrofit-1.7.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sschendel/SyncManagerAndroid-DemoGoogleTasks/d59e894e3d520d17c6dfdc073fbf2e194b4498fb/libs/retrofit-1.7.0.jar -------------------------------------------------------------------------------- /proguard-project.txt: -------------------------------------------------------------------------------- 1 | # To enable ProGuard in your project, edit project.properties 2 | # to define the proguard.config property as described in that file. 3 | # 4 | # Add project specific ProGuard rules here. 5 | # By default, the flags in this file are appended to flags specified 6 | # in ${sdk.dir}/tools/proguard/proguard-android.txt 7 | # You can edit the include path and order by changing the ProGuard 8 | # include property in project.properties. 9 | # 10 | # For more details, see 11 | # http://developer.android.com/guide/developing/tools/proguard.html 12 | 13 | # Add any project specific keep options here: 14 | 15 | # If your project uses WebView with JS, uncomment the following 16 | # and specify the fully qualified class name to the JavaScript interface 17 | # class: 18 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 19 | # public *; 20 | #} 21 | -keep class * extends java.util.ListResourceBundle { 22 | protected Object[][] getContents(); 23 | } 24 | 25 | -keep public class com.google.android.gms.common.internal.safeparcel.SafeParcelable { 26 | public static final *** NULL; 27 | } 28 | 29 | -keepnames @com.google.android.gms.common.annotation.KeepName class * 30 | -keepclassmembernames class * { 31 | @com.google.android.gms.common.annotation.KeepName *; 32 | } 33 | 34 | -keepnames class * implements android.os.Parcelable { 35 | public static final ** CREATOR; 36 | } -------------------------------------------------------------------------------- /project.properties: -------------------------------------------------------------------------------- 1 | # This file is automatically generated by Android Tools. 2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED! 3 | # 4 | # This file must be checked in Version Control Systems. 5 | # 6 | # To customize properties used by the Ant build system edit 7 | # "ant.properties", and override values to adapt the script to your 8 | # project structure. 9 | # 10 | # To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home): 11 | #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt 12 | 13 | # Project target. 14 | target=android-19 15 | android.library.reference.1=..\\..\\..\\..\\Source\\google-play-services_lib 16 | android.library.reference.2=../../../../Source/SyncManager 17 | -------------------------------------------------------------------------------- /res/drawable-hdpi/ic_action_refresh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sschendel/SyncManagerAndroid-DemoGoogleTasks/d59e894e3d520d17c6dfdc073fbf2e194b4498fb/res/drawable-hdpi/ic_action_refresh.png -------------------------------------------------------------------------------- /res/drawable-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sschendel/SyncManagerAndroid-DemoGoogleTasks/d59e894e3d520d17c6dfdc073fbf2e194b4498fb/res/drawable-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /res/drawable-mdpi/ic_action_new.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sschendel/SyncManagerAndroid-DemoGoogleTasks/d59e894e3d520d17c6dfdc073fbf2e194b4498fb/res/drawable-mdpi/ic_action_new.png -------------------------------------------------------------------------------- /res/drawable-mdpi/ic_action_refresh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sschendel/SyncManagerAndroid-DemoGoogleTasks/d59e894e3d520d17c6dfdc073fbf2e194b4498fb/res/drawable-mdpi/ic_action_refresh.png -------------------------------------------------------------------------------- /res/drawable-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sschendel/SyncManagerAndroid-DemoGoogleTasks/d59e894e3d520d17c6dfdc073fbf2e194b4498fb/res/drawable-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /res/drawable-xhdpi/ic_action_refresh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sschendel/SyncManagerAndroid-DemoGoogleTasks/d59e894e3d520d17c6dfdc073fbf2e194b4498fb/res/drawable-xhdpi/ic_action_refresh.png -------------------------------------------------------------------------------- /res/drawable-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sschendel/SyncManagerAndroid-DemoGoogleTasks/d59e894e3d520d17c6dfdc073fbf2e194b4498fb/res/drawable-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /res/drawable-xxhdpi/ic_action_refresh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sschendel/SyncManagerAndroid-DemoGoogleTasks/d59e894e3d520d17c6dfdc073fbf2e194b4498fb/res/drawable-xxhdpi/ic_action_refresh.png -------------------------------------------------------------------------------- /res/drawable-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sschendel/SyncManagerAndroid-DemoGoogleTasks/d59e894e3d520d17c6dfdc073fbf2e194b4498fb/res/drawable-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /res/layout/add_task.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 9 | 15 | 18 |