GithubHelp home page GithubHelp logo

jenilgopani69 / debugkit Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hulab/debugkit

0.0 1.0 0.0 20.05 MB

Ever hid debug functions in your UI? Here is now a clean way to do it!

License: Apache License 2.0

Java 100.00%

debugkit's Introduction

Android DebugKit

License Download

DebugKit lib for Android allows you to use a fancy hovering debug tool to trigger some actions directly in the app. This tool is very useful to trigger some event at runtime, and to have a written feedback directly on your testing phone screen.

Requirements

  • Android SDK 15+

Example

You can download an example apk here : DebugKit-Example.apk

Installation

repositories {
    jcenter()
}

dependencies {
    compile 'com.hulab.android:debugkit:1.2.1'
}

Usage

final DevTool.Builder builder = new DevTool.Builder(mContext);

builder.addFunction(new DebugFunction() {
            @Override
            public String call() throws Exception {
                log("doing some stuff...");
                doSomeStuff();
                return "Some stuff was done.";
            }
        }).addFunction(new DebugFunction() {
            @Override
            public String call() throws Exception {
                log("doing some other stuff...");
                doSomeStuff();
                return "Some stuff was done.";
            }
        }).addFunction(new DebugFunction("My function") {
            @Override
            public String call() throws Exception {
                log("doing some stuff again and again...");
                doSomeStuff();
                return "This function has a title!";
            }
        });                
        // This is a prebuilt function to clear the console, you can call clear() in any function
        // as well.
        .addFunction(new DebugFunction.Clear("Clear"))
        // This is a prebuilt function to dump the content of your shared preferences file.
        .addFunction(new DebugFunction.DumpSharedPreferences("Shared prefs", PREFS_FILE_NAME));
 
        // optional, DevToolFragment.DevToolTheme.DARK is set by default
builder.setTheme(DevToolFragment.DevToolTheme.DARK)
        //you can set the initial position of your debug tool (0,0) by default
       .displayAt(100, 100)
       .build();

Result

Here we have 3 debug tools, from top to bottom:

  • LIGHT theme with 5 defined functions
  • Minified mode (clicking on the top left corner arrow)
  • DARK theme with 3 defined functions and the logged text when clicking on each F1, F2 and F3

Screenshot.png


dark theme light theme


Have fun!

debugkit's People

Contributors

nebneb avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.