問題タブ [backgrounding]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
android - Store (or send) data from Bluetooth device when app is in background
I'm developing an Android app that reads data from a Bluetooth device and saves it to disk (and perhaps send some data to a server). The Bluetooth device is a wearable with a heart rate sensor and a bunch of other sensors. It sends data to the Android app every second or so.
The app works fine when in foreground, but when in background, it gets killed after a few minutes (usually 15 to 30 min).
I understand the concepts of foreground and background services and it seems like what I need here is a foreground service (correct me if I'm wrong) to make sure the process doesn't get killed. It's a pain however because I'll have to move most of my app's classes in remote objects in the foreground service classes.
However! I noticed that just creating a simple foreground service and binding my main activity to it makes it so that the activity doesn't get killed as fast, as a matter of fact I tested it for an hour and a half and everything was still running smoothly in the main activity process.
Could that just be the solution I'm looking for? Or do I really have to move most of my classes in remote objects in a more complex foreground service?
linux - Bash でのバックグラウンド プロセスの速度に対する利益が減少するのはなぜですか?
Bash スクリプトで多くのプロセスをバックグラウンド化すると、速度が低下する理由を理解しようとしています。何かのようなもの:
ゲートから 10,000、20,0000 まで悲鳴を上げます... しかし、70,000... 80,000 前後でバックグラウンド プロセスを立ち上げる速度が遅くなり始めます。同様に、カウントが画面に出力される速度は、合計に応じて一見直線的に遅くなります。
マシンが基本的に即座に終了するバックグラウンド ジョブを実行できる速度は、追加および終了されたジョブの数に関係なく一定であるべきではありませんか?