How to measure FPS on Android during app development

后端 未结 4 1434
时光取名叫无心
时光取名叫无心 2020-12-08 00:45

Is there a way (maybe some apps, hacks, libs) to measure frames per second (FPS) during app development for Android?

4条回答
  •  盖世英雄少女心
    2020-12-08 01:41

    You can use TinyDancer library.

    Simply add code like:

    public class DebugApplication extends Application {
    
      @Override public void onCreate() {
    
       // default config
       TinyDancer.create().show(this);
    
       //or customazed config
       TinyDancer.create()
          .redFlagPercentage(.1f) // set red indicator for 10%
          .startingGravity(Gravity.TOP)
          .startingXPosition(200)
          .startingYPosition(600)
          .show(this);
      }
    }
    

    And you'll see interactive view with information about current FPS on top of your screens.

提交回复
热议问题