I am trying to show an activity when the screen is locked. I am running a service in the background, when an event occurs, I want to open an activity even if the app is locked. I have followed the following steps, When OnReceive() is called, I want to open the activity on lock screen. ..
Category : service
I’m creating an audiobook player, and I’m using MediaSessionCompat related classes to handle notifications. My code is heavily inspired by the android-MediaBrowserService samples ( https://github.com/googlearchive/android-MediaBrowserService ), and i’m not quite understanding it all for the moment ( the createContentIntent espicially ) Here is my simple class in charge of building notifications from a bookPlayer providing ..
I know that are many questions about this topic but I don’t understand. Let’s see. I know that for know the incoming number I have to use a BroudcastReciver. But this don’t work if the app is closed. Many post said that I have to register the broudcast in the service, but I read that ..
I need to reopen my app under certain conditions when user try to close it or forbid him to do it. I try use foreground service for this case, but it is not able to start activity from service in Android 10. How I can solve this problem? Source: Android..
I have 2 services run on 2 different processes like this: <service android:name=".MyService1" android:enabled="true" android:exported="false" android:process=":process1" /> <service android:name=".MyService2" android:enabled="true" android:exported="false" android:process=":process2" /> And in 2 this service, I start the same service. <service android:name=".LogService" android:enabled="true" android:exported="false" android:process=":service" /> In each service in process1 and process2. Intent intent = new Intent(this, LogService.class); startService(intent); Questions: Are ..
I have been using a handler with a timer in service class and sending location to the server every 5 sec via socket. It is working but when I stop service, cancel timer and remove handler callback, and want to restart again then the timer gets not started again. But when I start service without ..
I am working on an app that tracks user location and, on some devices and Android versions, it seems the foreground service used to get the location updates, gets killed. I have read some other similar questions, and so far the only way to mitigate this would be to use START_STICKY with the Service and ..
When i am using WorkManager and I’m trying to pass some object to it Data data = new Data.Builder().put("passstring",object).build(); getting me Builder.put can only be called from within the same library group (groupId=androidx.work) error Source: Android..
I’m pretty new to programming and android and try to write one of my first app. I want to reschedule notifications after the phone reboot. I stuck on onHandleIntent() when I trying to get access to db. There is nothing happening and no errors. Event.class @Entity(tableName = "event_table") public class Event { @PrimaryKey(autoGenerate = true) ..
I did reference a binding project in my Xamarin.Android project, but I am having problem implementing the sample project in java into C#. This is de code in the android studio project: Private IProviderBinder providerBinder; private ServiceConnection serviceConnection = new ServiceConnection() { @Override public void onServiceConnected(ComponentName name, IBinder service) { /* we have a connection ..
Recent Comments