in a couple of days before, I wrote some lines of code to connect application to a HC-05(a Bluetooth module) via a service. I know that a simple service can not be alive in a android 8+. so I modify my service using some free tutorials available on YouTube channels like the following: https://www.youtube.com/watch?v=BXwDM5VVuKA android 7- don’t have any problem
Tag: service
Android Java Notification Not Displaying
This is my first time working with Notifications and I can’t seem to figure out the issue. What I am Trying To do: In short, I have a service that checks for a variable in a firebase document, if it’s true, show a notification. And before you say it, I can’t use Cloud Functions in this scenario. I’ll explain, everything
Android application with MVVM architecture, writing to local Room database from a Service using MVVM, how should the Service write to the database?
In MVVM we have Activities and Fragments. Fragments and Activities have access to ViewModel. ViewModles have access to Repository. Repository has access to local and online database. I want to build a Service component so that when the application is put on background the Service should continue to write to the local database. This is how my application looks like:
How to access a variable of a service from an activity
I understand that in order to access methods of a service from an activity, we should bind the service. But if we just want to get the value of a variable in the service, can we just access it like so without binding? It works, but Iām not sure if it has any memory leak implications or any other issues.
How to properly use 3 – layers architerchture in Spring MVC – Java
I come before you with a confusion that, perhaps, you can clarify to me. I’m learning now how to use 3-layers architecture with Spring MVC (using Repository, Service, Controllers), but I don’t understand the following things and how I should do it: -Service Layer, here, I do not understand, the methods defined in the interface should be the same as
Implementing exit app button in the persistent notification
My app runs a background service indicated by the persistent notification. Users need to use the toggle button in MainActivity to turn on/off this service and thus to remove the persistent notification. Now I want to implement a notification action that can turn this service off & as well as the toggle within MainActivity. All in all, it should be
Android service not working when app is closed
I’m having trouble with an android service that I’m doing. The service is about to get the location of the user every 5 minutes. All seems to go well except when i kill the app, the service won’t do nothing. In the code you will ses its checking every 60 seconds I think, but this will change to 5 minutes.
How can I create a notification channel for Android API level < 26 (before Android Oreo)? [closed]
Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 2 years ago. Improve this question I am currently working with an Android service: https://developer.android.com/guide/components/services I am creating a service that has to be a foreground service. But looking at the
Using Intent.createChooser and getting error: Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag
I want to open the share via option from the service class. It is working fine in Android 7, but in 8+ OS it starts showing android.util.AndroidRuntimeException: Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want? I have also included this flag to my Intent, but it’s still showing the same
Can’t use FileObserver to Observe Files Inside a Folder
I want to observe if any file/folder is added inside /storage/emulated/0/DCIM/Camera using FileObserver in a service, but it didn’t work. Please tell me if there is anything wrong in my code š. Here is the source code: AndroidManifest.xml I added the uses-permission and service tags: LogWatcherService.java I added FileObserver inside the service, and overrided its onEvent method: MainActivity.java I start