background-service

ios nstimer run in background for check alarm time is equal to current time and play audio

青春壹個敷衍的年華 提交于 2019-11-29 09:01:38
I googled it for hours, but could not find any information if there is any way to keep a running NSTimer active when the app is running in the background ? Please Help me , when app is go to background then one function run and each sec check alarm time is equal to current time , then play audio and open close alarm page If anybody know alarm app open source and its run on background please share with me Here i try this , but this is not working - (void)applicationDidEnterBackground:(UIApplication *)application { inBackground=YES; UIApplication* app = [UIApplication sharedApplication]; bgTask

How to use Android AlarmManager with small intervals like 1 minute?

不打扰是莪最后的温柔 提交于 2019-11-29 07:56:50
I want to make some external service monitor and be notified on problems as fast as possible. I tried to set up AlarmManager with 1-2 minutes interval, but it looks like it fires randomly every several minutes. Of course, I want to be safe from killing my background task by android, which would stop monitoring if I just use Service . Is it possible to use AlarmManager in small, accurate intervals? Which approaches are used in applications like Facebook, Gmail to notify about new messages? Would it be better to make Service with startForeground and partial WakeLock ? I tried to set up

Voice Recognition as a background service

穿精又带淫゛_ 提交于 2019-11-28 21:08:56
问题 Is it possible to implement an activity as a service? My activity is a voice recognition activity. I want to have the activity running in the background of the app constantly checking for voice and when the user says a command it will recognize it and then perform the action. My question is...is it possible to do this and if so how can the background service notify the current activity or application? There was a previous post on this which had no clear answer...Thanks for any input or help.

Get location in Ionic/Cordova app when in background

别来无恙 提交于 2019-11-28 18:37:31
Is it possible to run a background service if I close my Ionic/Cordova app (both for iOS and Android) ? For the purpose I picked that pluging https://github.com/katzer/cordova-plugin-background-mode So far I have that code: $ionicPlatform.ready(function () { cordova.plugins.backgroundMode.isEnabled(); cordova.plugins.backgroundMode.configure({ silent: true }) ............ ///do some task )} It works fine if the app goes to the foreground but as soon as I close the application the task I am running stops as well. So is there any workaround/way to make my task running even if the app is closed ?

How to update LiveData of a ViewModel from background service and Update UI

邮差的信 提交于 2019-11-28 03:38:31
Recently I am exploring Android Architecture, that has been introduced recently by google. From the Documentation I have found this: public class MyViewModel extends ViewModel { private MutableLiveData<List<User>> users; public LiveData<List<User>> getUsers() { if (users == null) { users = new MutableLiveData<List<Users>>(); loadUsers(); } return users; } private void loadUsers() { // do async operation to fetch users } } the activity can access this list as follows: public class MyActivity extends AppCompatActivity { public void onCreate(Bundle savedInstanceState) { MyViewModel model =

ios nstimer run in background for check alarm time is equal to current time and play audio

。_饼干妹妹 提交于 2019-11-28 02:22:55
问题 I googled it for hours, but could not find any information if there is any way to keep a running NSTimer active when the app is running in the background ? Please Help me , when app is go to background then one function run and each sec check alarm time is equal to current time , then play audio and open close alarm page If anybody know alarm app open source and its run on background please share with me Here i try this , but this is not working - (void)applicationDidEnterBackground:

How to restart service after the app is killed from recent tasks

给你一囗甜甜゛ 提交于 2019-11-27 12:13:31
I have created a service to fetch current location of the device in periodic intervals. I want the service to run in the background even if the app is cleared from recently opened apps. Currently the service runs in background only until app is present in the recently opened apps but stop immediately when app is swiped off (or killed in some other way). I have tried all sort of help available in stack overflow yet I am unable to solve this. Please help. Here is my code for the service. package com.packr.services; import android.app.AlarmManager; import android.app.PendingIntent; import android

How to keep Bluetooth connection background?

喜你入骨 提交于 2019-11-27 08:58:15
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<BluetoothDevice> devices = new ArrayList<>(); BluetoothAdapter mBluetoothAdapter; BluetoothDevice mBluetoothDevice

How to check MIUI autostart permission programmatically?

限于喜欢 提交于 2019-11-27 06:27:52
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? 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 being it will be only possible for rooted phones. i.e. making customisation in their firmware by becoming

How to update LiveData of a ViewModel from background service and Update UI

筅森魡賤 提交于 2019-11-27 05:11:16
问题 Recently I am exploring Android Architecture, that has been introduced recently by google. From the Documentation I have found this: public class MyViewModel extends ViewModel { private MutableLiveData<List<User>> users; public LiveData<List<User>> getUsers() { if (users == null) { users = new MutableLiveData<List<Users>>(); loadUsers(); } return users; } private void loadUsers() { // do async operation to fetch users } } the activity can access this list as follows: public class MyActivity