Hot answers tagged

5

When approaching optimization problems (and it kinda is one as you want to make a call faster) its generally best to first make sure that you understand exactly what is happening so when in doubt - measure and debug. Before doing any changes in the code I'd first set up debugger and probably some logs with timestamps (assuming you are testing on separate ...


2

I haven't worked with CameraX, so I'll just point out other things I noticed. In this code: cameraCaptureButton.setOnClickListener { it.isEnabled = false if (!isRecording) { isRecording = true cameraCaptureButton.setBackgroundResource(R.drawable.ic_shutter_pressed) it.invalidate(...


1

0.0 - 1.0, Is this going to crash for any reason? As you don't check, there's an ArrayIndexOutOfBoundsException that could be turned into an IllegalArgumentException. is there a better way to do this? Avoid copying altogether: Use java.nio.ByteBuffer.slice() Don't open code what the JRE provides: Use java.util.Arrays.copyOfRange(byte[] original, int from, ...


Only top voted, non community-wiki answers of a minimum length are eligible