How to deal with fast data receiving and posting it to app server?

gajubhai

New member
Sep 18, 2017
1
0
0
Dear All,

My questions is about architect the android app. In my app, I am receiving the data continuously at high speed (1 data frame per 20ms) from my hardware device. I want to log this data on remote application server. What would be the best strategy to design my app so that there will not be any frame loss? How many threads I should uses and at which event I should start them?
 
First, figure out if your phone can receive a frame and log it to the remote in less than 20ms. If it can't, you may have to redesign the system. (Change the hardware device to accept a "stop" command and a "proceed" command. You can't write an app that can run faster than the hardware can, even with a dozen threads - the bottlenecks are the incoming data speed and the outgoing data speed.

If the phone can do it, try with a single thread. (Multiple threads only work if one thread can run its task to completion before another thread has to complete. If it's waiting on the results of something running in another thread, you're not making the app any faster.) If the app obviously lends itself to multithreading, try writing it that way, but just running a lot of blocked threads won't increase the app's ability to process data faster.
 

Latest posts

Trending Posts

Forum statistics

Threads
956,352
Messages
6,967,734
Members
3,163,517
Latest member
Nehasingh12