@Override
    public void appStep(AppStep appStep) {
        if (androidApiLevel >= 18) {
            switch(appStep) {
                case BeginFrame:
                    android.os.Trace.beginSection("Frame");
                    break;
                case QueuedTasks:
                    android.os.Trace.beginSection("QueuedTask");
                    break;
                case ProcessInput:
                    android.os.Trace.endSection();
                    android.os.Trace.beginSection("ProcessInput");
                    break;
                case ProcessAudio:
                    android.os.Trace.endSection();
                    android.os.Trace.beginSection("ProcessAudio");
                    break;
                case StateManagerUpdate:
                    android.os.Trace.endSection();
                    android.os.Trace.beginSection("StateManagerUpdate");
                    break;
                case SpatialUpdate:
                    android.os.Trace.endSection();
                    android.os.Trace.beginSection("SpatialUpdate");
                    break;
                case StateManagerRender:
                    android.os.Trace.endSection();
                    android.os.Trace.beginSection("StateManagerRender");
                    break;
                case RenderFrame:
                    android.os.Trace.endSection();
                    android.os.Trace.beginSection("RenderFrame");
                    break;
                case RenderPreviewViewPorts:
                    android.os.Trace.beginSection("RenderPreviewViewPorts");
                    break;
                case RenderMainViewPorts:
                    android.os.Trace.endSection();
                    android.os.Trace.beginSection("RenderMainViewPorts");
                    break;
                case RenderPostViewPorts:
                    android.os.Trace.endSection();
                    android.os.Trace.beginSection("RenderPostViewPorts");
                    break;
                case EndFrame:
                    android.os.Trace.endSection();
                    android.os.Trace.endSection();
                    android.os.Trace.endSection();
                    break;
            }
        }
    }
An AppProfiler implementation that integrates the
 per-frame application-wide timings for update versus
 render into the Android systrace utility.

 <p>This profiler uses the Android Trace class which is only supported
 on Android SDK rev 18 and higher (ver 4.3 and higher).  If the
 device is running a version less than rev 18, the logging will
 be skipped.</p>

 <p>In the MainActivity class, add the following:</p>
 <pre><code>
 {@literal @}Override
 public void onCreate(Bundle savedInstanceState) {
     super.onCreate(savedInstanceState);
     app.setAppProfiler(new DefaultAndroidProfiler());
 }
 </code></pre>
 Start the Android systrace utility and run the application to
 see the detailed timings of the application.

@author iwgeric
jme3-android/src/main/java/com/jme3/app/DefaultAndroidProfiler.java