traffic debugging library for android

Overview

TrafficMonitor

License Download

About

Display traffic per Activity.Observing traffic is used by TrafficStats API. OkHttp Interceptor observer is implementing.

Demo

Baisis

TrafficMonitor.snap

Use TrafficMonitor.snap to dump traffic from before execute to logcat.

For example

adb logcat -s TrafficMonitor
06-04 00:56:52.049 18147 18147 D TrafficMonitor: Fragment:1:Fragment:1:
06-04 00:56:52.049 18147 18147 D TrafficMonitor: 0B
06-04 00:56:52.049 18147 18147 D TrafficMonitor: 11.28KB
06-04 00:57:02.174 18147 18147 D TrafficMonitor: Fragment:2:Fragment:2:
06-04 00:57:02.174 18147 18147 D TrafficMonitor: 0B
06-04 00:57:02.174 18147 18147 D TrafficMonitor: 10.82KB

Usage

Basis

Implement at in your Application class.

  class App: Application() {
    override fun onCreate() {
      super.onCreate()
      if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
        if (Settings.canDrawOverlays(this)) {
          val config = DisplayConfig(WindowManager.LayoutParams.TYPE_SYSTEM_ALERT, DisplayPosition.BOTTOM_RIGHT)
          TrafficMonitor.startMonitoring(this, config)
        }
      } else {
        TrafficMonitor.startMonitoring(this)
      }
    }

    override fun onTerminate() {
      TrafficMonitor.stopMonitoring(this)
      super.onTerminate()
    }

If you want support Android O,you can use WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY flag.

snapshot

observe not per Activity, use TrafficMonitor.snap.

TODO

  • Observe by OkHttpIntercpeter

License

Copyright 2017 Tetsuya Masuda

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
You might also like...
A Read-Eval-Print-Loop server for Android and SQLite

Android DebugPort Android DebugPort is a drop-in utility which allows you to write and execute code within your app's context, at runtime, and from th

Easy android exception tracer and handler.
Easy android exception tracer and handler.

Introduction Lup is a small android library that can help you to tracking bug that causes application stopped working (force close). Whiting this libr

Sources for the LiveBoot app for rooted Android devices

This is the sauce for the LiveBoot app. License Copyright © 2011-2020 Jorrit Chainfire Jongma This code is released under the GPLv3. LICENSE, COPYING.

android logcat
android logcat

android logcat

A local ADB shell for Android!

LADB A local ADB shell for Android! How does it work? LADB bundles an ADB server within the app libraries. Normally, this server cannot connect to the

btrace(AKA RheaTrace) is a high performance Android trace tool which is based on Systrace
btrace(AKA RheaTrace) is a high performance Android trace tool which is based on Systrace

btrace README 中文版 btrace(AKA RheaTrace) is a high performance Android trace tool

Android QA/Debug tools to speed up and streamline the development progress.
Android QA/Debug tools to speed up and streamline the development progress.

Android Dev Tools is a library that contains various QA/Debug tools to speed up and streamline the development progress.

A library for debugging android databases and shared preferences - Make Debugging Great Again
A library for debugging android databases and shared preferences - Make Debugging Great Again

Android Debug Database Android Debug Database is a powerful library for debugging databases and shared preferences in Android applications Android Deb

an android library for debugging what we care about directly in app.
an android library for debugging what we care about directly in app.

EN | 中文 Pandora is a tool box that allows you to inspect and modify what includes networks, databases, UIs, etc. directly in your application. It is s

Utility logger library for storing logs into database and push them to remote server for debugging
Utility logger library for storing logs into database and push them to remote server for debugging

HyperLog Android Overview Log format Download Initialize Usage Get Logs in a File Push Logs Files to Remote Server Sample Testing Endpoint using Reque

Extendable MVI framework for Kotlin Multiplatform with powerful debugging tools (logging and time travel), inspired by Badoo MVICore library
Extendable MVI framework for Kotlin Multiplatform with powerful debugging tools (logging and time travel), inspired by Badoo MVICore library

Should you have any questions or ideas please welcome to the Slack channel: #mvikotlin Inspiration This project is inspired by Badoo MVICore library.

Library that makes debugging, log collection, filtering and analysis easier.
Library that makes debugging, log collection, filtering and analysis easier.

AndroidLogger Android Library that makes debugging, log collection, filtering and analysis easier. Contains 2 modules: Logger: 'com.github.ShiftHackZ.

Pluto: An on-device debugging framework for Android applications

Pluto is an on-device debugging framework for Android applications, which helps in the inspection of HTTP requests/responses, captures Crashes, and ANRs, and manipulates application data on the go.

This is an IDEA plugin that allows you to connect Android devices via WiFi for debugging your codes.
This is an IDEA plugin that allows you to connect Android devices via WiFi for debugging your codes.

AdbWifiUtils Github | Issues | README | 中文文档 ● [Description]: This is an IDEA plugin that allows you to connect Android devices via WiFi for debugging

A surgical debugging tool to uncover the layers under your app.
A surgical debugging tool to uncover the layers under your app.

Scalpel DEPRECATED! Android Studio 4.0's layout inspector now includes a live-updating 3D view. Use it! A surgical debugging tool to uncover the layer

Easier RxJava2 debugging with better stacktraces
Easier RxJava2 debugging with better stacktraces

Traceur Traceur enables easier debugging of RxJava2 exceptions, by appending the source of any asynchronous calls to the original exception. An exampl

A surgical debugging tool to uncover the layers under your app.
A surgical debugging tool to uncover the layers under your app.

Scalpel DEPRECATED! Android Studio 4.0's layout inspector now includes a live-updating 3D view. Use it! A surgical debugging tool to uncover the layer

A model-agnostic visual debugging tool for machine learning
A model-agnostic visual debugging tool for machine learning

Manifold This project is stable and being incubated for long-term support. Manifold is a model-agnostic visual debugging tool for machine learning. Un

Cross-platform GUI gRPC debugging proxy like charles but design for gRPC
Cross-platform GUI gRPC debugging proxy like charles but design for gRPC

Mediator Cross-platform GUI gRPC debugging proxy like charles but design for gRPC. Build with Netty (proxy protocol), Compose Desktop (GUI), Sisyphus

Comments
Owner
Tetsuya Masuda
Android Engineer
Tetsuya Masuda
Pluto: An on-device debugging framework for Android applications

Pluto is an on-device debugging framework for Android applications, which helps in the inspection of HTTP requests/responses, captures Crashes, and ANRs, and manipulates application data on the go.

Pluto 550 Dec 27, 2022
A surgical debugging tool to uncover the layers under your app.

Scalpel DEPRECATED! Android Studio 4.0's layout inspector now includes a live-updating 3D view. Use it! A surgical debugging tool to uncover the layer

Jake Wharton 2.8k Jan 9, 2023
Easier RxJava2 debugging with better stacktraces

Traceur Traceur enables easier debugging of RxJava2 exceptions, by appending the source of any asynchronous calls to the original exception. An exampl

Oisin O'Neill 493 Dec 18, 2022
A model-agnostic visual debugging tool for machine learning

Manifold This project is stable and being incubated for long-term support. Manifold is a model-agnostic visual debugging tool for machine learning. Un

Uber Open Source 1.6k Dec 25, 2022
Under the Hood is a flexible and powerful Android debug view library. It uses a modular template system that can be easily extended to your needs, although coming with many useful elements built-in.

Under the Hood - Android App Debug View Library Under the Hood is a flexible and powerful Android debug view library. It uses a modular template syste

Patrick Favre-Bulle 217 Nov 25, 2022
Android library to record the network calls through the interceptor mechanism of the http clients.

Android Snooper Introduction Android Snooper is a library which helps in debugging issues while running the applications on android devices. One of th

Prateek 151 Nov 25, 2022
Cordova plugin for Android Serial USB communication (easily connect an Arduino board to an Android device).

PR-DC cordova-plugin-serialusb Cordova plugin for Android Serial USB communication. This plugin makes a connection to the external board trivial, for

PR-DC 3 May 8, 2022
Stetho is a debug bridge for Android applications, enabling the powerful Chrome Developer Tools and much more.

Stetho Stetho is a sophisticated debug bridge for Android applications. When enabled, developers have access to the Chrome Developer Tools feature nat

Facebook 12.6k Jan 7, 2023
🔪Swiss-army knife for Android testing and development 🔪 ⛺

ADB Enhanced ADB-Enhanced is a Swiss-army knife for Android testing and development. A command-line interface to trigger various scenarios like screen

Ashish Bhatia 938 Dec 20, 2022