From 2a19a583759a23a5b853c58d7a6f6ac9cdde978d Mon Sep 17 00:00:00 2001 From: nandokoch Date: Tue, 15 Aug 2017 11:11:06 +0200 Subject: [PATCH] Added Polling Thread --- .../android/wearable/controller/ApplicationGen.xtend | 5 +++++ .../android/wearable/model/ContentProviderGen.xtend | 10 ++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/de.wwu.md2.framework/src/de/wwu/md2/framework/generator/android/wearable/controller/ApplicationGen.xtend b/de.wwu.md2.framework/src/de/wwu/md2/framework/generator/android/wearable/controller/ApplicationGen.xtend index 7f246d21..7fabd2ee 100644 --- a/de.wwu.md2.framework/src/de/wwu/md2/framework/generator/android/wearable/controller/ApplicationGen.xtend +++ b/de.wwu.md2.framework/src/de/wwu/md2/framework/generator/android/wearable/controller/ApplicationGen.xtend @@ -18,6 +18,8 @@ class ApplicationGen { import «Settings.MD2LIBRARY_TASKQUEUE_PACKAGE_NAME»; import «Settings.MD2LIBRARY_VIEWMANAGER_PACKAGE_NAME»; import «Settings.MD2LIBRARY_WIDGETREGISTRY_PACKAGE_NAME»; + import «Settings.MD2LIBRARY_PACKAGE»model.contentProvider.implementation.Polling; + public class «app.name.toFirstUpper» extends Application { @@ -40,6 +42,9 @@ class ApplicationGen { wr = Md2WidgetRegistry.getInstance(); context = getApplicationContext(); Controller.getInstance().run(); + Thread t = new Thread(new Polling(cpr)); + t.start(); + } public static Context getAppContext() { diff --git a/de.wwu.md2.framework/src/de/wwu/md2/framework/generator/android/wearable/model/ContentProviderGen.xtend b/de.wwu.md2.framework/src/de/wwu/md2/framework/generator/android/wearable/model/ContentProviderGen.xtend index 4a0874d2..dacf4506 100644 --- a/de.wwu.md2.framework/src/de/wwu/md2/framework/generator/android/wearable/model/ContentProviderGen.xtend +++ b/de.wwu.md2.framework/src/de/wwu/md2/framework/generator/android/wearable/model/ContentProviderGen.xtend @@ -247,8 +247,11 @@ import «Settings.MD2LIBRARY_PACKAGE»controller.eventhandler.implementation.Md2 public void newEntity(){ content = new «(content.entity as Entity).name»(); } - + public void update() { + System.out.println("single wurde geupdated"); + } } + '''} @@ -317,7 +320,10 @@ import de.uni_muenster.wi.md2library.model.contentProvider.implementation.Abstra } } - } + public void update() { + System.out.println("multi wurde geupdated"); + } + ''' }