background-service

scheduling alarm for every second in android 5.1

爱⌒轻易说出口 提交于 2019-11-27 04:31:35
问题 I want to run alarm service for every second in my application.It is working fine below 5.1 version. but it is not triggering in 5.1 devices. I am using commonsware wakeful intent service.The logcat message is saying that " Suspiciously short interval 1000 millis; expanding to 60 seconds ". How can I poll for every second in 5.1? Can anybody suggest me how to achieve this? Explanation little bit more: My use case is I need to do some operation for every 30 minutes interval. AFAIK For this

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

Service stops working when app gets closed

烈酒焚心 提交于 2019-11-26 22:09:30
问题 Here I have implemented functionality to read messages of incoming push notifications using Text-To-Speech. I created a separate service class for it which works fine and after a while notifications comes but it stops read notifications. public class TTSService extends Service implements TextToSpeech.OnInitListener { private static final String TAG = "TTSService"; private String mSpeechMessage; private TextToSpeech mTts; @Override public IBinder onBind(Intent arg0) { return null; } @Override

How to keep Bluetooth connection background?

房东的猫 提交于 2019-11-26 14:25:14
问题 I have created a Bluetooth Activity class in the android app, which works fine for all the Bluetooth functionalities like: scanning, pairing, connecting, sending and receiving data. The real problem is when the Activity is destroyed. Bluetooth is disconnecting. how can I make Bluetooth connection throughout the app. and I want to send data to the Bluetooth from other activities. Help me to implement this in an easy way? public class BTActivity extends AppCompatActivity { ArrayList

Android application as a service without activity

一世执手 提交于 2019-11-26 10:58:01
问题 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

How to check MIUI autostart permission programmatically?

天涯浪子 提交于 2019-11-26 09:06:51
问题 I need to check programmatically if the auto start permission for my app in MIUI phone is on or off. Facebook and whatsapp have this permission already enabled by default , how can I do so? 回答1: For now it's not possible. As it's completely depend on their operating system API's and customisation. Even developers have requested for this on XIOMI's official forums but there is no response from there side. Till now even i am finding an answer to this question but nothing helped me. For the time

Android Background Service is restarting when application is killed

前提是你 提交于 2019-11-26 08:14:50
问题 I am developing an application in which a background service is created to collect sensor data. I am starting the service from my activity: startService(new Intent(this, MyService.class)); I created the service so if the application is destroyed, the background service still continues to collect data. I tried this, and it worked to a certain extent. My problem is that when I kill the application, the service seems to restart because the onCreate() service and the onStart() methods are invoked

iOS: Keep an app running like a service

我怕爱的太早我们不能终老 提交于 2019-11-26 07:25:03
问题 In iOS, how would I instruct the OS to keep my app running even if it is no longer in the foreground? Skype Viber Empatica Zenly And many more apps does this. 回答1: Basically, there is no such thing as a service type app or functionality in iOS. Even the "background" apps (UIBackgroundMode) cannot run entirely free and without restrictions like a service or daemon etc. on other OSs can. Here's the situation regarding background execution and notifications and timers etc. 1) An app cannot

startForeground fail after upgrade to Android 8.1

大城市里の小女人 提交于 2019-11-26 04:09:19
问题 After upgrading my phone to 8.1 Developer Preview my background service no longer starts up properly. In my long running service I\'ve implemented a startForeground method to start the ongoing notification which is called in on create. @TargetApi(Build.VERSION_CODES.O) private fun startForeground() { // Safe call, handled by compat lib. val notificationBuilder = NotificationCompat.Builder(this, DEFAULT_CHANNEL_ID) val notification = notificationBuilder.setOngoing(true) .setSmallIcon(R