I am actually working on Android Call block App. however my part of code requires Java to generate obstacle/noise in the phone call.
I want to generate mute and unmute signals in a loop with varying intervals between them. Let me show with Pseudo Code in order to quickly explain logic.
array Tmute=[1,1,1,3,1,1,1,1,1]; //time in seconds to mute microphone
array TunMute=[3,1,2,4,1,2,1,2,4]; //time in seconds to unmute microphone
int i=0;
runThisLoop for (UserDefinedTime t)
{
MuteTheMicroPhone();
thread.sleep(Tmute[i]);
UnMuteTheMicroPhone();
thread.sleep(TunMute[i]);
i++;
}
DropCall();
I will take care of array out of bounds. My Question : Is there a better way to generate the specific Tmute and TunMute which matches my pattern of noise generation, my pattern is shown in Array. Since I am using Android Device memory, I was concerned about efficient programming. Please comment and let me know if this question is not clear.