Use of threads with fragments

Search This thread

aeroxr1

Senior Member
Oct 11, 2012
215
25
Hi I have just started developping in android so I'am not an expert. My question is: I am creating an application with two fragments , both the fragments have to retrive data from a service in real-time. (In particular on fragment has to draw a plot using the data read and the other has to make move an avatar with the data read, all of this in real-time).My doubt is: do I have to use two threads, one for each fragments, or I can do this with just UI thread ?
To be more precise :
We are two guys that working on following project :
We have to receive data from a bluetooth 4.0 BLE sensor, and we have to send it to two diffent fragments In one we have to plot a 2d graph with AndroidPlot In the other we have to move a 3d rigged model using jpct-ae + bones.
We wanted to use a started service to handle bluetooth (by extending IntentService) , but we have a lot of doubts. If two fragments have to work in the same time we have to use two different threads ?

thanks for your answers and please let me know if my question is not clear. :highfive: