I have a simple app which does some not-too-complex calculations in separate threads in a MainViewModel java class, whose methods are called from within a MainActivity.java class which in turn updates a very simple UI with two buttons, two text fields and a text view.
I am getting these warnings of high skipped frames:
2024-04-28 15:32:20.893 20041-20041/com.niff.inout I/Choreographer: Skipped 365 frames! The application may be doing too much work on its main thread.
2024-04-28 15:32:31.805 20041-20041/com.niff.inout I/Choreographer: Skipped 298 frames! The application may be doing too much work on its main thread.
2024-04-28 15:33:25.564 20041-20041/com.niff.inout I/Choreographer: Skipped 2733 frames! The application may be doing too much work on its main thread.
I have used the emulator (API level 30) for the most part, but the warnings have also come on my device – on one occasion over 16,000 frames skipped.
They seem to come as the app is loading onto the emulator or device. I have overriden the MainActivity’s ‘onResume()’ method to read very simple data from a file (again, on a separate thread in MainViewModel.java).
The warnings come randomly and inconsistently – I can go days on end with the numbers of skipped frames below 50, then suddenly they are in the thousands. But I have never noticed any flickering of the screen on the emulator or device, which I understand is the main symptom of ‘jank’.
I get the warnings on both the debug and release versions, in fact the warning of 16,000 was (I think) on the release version on my device.
I don’t know how relevant this is, but when I switch between debug and release versions I get an ‘IDE error’ (Android Studio Chipmunk).
I have tried to follow the advice here text but do not really understand the instructions for use of the profiler.
I have only 8Mb of RAM on my laptop – is that a factor?