android - Are their any negatives impacts of launching two continues services at the same time? What are some alternatives if so? -
i planning on having activity 2 check boxes. want tasks when screen off in background continuously based on user check marks.
final checkbox checkbox = (checkbox) findviewbyid(r.id.checkbox_id); if ( checkbox1.ischecked() && myserviceisntrunning() ) { startservice(myservice1.class) if ( checkbox2.ischecked() && myservice2isntrunning() ) { startservice(myservice2.class) }
if both checkmarks checked, wan't both tasks run in background forever using method. there harm in launching both services @ once? there doesn't appear documentation in optimization tips documentation, , saw page it: can start 2 services same activity , can run activity , 2 services parrallely in android?. so, starting 2 services parallely forever idea?
as long not conflict, ok have more 1 service running. battery life , memory may affected, depending on code. if possible, can consider merging them 1 service handle 2 tasks.
Comments
Post a Comment