Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

Use of threads with fragments

OP aeroxr1

26th August 2014, 12:21 PM   |  #1  
OP Senior Member
Thanks Meter: 25
 
177 posts
Join Date:Joined: Oct 2012
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.
Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes