android-service

android camera in background

最后都变了- 提交于 2019-11-27 07:22:50
问题 I am developing an application to take images from background application say using android service. i don't want any user interaction to takes images, it should completely work from background. I have already tried - Calling camera from service - It not always works sometime works if we have dummy surfaceview, again if Android close the related activity service stopped takings pics, I don't want to run activity for user interaction. with some changes it working fine but all images are black.

How do I keep running a Service the whole time?

谁都会走 提交于 2019-11-27 07:16:58
问题 I have some process that I would like to run in the background the whole time. So I made it a Service . My question is: is there anyway to prevent from the user from killing this service? (even if he uses third party app) 回答1: No, it is not possible. It is also a bad idea. 回答2: Maybe this can help you: final Intent intent = new Intent(context, YourService.class); final PendingIntent pending = PendingIntent.getService(context, 0, intent, 0); final AlarmManager alarm = (AlarmManager) context

SpeechRecognizer causes ANR… I need help with Android speech API

℡╲_俬逩灬. 提交于 2019-11-27 06:50:50
EDIT : I should have mentioned this already, but I'm running this code in a service. The entire app is turned on/off by a widget button and has no activity. Update : I tried attaching the SDK sources to the project so I could get a more precise idea of where the failure was occurring, but from the looks of it , only public APIs are included, which seems to make them a lot less useful... can anyone suggest at least a debugging approach for solving this issue? I'm kind of stuck. I'm trying to use Android's speech recognition package to record user speech and translate it to text. Unfortunately,

Android service not restarting in lollipop

雨燕双飞 提交于 2019-11-27 06:41:05
问题 In my application, I use location based service in background. So I need to restart my service when it gets destroyed. But I got this message in logcat Spurious death for ProcessRecord{320afaf6 20614:com.odoo.crm:my_odoo_gps_service/u0a391}, curProc for 20614: null My service onTaskRemoved @Override public void onTaskRemoved(Intent rootIntent) { System.out.println("onTaskRemoved called"); Intent restartServiceIntent = new Intent(App.getAppContext(), this.getClass()); restartServiceIntent

Situations when a Service's onDestroy() method doesn't get called?

安稳与你 提交于 2019-11-27 06:13:11
问题 I'm aware that a Service's onDestroy() method may never be called but can someone tell me when such a scenario might occur? I'm especially interested in whether it's possible for a Service to be killed, yet its VM would continue to run. I ask because I have a service that registers ContentObservers in the service's onStartCommand() method and unregisters them onDestroy(). If the service's onDestroy() method was never called because the whole VM was killed (along with the observers it created,

How can location updates from FusedLocationProviderClient be processed with Work Manager?

我怕爱的太早我们不能终老 提交于 2019-11-27 06:13:05
问题 First of all, I'm a total Android noob. Have looked for solutions for some time now, but can't find any helpful hints in the right direction so far. This might be generally caused by the nature of the issue itself, being quite niche. The working code below is based on a code lab at https://codelabs.developers.google.com/codelabs/realtime-asset-tracking. I was wondering though, since it was mentioned within several resources as the preferred way now, how you'd do something like that based on

How to add a floating view to Android Window manager and listen to System/Hardware back button events

僤鯓⒐⒋嵵緔 提交于 2019-11-27 05:38:12
问题 I have a service which displays a floating view on the window manager (using WINDOW_TYPE_ALERT permission). I'm able to display it and perform actions. But, I have two specific questions: Regarding the implementation of the floating view How to listen to system back button event so that I can dismiss the view. Implementation: In the manifest I added permissions for: <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" /> I have a broadcast receiver which will listen for

How does doze mode affect background/foreground services, with/without partial/full wakelocks?

妖精的绣舞 提交于 2019-11-27 04:24:26
This is a simple question, seeing that there is a huge post about this on G+ ( here ), and lack of information on official docs ( here ): What happens to the app's services when the device goes to "doze" mode? What does it do to background/foreground services (bound/unbound, started/not-started), with/without partial/full wakelocks? What would you do, for example, in order to create a service that plays an audio stream while the device's screen is turned off? What if the audio stream is not from a local file, but from the network? Seeing that there was a claim by Google developer: Apps that

Camera frames in a service / background process

瘦欲@ 提交于 2019-11-27 04:08:16
问题 For scientific measurements, I would like to access the camera frames from a service. The idea is to analyze the images coming from the camera in real-time under some conditions. Since the phone might be restarted or simply locked, it should be possible to start the process from a service. For now, I was satisfied by using a Camera.Callback and the onPreviewFrame callback, but it appears that it only works if my application is running in foreground. More precisely, the camera requires a valid

Android application as a service without activity

痴心易碎 提交于 2019-11-27 04:03:32
I am making a set of apps and I have pretty much the same background service for all of them. I'm trying to make an app that has only this Service . so I don't repeat it in all of them, but the thing is don't need any Activity . because there is no UI needed for it, and so the user can't close it except if they stop the Service . I tried to remove the Activity , but then the app doesn't run or start. My question is: can I make an app exactly like Google Play Services so other apps can use its Service . If yes than a snippet or a sample would be very welcome. Sure! No reason you cannot have an