java - Making two threads to continue running in background -
i'm writing android app involves 1 audiotrack , 1 audiorecord. run in 2 different threads, , both of them need continue run , not being killed when low memory/cpu if app running in background. searched , know use asynctask (just in music streaming app). however, i'm no sure how because thread runs audiotrack first created (once button on main activity pressed), thread create thread runs audiorecord (by creating runnable).
i searched , know use asynctask (just in music streaming app)
no. issue not threads, process.
both of them need continue run , not being killed when low memory/cpu if app running in background
strictly speaking, not possible. closest use service
in turn uses startforeground()
indicate has foreground priority. minimize probability android terminate process due low memory conditions, not eliminate it.
also, please note need cpu powered on perform audio tasks. that, in turn, require wakelock
. going hammer user's battery, point should advise users keep device on charger. particularly important in future, "doze mode" of upcoming "m" android release block use of wakelocks
if device idle, unmoving, , not on charger.
Comments
Post a Comment