Time critical apps in Android?

KMatle

Expert
Licensed User
Longtime User
Earlier I saw some comparison between iOS and Android depending on midi-player apps which need to be very accurate in time synching. iOS would be "much better here" (don't know why).

Any ideas how to develop time critical apps in Android (e.g. exactly every second som sub is called)?
 

stevel05

Expert
Licensed User
Longtime User
With multi threaded / multi tasking environments, it would be impossible to ensure that the timing is exact. Unless you were coding at the system level, in which case it would wreak havoc with the overall timing of other processes.

When porting the midi library I used the same method that is used in the standard Java version. Which is to check the required timing against elapsed time. That way if one of the calls was slightly out for what ever reason, it would sync itself again on the next call. For audio, a discrepancy in the order of 20 ms would not be noticed as long as it doesn't have a cumulative effect.
 
Last edited:
Top