android-service

Android download queue using DownloadManger

北城以北 提交于 2019-12-19 03:59:29
问题 I'm using DownloadManager to download my files in android and its great since it handles everything (connectivity lost, retry, etc.) The problem is I want my file to be downloaded in queue one after another and as far as i know DownloadManager doesn't provide this functionality. So multiple call to DownloadManager.enqueue(...) results in concurrent download of all the files. How can i fix this? I can not just make a queue in my activity and send downloads to DownloadManger one by one since

BroadcastReceiver trying to return result during a non-ordered broadcast - PACKAGE_ADDED in Android

三世轮回 提交于 2019-12-18 18:37:48
问题 I am getting this exception in my below given code. i don't have any idea what is wrong with this code. Please help me out to get rid of this exception. 05-23 23:33:49.853: E/BroadcastReceiver(26895): BroadcastReceiver trying to return result during a non-ordered broadcast 05-23 23:33:49.853: E/BroadcastReceiver(26895): java.lang.RuntimeException: BroadcastReceiver trying to return result during a non-ordered broadcast 05-23 23:33:49.853: E/BroadcastReceiver(26895): at android.content

Android service stops when I exit from application

不打扰是莪最后的温柔 提交于 2019-12-18 16:54:22
问题 I have an application with a service. Service is started by app in the main activity on create method. My problem occurs when I exit from application: service stops and sometimes restarts immediately, sometimes restarts lately. I tested in version 4.1.2 and version 2.3.6. service does not again in version 2.3.6. Is my approach wrong? Between the stop and restart times, the call that must blocked can come. Is there any way to not stop the service when app is exited? Note: I cannot use a remote

Silent Google Sign In in android background service

强颜欢笑 提交于 2019-12-18 16:34:15
问题 I am running a background service in my android app. I use the IdToken that I get from the sign in activity to authenticate at the backend server. The service is running in START_STICKY mode, so even when the app is closed, the service keeps running in the background to get any notifications from the backend server. The problem I'm facing is when the IdToken expires, I am not able to renew it in the service itself. The callback function does not receive any result if the token has expired. If

Permission issue while starting a service from android

倾然丶 夕夏残阳落幕 提交于 2019-12-18 14:53:14
问题 I have written a service as part of an application. I try to call this service from a second application using the following code: Intent intent = new Intent () ; intent.setClassName("com.test" ,"com.test.DownloadService") ; // Create a new Messenger for the communication back Messenger messenger = new Messenger(handler); intent.putExtra("MESSENGER", messenger); intent.setData(Uri.parse("http://www.vogella.com/index.html")); intent.putExtra("urlpath", "http://www.vogella.com/index.html");

Permission issue while starting a service from android

北城以北 提交于 2019-12-18 14:52:58
问题 I have written a service as part of an application. I try to call this service from a second application using the following code: Intent intent = new Intent () ; intent.setClassName("com.test" ,"com.test.DownloadService") ; // Create a new Messenger for the communication back Messenger messenger = new Messenger(handler); intent.putExtra("MESSENGER", messenger); intent.setData(Uri.parse("http://www.vogella.com/index.html")); intent.putExtra("urlpath", "http://www.vogella.com/index.html");

Is it possible to have Android Voice Recognition (as a custom service) on Google Glass?

一世执手 提交于 2019-12-18 13:37:52
问题 We have a demo android application (Android 4.0.3) that runs voice recognition as a service, and (continuosly) logs the results of the recognition on the view. Everything is working fine in our smartphones. We would like to replicate this scenario in a Google Glass immersion application, but we always have this error message when we try to start the service: no selected voice recognition service Are there some known limitations? Or have someone figured out how to resolve this kind of problem?

Using GoogleApiClient in a service

吃可爱长大的小学妹 提交于 2019-12-18 12:19:14
问题 I am trying to get location update information in service. For this I have created a service and in onStartCommand of service class I am creating GoogleApiClient, but I am not getting connection call back in the service. Please help to resolve this. Below given is the service code and in activity I have started service using startService method : startService(new Intent(this, LocationService.class)); service code public class LocationService extends Service implements GoogleApiClient

MediaPlayer Service Android

梦想与她 提交于 2019-12-18 11:52:54
问题 I am new to Android. I am creating service for Media Player so that it can continue to play song even if i close the application. I have created activity for Media Player and it is having all the functionality like play , pause , next , previous , seekbar and also includes oncompletionlistener . All works excellent. But Now i want that all should be managed by service. I have Created MyService Class : public class MyService extends Service { public static MediaPlayer mp; @Override public

MediaPlayer Service Android

风格不统一 提交于 2019-12-18 11:52:26
问题 I am new to Android. I am creating service for Media Player so that it can continue to play song even if i close the application. I have created activity for Media Player and it is having all the functionality like play , pause , next , previous , seekbar and also includes oncompletionlistener . All works excellent. But Now i want that all should be managed by service. I have Created MyService Class : public class MyService extends Service { public static MediaPlayer mp; @Override public