From 6a2eddeea6e0f8a3ddbb914e0848f1c7f6fd5c5e Mon Sep 17 00:00:00 2001 From: "florian.bramer" Date: Mon, 15 Jun 2015 20:11:08 +0200 Subject: [PATCH] made binding of headunit service working --- 2015/android/Geofence/headunitservicemock/build.gradle | 5 +++-- .../com/esrlabs/headunitservicemock/ApplicationTest.java | 2 +- .../headunitservicemock/src/main/AndroidManifest.xml | 5 ++++- .../HeadUnitService.java | 9 ++++++++- README.md | 2 ++ 5 files changed, 18 insertions(+), 5 deletions(-) rename 2015/android/Geofence/headunitservicemock/src/main/java/com/esrlabs/{headunitservicemock => headunitservice}/HeadUnitService.java (83%) diff --git a/2015/android/Geofence/headunitservicemock/build.gradle b/2015/android/Geofence/headunitservicemock/build.gradle index 00216da..a5d04f4 100644 --- a/2015/android/Geofence/headunitservicemock/build.gradle +++ b/2015/android/Geofence/headunitservicemock/build.gradle @@ -3,9 +3,8 @@ apply plugin: 'com.android.application' android { compileSdkVersion 22 buildToolsVersion "22.0.1" - defaultConfig { - applicationId "com.esrlabs.headunitservicemock" + applicationId 'com.esrlabs.headunitservice' minSdkVersion 17 targetSdkVersion 22 versionCode 1 @@ -17,6 +16,8 @@ android { proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } + productFlavors { + } } dependencies { diff --git a/2015/android/Geofence/headunitservicemock/src/androidTest/java/com/esrlabs/headunitservicemock/ApplicationTest.java b/2015/android/Geofence/headunitservicemock/src/androidTest/java/com/esrlabs/headunitservicemock/ApplicationTest.java index 566133b..61dac17 100644 --- a/2015/android/Geofence/headunitservicemock/src/androidTest/java/com/esrlabs/headunitservicemock/ApplicationTest.java +++ b/2015/android/Geofence/headunitservicemock/src/androidTest/java/com/esrlabs/headunitservicemock/ApplicationTest.java @@ -1,4 +1,4 @@ -package com.esrlabs.headunitservicemock; +package com.esrlabs.headunitservice; import android.app.Application; import android.test.ApplicationTestCase; diff --git a/2015/android/Geofence/headunitservicemock/src/main/AndroidManifest.xml b/2015/android/Geofence/headunitservicemock/src/main/AndroidManifest.xml index a35541e..aec6209 100644 --- a/2015/android/Geofence/headunitservicemock/src/main/AndroidManifest.xml +++ b/2015/android/Geofence/headunitservicemock/src/main/AndroidManifest.xml @@ -1,6 +1,6 @@ + package="com.esrlabs.headunitservice" > + + + diff --git a/2015/android/Geofence/headunitservicemock/src/main/java/com/esrlabs/headunitservicemock/HeadUnitService.java b/2015/android/Geofence/headunitservicemock/src/main/java/com/esrlabs/headunitservice/HeadUnitService.java similarity index 83% rename from 2015/android/Geofence/headunitservicemock/src/main/java/com/esrlabs/headunitservicemock/HeadUnitService.java rename to 2015/android/Geofence/headunitservicemock/src/main/java/com/esrlabs/headunitservice/HeadUnitService.java index 3013b2f..ef051c7 100644 --- a/2015/android/Geofence/headunitservicemock/src/main/java/com/esrlabs/headunitservicemock/HeadUnitService.java +++ b/2015/android/Geofence/headunitservicemock/src/main/java/com/esrlabs/headunitservice/HeadUnitService.java @@ -1,4 +1,4 @@ -package com.esrlabs.headunitservicemock; +package com.esrlabs.headunitservice; import android.app.Notification; import android.app.NotificationManager; @@ -7,6 +7,7 @@ import android.content.Context; import android.content.Intent; import android.os.IBinder; import android.os.RemoteException; +import android.util.Log; import com.esrlabs.headunitinterface.HeadUnit; @@ -18,23 +19,29 @@ import com.esrlabs.headunitinterface.HeadUnit; * Will use the Android UI instead */ public class HeadUnitService extends Service { + + public static final String TAG = "HeadUnitServiceMock"; + public HeadUnitService() { } @Override public IBinder onBind(Intent intent) { + Log.i(TAG, "onBind"); return binder; } private final HeadUnit.Stub binder = new HeadUnit.Stub() { @Override public void showNotification(String text) throws RemoteException { + Log.i(TAG, "showNotification '" + text + "'"); Notification.Builder builder = new Notification.Builder(getBaseContext()).setContentText(text).setSmallIcon(R.drawable.tum_logo); notificationService().notify(0,builder.build()); } @Override public void hideAllNotifications() throws RemoteException { + Log.i(TAG, "hideAllNotifications"); notificationService().cancelAll(); } }; diff --git a/README.md b/README.md index 64828c2..017f836 100644 --- a/README.md +++ b/README.md @@ -1 +1,3 @@ # tum_workshop + +Collection of our excercises hold at the TUM (Technische Universität München) about automotive and android.