An android library for displaying fps from the choreographer and percentage of time with two or more frames dropped

Overview

DEPRECATED

TinyDancer is deprecated. No more development will be taking place. Check out the Google Android developer documentation for UI performance testing

Tiny Dancer

A real time frames per second measuring library for Android that also shows a color coded metric. This metric is based on percentage of time spent when you have dropped 2 or more frames. If the application spends more than 5% in this state then the color turns yellow, when you have reached the 20% threshold the indicator turns red.

New Double tap overlay to hide!

“Perf Matters” - Random Guy at Meetup

Tiny Dancer

Min SDK

Tiny Dancer min sdk is API 16

Unfortunately this will not work on Android TV

Getting started

In your build.gradle:

 dependencies {
   debugCompile "com.github.brianPlummer:tinydancer:0.1.2"
   releaseCompile "com.github.brianPlummer:tinydancer-noop:0.1.2"
   testCompile "com.github.brianPlummer:tinydancer-noop:0.1.2"
 }

In your DebugApplication class:

public class DebugApplication extends Application {

  @Override public void onCreate() {

   TinyDancer.create()
             .show(context);
             
   //alternatively
   TinyDancer.create()
      .redFlagPercentage(.1f) // set red indicator for 10%....different from default
      .startingXPosition(200)
      .startingYPosition(600)
      .show(context);

   //you can add a callback to get frame times and the calculated
   //number of dropped frames within that window
   TinyDancer.create()
       .addFrameDataCallback(new FrameDataCallback() {
          @Override
          public void doFrame(long previousFrameNS, long currentFrameNS, int droppedFrames) {
             //collect your stats here
          }
        })
        .show(context);
  }
}

You're good to go! Tiny Dancer will show a small draggable view overlay with FPS as well as a color indicator of when FPS drop. You can double tap the overlay to explicitly hide it.

See sample application that simulates excessive bind time:

Tiny Dancer Sample

Have an project with performance issues? We'd be happy to help tune it. [email protected]

Comments
  • Tech/travis snapshot

    Tech/travis snapshot

    • i'm not sure i'm doing the correct thing in the after_success block of the travis file. "The goal you specified requires a project to execute but there is no POM in this directory "
    help wanted work in progress 
    opened by brianPlummer 19
  • TinyDancer widget stays on screen even when application process is killed.

    TinyDancer widget stays on screen even when application process is killed.

    I noticed that TinyDancer widget stays on screen even when application process is killed, in matter of fact I killed all applications and still see it.

    Widget went away after going to application manager -> my app and "force stop" it.

    It happened on Samsung Note Edge 5.0.1.

    Can we add touch event for long press on the widget with dialog popup to kill it?

    opened by magillus 7
  • Better permission handling

    Better permission handling

    At the moment if I try to launch TinyDancer for the first time on Marshmellow it'll ask me to grant permission which is ok, but then TinyDancer won't be displayed until I trigger hide and show manually.

    Would be nice if TinyDancer will understand that permission was granted and then draw itself without need in manual hide/show!

    If user hadn't granted permission then library could display a Toast "TinyDancer won't work without this permission" :)

    enhancement 
    opened by artem-zinnatullin 6
  • Error:Program type already present: com.codemonkeylabs.fpslibrary.FrameDataCallback

    Error:Program type already present: com.codemonkeylabs.fpslibrary.FrameDataCallback

    I'm trying to add the library to my Android project but I get an error when I run the project the Gradle build success with no error but when hit the run button I got this error before installing apk Error:Program type already present: com.codemonkeylabs.fpslibrary.FrameDataCallback Error:com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: /Users/omaraltamimi/AndroidStudioProjects/myproject/app/build/intermediates/transforms/dexBuilder/production/debug/0, /Users/omaraltamimi/AndroidStudioProjects/myproject/app/build/intermediates/transforms/dexBuilder/production/debug/1, /Users/omaraltamimi/AndroidStudioProjects/myproject/app/build/intermediates/transforms/dexBuilder/production/debug/2, /Users/omaraltamimi/AndroidStudioProjects/myproject/app/build/intermediates/transforms/dexBuilder/production/debug/3, ...............

    opened by tamtom 4
  • Not compatible with Android TV?

    Not compatible with Android TV?

    I tried using TinyDancer in my Android TV project, but app kept crashing during startup. The reason was: java.lang.RuntimeException: Unable to create application com.android.tools.fd.runtime.BootstrapApplication: android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.settings.action.MANAGE_OVERLAY_PERMISSION dat=package:com.mobitv.client.connect.tv flg=0x10000000 } - there's no activity in Android TV that can request for overlay permission. Seems that android.permission.SYSTEM_ALERT_WINDOW is missing in Android TV too, so there's probably no chance to use TinyDancer on TV.

    Maybe it's worth mentioning in readme about this limitation?

    bug 
    opened by Armaxis 4
  • Add no-op for test and release compile

    Add no-op for test and release compile

    Fixes #34

    • Created "no-op" module similar to LeakCanary
    • You can add the "no-op" to relaseCompile and testCompile and the original in debugCompile
    • Updated README.md to show how to use library effectively
    • I also removed useless icons in the library, that just adds size to the AAR
    opened by jaredsburrows 4
  • What is the need for Application class in the hide function

    What is the need for Application class in the hide function

    TinyDancer.hide(Application) takes an application instance but calls TinyDancerBuilder.hide(Context), this reduces the flexibility as you need to put an extra method in the application class.

    opened by ghost 4
  • Unable to start on Marshmallow

    Unable to start on Marshmallow

    java.lang.RuntimeException: Unable to start service com.codemonkeylabs.fpslibrary.service.FPSService@6be9f23 with Intent { cmp=my.cool.app/com.codemonkeylabs.fpslibrary.service.FPSService (has extras) }: android.view.WindowManager$BadTokenException: Unable to add window android.view.ViewRootImpl$W@d29dcdd -- permission denied for this window type

    bug 
    opened by ursusursus 4
  • Remove permission

    Remove permission "SYSTEM_ALERT_WINDOW" for no-op release

    Hi, can you remove uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" for no-op release since it is not necessary for release, in AndroidManifest.xml

    opened by Gilianp 3
  • There was a typo in the class, TinyDancer, Content should be Context

    There was a typo in the class, TinyDancer, Content should be Context

    There was a typo in the class, TinyDancer, Content should be Context

    • public static void hide(Content context) {
    • public static void hide(Context context) {

    And I include the jar within an app, and the class TinyDancer could not be recoganized, maybe it causes by the jar consist with the typo.

    opened by funyoung 2
  • Feature Request: Make compatible with Android Oreo 8.0

    Feature Request: Make compatible with Android Oreo 8.0

    Hi According to Android 8.0 Behavior Changes apps that target API 26 should now be using the TYPE_APPLICATION_OVERLAY instead of the SYSTEM_ALERT_WINDOW.

    If not you get this nice stacktrace.

    Caused by: android.view.WindowManager$BadTokenException: Unable to add window android.view.ViewRootImpl$W@c3386fe -- permission denied for window type 2002 at android.view.ViewRootImpl.setView(ViewRootImpl.java:789) at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:356) at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:92) at com.codemonkeylabs.fpslibrary.ui.TinyCoach.addViewToWindow(TinyCoach.java:80) at com.codemonkeylabs.fpslibrary.ui.TinyCoach.<init>(TinyCoach.java:52) at com.codemonkeylabs.fpslibrary.TinyDancerBuilder.show(TinyDancerBuilder.java:94) at com.foo.bar.MyApplication.initTinyDancer(MyApplication.kt:128) at com.foo.bar.MyApplication.onCreate(MyApplication.kt:76) at com.zeroturnaround.jrebel.android.agent.runtime.client.JRebelApplication.onCreate(SourceFile:139) at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1118)  at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5791)  at android.app.ActivityThread.-wrap1(Unknown Source:0)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1661)  at android.os.Handler.dispatchMessage(Handler.java:105)  at android.os.Looper.loop(Looper.java:164)  at android.app.ActivityThread.main(ActivityThread.java:6541)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767) 

    Thanks in advance.

    Tim

    opened by timrijckaert 1
  • launch crash on android 4.4 device

    launch crash on android 4.4 device

    Caused by: java.lang.NullPointerException at android.widget.TextView.getExtendedPaddingTop(TextView.java:1824) at android.widget.TextView.getTotalPaddingTop(TextView.java:1918) at com.codemonkeylabs.fpslibrary.ui.TinyCoach.(TinyCoach.java:54) at com.codemonkeylabs.fpslibrary.TinyDancerBuilder.show(TinyDancerBuilder.java:94) at com.codemonkeylabs.fpslibrary.sample.UI.MainActivity.onCreate(MainActivity.java:40) at android.app.Activity.performCreate(Activity.java:5287) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1101) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2159

    opened by wanderingGuy 0
  • How to get the context information when app is stuck

    How to get the context information when app is stuck

    We can use Choreographer.postFrameCallback to set callback when each frame execute, and we can get the frame time from this callback to judge wether app is stuck. My question is When I find the APP stuck, How can I get the runtime context information, including the page that happened to be stuck, the time-consuming method, etc. Thanks

    opened by xudjx 0
  • Import TinyDancer to my android studio project

    Import TinyDancer to my android studio project

    I already have an android studio project. I just want to import the tinydancer pckage and add the code to show the fps.

    But I can't import the tiny dancer package. Showing the error "can't import".

    How to do this? Please tell me.

    opened by spaul13 0
Releases(0.0.7)
Owner
Friendly Robot
Friendly Robot
Tired of manually setup test data of Kotlin data classes or POJOs? Instantiator creates Instances of any class for you so that you can focus on writing tests instead of spending time and effort to setup test data

Instantiator Tired of manually setup test data of Kotlin data classes or POJOs? Instantiator creates Instances of any class for you so that you can fo

Hannes Dorfmann 54 Dec 30, 2022
Recruitment Task App - record time which a user spends on tasks defined by himself

Recruitment-Task The purpose of this application is to record time which a user spends on tasks defined by himself. The user can add new tasks. New ta

Sylwester Zieliński 0 Feb 9, 2022
****. Use the native and support library variants instead - https://developer.android.com/guide/topics/ui/look-and-feel/fonts-in-xml.html. An android library that makes it easy to add custom fonts to edittexts and textviews

Add to your project Add this line to your dependencies in build.gradle compile 'in.workarounds.typography:typography:0.0.8' Using the views There are

Workarounds 43 Nov 6, 2021
Starter-Android-Library - Starter Android Library is an Android Project with Modular Architecture.

Starter-Android-Library - Starter Android Library is an Android Project with Modular Architecture.

OpenBytes 1 Feb 18, 2022
Tutorial For openJDK 11 and AGP 7.0.0+ | Tutorial Multi Library Android in 1 Project | Groovy

jitpack-library-guide For openJDK 11 and AGP 7.0.0 + Please read every single note for detail Tutorial Click Here Kotlin DSL Click Here Repository for

Faisal Amir 7 Dec 10, 2022
Using Resilience4J, this is a Demo project which uses a Library as background and manages all its requests.

Using Resilience4J, this is a Demo project which uses a Library as background and manages all its requests. This library can rent books online and the usage rate is extremely high. There is a reactive way to access, which is the one normally used, but sometimes, the system needs a bit of help from an old machine running a non-reactive MVC Spring application using JPA. Let's make this in Kotlin and find the best solution!

João Filipe Sabino Esperancinha 2 Jan 10, 2022
ZXing ("Zebra Crossing") barcode scanning library for Java, Android

Project in Maintenance Mode Only The project is in maintenance mode, meaning, changes are driven by contributed patches. Only bug fixes and minor enha

ZXing Project 30.5k Dec 27, 2022
Android Library to help you with your runtime Permissions.

PermissionHelper Android Library to help you with your runtime Permissions. Demo Android M Watch it in action. Pre M Watch it in action. Nexus 6 (M) N

Kosh Sergani 1.2k Dec 14, 2022
Android validation library which helps developer boil down the tedious work to three easy steps.

AwesomeValidation Introduction Implement validation for Android within only 3 steps. Developers should focus on their awesome code, and let the librar

Jing Li 1.1k Dec 17, 2022
Android library that manages your app's cached data with ease.

Teller Android library that makes your apps faster. Teller facilitates the downloading, saving, and reading of the cached data of your app. Keep your

Levi Bostian 14 Apr 2, 2022
SL4A brings scripting languages to Android by allowing you to edit and execute scripts and interactive interpreters directly on the Android device.

#Scripting Layer for Android (SL4A) SL4A brings scripting languages to Android by allowing you to edit and execute scripts and interactive interpreter

Damon Kohler 2.3k Dec 23, 2022
AboutLibraries is a library to offer some information of libraries.

AboutLibraries .. allows you to easily create an used open source libraries fragment/activity within your app. All the library information is automati

Mike Penz 3.1k Jan 3, 2023
Makes Google play in app purchase library (BillingClient) into a flowable that can easily be used in compose world

Billy the android Our goal is to make a modern api of BillingClient so that it is easier to use in compose world. This library is still early beta and

Stefan Wärting 16 Dec 14, 2022
Simple Artificial Neural Network java library

SANN Simple Artificial Neural Network java library WIP Creating neural network Variant 1 //create new net (input, hidden, default len, output) Net net

Korpusov Maxim 14 Oct 11, 2022
A library to display pokemon with Shakespearean descriptions

Pokemon Shakespeare SDK A library to display pokemon with Shakespearean descriptions Dependencies Java 11 Retrofit Picasso Material Appcompat Usage Cr

Keenen Charles 0 Nov 12, 2021
ArduinoJava - A project that uses the JSSC library

ArduinoJava este es un proyecto que utiliza la libreria JSSC para connectarse al

null 0 Jan 24, 2022
Editframe Kotlin Client library

Editframe Kotlin Client library Installing Add the project to your gradle dependencies.

editframe 2 Apr 7, 2022
Open-source Desktop library to connect Alsat pardakht peyment API

Open-source Desktop library to connect Alsat pardakht peyment API

Alsat Pardakht 3 Apr 4, 2022
An application for runners and cyclists. Allows you to monitor your physical activity, weight and receive reminders about workouts.

An application for runners and cyclists. Allows you to monitor your physical activity, weight and receive reminders about workouts.

Just_Amalll 3 Feb 7, 2022