background-process

IBM Worklight - How to use Worklight in a background process

主宰稳场 提交于 2019-12-25 01:44:40
问题 I have an application that should run continuously even after the user presses the back button. It has to send some data using POST method to my database in a remote server for every half an hour. This should happen even after the user has pressed the back button and the app should only stop when the mobile is switched off. While I have set up the HTTP Adapter to send POST data and also an HTML file to call the adapter procedures on launch, I dont know how to make it background or which code

Background execution in Oreo Android devices

╄→尐↘猪︶ㄣ 提交于 2019-12-25 01:19:22
问题 Mine is a Cordova based hybrid app. Inside our activity(say A), there is a button which when clicked launches another activity, say B. B is actually inside a cordova plugin. So of course we use javascript to initiate B. So when B is running, A wants to know the last active timestamp. A triggers a javascript call(since B is inside a plugin) to get the last active stamp every 1 minute. In devices below Oreo, everything works fine. In devices with Oreo, the javascript call gets blocked after 5

Android keep BroadcastReceiver while the app is closed

荒凉一梦 提交于 2019-12-25 00:38:02
问题 I use BroadcastReceiver of ACTION_BATTERY_CHANGED to get an event every time the battery is 50%. I can't declare ACTION_BATTERY_CHANGED in manifest, so I declared the BroadcastReceiver in a Service (START_STICKY). But, when I remove the app from recent apps screen the BroadcastReceiver stops getting battery change events. How can I keep it in background? *In many apps that show battery percent in status bar, the percent is updated while the app is closed. How? 回答1: You really cannot do what

Best way to trigger an hour before event starts

痴心易碎 提交于 2019-12-24 16:19:01
问题 I have many Appointment models that start at various times of the day, either at :00, :15, :30, :45 . I'd like to trigger code to send a reminder 1 hour before the event starts. What would be the best way to use a background worker to trigger this? I'm using the clockwork gem as well so I can schedule Sidekiq workers. 回答1: The clockwork gem is for fixed schedule jobs (a replacement for cron). You'll want to use ActionMailer.delay_until that comes with sidekiq : class Appointment after_create

How to completely background a process in Perl CGI under IIS

爱⌒轻易说出口 提交于 2019-12-24 10:59:49
问题 Thanks to some other great posts here (like this and that), I have several reliable methods to background a process in a Perl script. However, in my environment (IIS6 on Windows Server 2003), it doesn't seem to completely background. Take this script: use CGI::Pretty qw(:standard); print header; print start_html; print "hi<br>"; system(1,qw(sleep 10)); print "bye"; print end_html; The browser will stay "connected" for 10 seconds while the sleep process runs. "hi" and "bye" will both be

Access Codeigniter functions from external script

我是研究僧i 提交于 2019-12-24 09:08:07
问题 So, here's my situation : I have a complete app set up with CodeIgniter. I'm initiating a background task , running a PHP script. My question : How could I use CodeIgniter function (e.g. $this->db or $CI->db - doesn't matter) from that external PHP script? Idea : Could a workaround, like include 'index.php'; at the top of the script do the trick? 回答1: In recent Codeigniter versions you can run standard controller actions from command line. If your task is some kind of a daemon you can embed

The application still in ram after using it and take more-2 space each time i play the app?

守給你的承諾、 提交于 2019-12-24 08:33:09
问题 I have worked on the application which I present in the RAM after I am out of my application. Also the size in RAM is increases every time when I play the application. I don't know why it is happening. Please suggest me something. Also I am using timer in my application for 15 sec and after completing the time I show I Dialog that Your time is over. But some times that dialog appear 3-4 times on one time finish of time. This is very embarrassing for my application. Is this thing is due to the

Application crashes in background, when popping a fragment from stack

倾然丶 夕夏残阳落幕 提交于 2019-12-23 20:59:50
问题 Application crashes, when I hit a server RPC, and when the RPC is in progress, I put the application in background. Meanwhile, when the RPC gets the response from server, it pops a fragment from stack. While popping the fragment, the application crashes. I have read about creating WeakReference, which will be null if the activity is destroyed. But not sure how to implement it this case. Following is my code : private void showFragment(SherlockFragment fragment) { FragmentManager fm =

Pass file to Active Job / background job

爷,独闯天下 提交于 2019-12-23 17:28:01
问题 I'm receiving a file in a request params through a standard file input def create file = params[:file] upload = Upload.create(file: file, filename: "img.png") end However, for large uploads, I'd like to do this in a background job. Popular background jobs options like Sidekiq or Resque depend on Redis to store the parameters, so I can't just pass a file object through redis. I could use a Tempfile , but on some platforms such as Heroku, local storage is not reliable. What options do I have to

Push notifications disappear if received while app not running

故事扮演 提交于 2019-12-23 16:28:07
问题 I'm developing an app that can receive push notifications which, in some circumstances, trigger background fetch operations. Therefore, I've enabled the remote-notification background capability for my app. When the app is suspended, push notifications cause the app to wake up and execute application:didReceiveRemoteNotification:fetchCompletionHandler , the banner appears on the homescreen, and the notification remains in the Notification Center until the user taps it to launch the app. It