From 8e20d683ca3523bdcdc0135b7012e9addbd9c524 Mon Sep 17 00:00:00 2001 From: Yelin Jeong Date: Mon, 22 Apr 2024 20:56:21 +0900 Subject: [PATCH] App/Service: Bound service to MainActivity This patch bounds service to MainActivity. Signed-off-by: Yelin Jeong --- .../src/main/AndroidManifest.xml | 1 + .../ml/inference/offloading/MainActivity.kt | 58 +++++++++++++++++-- .../ml/inference/offloading/MainService.kt | 17 +++++- .../src/main/res/layout/activity_main.xml | 15 +++++ 4 files changed, 84 insertions(+), 7 deletions(-) create mode 100644 ml_inference_offloading/src/main/res/layout/activity_main.xml diff --git a/ml_inference_offloading/src/main/AndroidManifest.xml b/ml_inference_offloading/src/main/AndroidManifest.xml index c572016..fa91404 100644 --- a/ml_inference_offloading/src/main/AndroidManifest.xml +++ b/ml_inference_offloading/src/main/AndroidManifest.xml @@ -4,6 +4,7 @@ + (R.id.start) + start.setOnClickListener(View.OnClickListener { + if (mBound) { + mService.startServer() + } + }) + + val stop = findViewById