├── .gitignore ├── .project ├── AndroidManifest.xml ├── README.md ├── build.xml ├── libs ├── android-websockets.jar └── gson-2.2.3.jar ├── project.properties ├── res ├── drawable-hdpi │ ├── ic_action_delete.png │ ├── ic_action_new.png │ └── ic_launcher.png ├── drawable-mdpi │ └── ic_launcher.png ├── drawable-xhdpi │ ├── ic_action_delete.png │ ├── ic_action_new.png │ └── ic_launcher.png ├── layout │ ├── activity_main.xml │ └── suggest_text.xml └── values │ └── strings.xml └── src └── net └── schwiz └── eecs780 ├── NetworkReceiver.java ├── PullingActivity.java ├── PullingService.java ├── PushActivity.java ├── PushService.java └── Response.java /.gitignore: -------------------------------------------------------------------------------- 1 | bin 2 | gen 3 | local.properties 4 | assets 5 | .settings 6 | .classpath 7 | -------------------------------------------------------------------------------- /.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | EECS780 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 | -------------------------------------------------------------------------------- /AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 10 | 11 | 12 | 13 | 14 | 15 | 20 | 21 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Android Push Sync Example 2 | ========================= 3 | 4 | This simple app uses websockets to sync with a webapp in real time. It runs in the background to deliver push notifications in real time with zero battery impact. 5 | 6 | ###Source for included jars 7 | Websocket Libary found [here](http://github.com/schwiz/android-websockets) 8 | GSON Library found [here](https://code.google.com/p/google-gson/) 9 | 10 | 11 | ###Source for companion server 12 | Server Project found [here](http://github.com/schwiz/websocket-server) 13 | 14 | 15 | Download and set up the companion server project. Replace the host strings in strings.xml with the info for your server. 16 | 17 | 18 | License 19 | ======= 20 | Copyright 2013 Nathan Schwermann 21 | 22 | Licensed under the Apache License, Version 2.0 (the "License"); 23 | you may not use this file except in compliance with the License. 24 | You may obtain a copy of the License at 25 | 26 | http://www.apache.org/licenses/LICENSE-2.0 27 | 28 | Unless required by applicable law or agreed to in writing, software 29 | distributed under the License is distributed on an "AS IS" BASIS, 30 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 31 | See the License for the specific language governing permissions and 32 | limitations under the License. 33 | -------------------------------------------------------------------------------- /build.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 9 | 29 | 30 | 31 | 35 | 36 | 37 | 38 | 39 | 40 | 49 | 50 | 51 | 52 | 56 | 57 | 69 | 70 | 71 | 89 | 90 | 91 | 92 | 93 | -------------------------------------------------------------------------------- /libs/android-websockets.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nschwermann/android-websocket-example/6929b7c01f5adfc4e75f0a5ec465c1c4d676b92e/libs/android-websockets.jar -------------------------------------------------------------------------------- /libs/gson-2.2.3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nschwermann/android-websocket-example/6929b7c01f5adfc4e75f0a5ec465c1c4d676b92e/libs/gson-2.2.3.jar -------------------------------------------------------------------------------- /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-17 15 | -------------------------------------------------------------------------------- /res/drawable-hdpi/ic_action_delete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nschwermann/android-websocket-example/6929b7c01f5adfc4e75f0a5ec465c1c4d676b92e/res/drawable-hdpi/ic_action_delete.png -------------------------------------------------------------------------------- /res/drawable-hdpi/ic_action_new.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nschwermann/android-websocket-example/6929b7c01f5adfc4e75f0a5ec465c1c4d676b92e/res/drawable-hdpi/ic_action_new.png -------------------------------------------------------------------------------- /res/drawable-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nschwermann/android-websocket-example/6929b7c01f5adfc4e75f0a5ec465c1c4d676b92e/res/drawable-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /res/drawable-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nschwermann/android-websocket-example/6929b7c01f5adfc4e75f0a5ec465c1c4d676b92e/res/drawable-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /res/drawable-xhdpi/ic_action_delete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nschwermann/android-websocket-example/6929b7c01f5adfc4e75f0a5ec465c1c4d676b92e/res/drawable-xhdpi/ic_action_delete.png -------------------------------------------------------------------------------- /res/drawable-xhdpi/ic_action_new.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nschwermann/android-websocket-example/6929b7c01f5adfc4e75f0a5ec465c1c4d676b92e/res/drawable-xhdpi/ic_action_new.png -------------------------------------------------------------------------------- /res/drawable-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nschwermann/android-websocket-example/6929b7c01f5adfc4e75f0a5ec465c1c4d676b92e/res/drawable-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 6 | 7 |