Running background task and updating values in different fragements.

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Running background task and updating values in different fragements.

Devendra Devadiga
I have two fragments in my android application
I had created a JNI library which will call C API (Reading CAN values.)

CAN_Init() JNI need to call only once.
Read_Pid() JNI API I implemented and it will return integer array of 16 values and it should be call for every 250ms.

In each fragment I have 8 textview, so totally 16.

So how I can call Read_Pid() such that, if I am in first fragment only 8 (index 0 to 7) values I need to display in textview and if I am in second fragment I need to display another 8 (index 9 to 15), but Read_Pid() should keep on running in background for every 250ms.

Please can you suggest me what method (Service/Thread/AsyncTask/BroadcastReciever or what ?) I need to use in this situation ?

Please can you share me the example source code for this type of application ?

--
--
unsubscribe: [hidden email]
website: http://groups.google.com/group/android-porting

---
You received this message because you are subscribed to the Google Groups "android-porting" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/android-porting/cca3070a-e7cf-4ca1-b0ab-f7b2ba0f2463n%40googlegroups.com.