Debug Bottle


Source link: https://github.com/kiruto/debug-bottle

🇨🇳 ?? / 🇯🇵??? / 🇬🇧 English

🍼Debug Bottle

An Android debug / develop tools written using Kotlin language. All the features in Debug bottle are only available on debug build version with your app, it doesn't has an impact on release version.

Demo App is now available at Google Play:

What can I do with Debug Bottle?

OkHttp Sniffer

Enable "Network Listener" at Settings, then you can see all network traffics what requested by your app.

Scalpel Viewer

Enable "3D View", then you can view your Activity. When interaction is enabled the following gestures are supported:

  • Single touch: Controls the rotation of the model.
  • Two finger vertical pinch: Adjust zoom.
  • Two finger horizontal pinch: Adjust layer spacing.

Shared Preferences editor

Preview and edit the Shared Preferences of app more simply.

Strict Mode

Enable or disable Android strict mode at runtime. StrictMode is a developer tool which detects things you might be doing by accident and brings them to your attention so you can fix them. StrictMode is most commonly used to catch accidental disk or network access on the application's main thread, where UI operations are received and animations take place. For more information, see Android Developers.

Crash Log

List all crash stacktrace logs.

Leak Canary

Leak Canary is fully imported. Leak Canary is a memory leak detection library for Android and Java. More about using Leak Canary by visiting Leak Canary wiki.

Block Canary

Detect UI blocks at runtime.

Development Entries

Launch any Activity with custom Intents, or Runnable you want.

How do I use it?

After installing Debug Bottle Demo app, you'll find there are two app icons appears to launcher. Click bottle icon to run Debug Bottle.

Setting up

1. Configure your Gradle project

Add snapshot of maven central repository to primary Gradle file:

allprojects {

  repositories {

...

mavenCentral()
  
}
 
}

Edit and add dependencies in your app module:

dependencies {

  debugCompile 'com.exyui.android:debug-bottle-runtime:1.1.1'

// Use this in your Java project
  releaseCompile 'com.exyui.android:debug-bottle-noop-java:1.1.1'
  testCompile 'com.exyui.android:debug-bottle-noop-java:1.1.1'

// Use this in your Kotlin project
  releaseCompile 'com.exyui.android:debug-bottle-noop-kotlin:1.1.1'
  testCompile 'com.exyui.android:debug-bottle-noop-kotlin:1.1.1'

compile 'com.android.support:appcompat-v7:23.2.0+' 
}

Specially, Debug Bottle not only support API 23+, but also 22. To support API 22, please add dependencies like this:

dependencies {

  debugCompile 'com.exyui.android:debug-bottle-runtime:1.0.6-support22'

// Use this in your Java project
  releaseCompile 'com.exyui.android:debug-bottle-noop-java:1.0.6-support22'
  testCompile 'com.exyui.android:debug-bottle-noop-java:1.0.6-support22'

// Use this in your Kotlin project
  releaseCompile 'com.exyui.android:debug-bottle-noop-kotlin:1.0.6-support22'
  testCompile 'com.exyui.android:debug-bottle-noop-kotlin:1.0.6-support22'

compile 'com.android.support:appcompat-v7:22+' 
}

To support API 23, add dependencies like this:

dependencies {

  debugCompile 'com.exyui.android:debug-bottle-runtime:1.0.6-support23'

// Use this in your Java project
  releaseCompile 'com.exyui.android:debug-bottle-noop-java:1.0.6-support23'
  testCompile 'com.exyui.android:debug-bottle-noop-java:1.0.6-support23'

// Use this in your Kotlin project
  releaseCompile 'com.exyui.android:debug-bottle-noop-kotlin:1.0.6-support23'
  testCompile 'com.exyui.android:debug-bottle-noop-kotlin:1.0.6-support23'

compile 'com.android.support:appcompat-v7:23+' 
}

2. Edit Manifest

Add Debug Bottle main Activity in your Manifest:

<activity
  android:name="com.exyui.android.debugbottle.components.DTDrawerActivity"
  android:theme="@style/Theme.AppCompat.Light"
  android:label="The Name You Like"/>

The value of tag label, will display to your android launch pad.

3. Inject Debug Bottle into your Application

First, you may implement Block Canary Context:

public class AppBlockCanaryContext extends BlockCanaryContext {
...
}

Now you could inject Debug Bottle in your Application like:

public class MyApplication extends Application{

  @Override
  public void onCreate() {

super.onCreate();

DTInstaller.install(this)

 .setBlockCanary(new AppBlockCanaryContext(this))

 .setOkHttpClient(httpClient)

 .setInjector("your.package.injector.ContentInjector")

 .setPackageName("your.package")

 .enable()

 .run();

  
}
 
}

Or if you use Kotlin, you can inject like:

class MyApplication: Application() {

  override fun onCreate() {

super.onCreate()

DTInstaller.install(this)

 .setBlockCanary(AppBlockCanaryContext(this))

 .setOkHttpClient(httpClient)

 .setInjector("your.package.injector.ContentInjector")

 .setPackageName("your.package")

 .enable()

 .run()
  
}
 
}

Links

License

Debug Bottle  Copyright 2016 Yuriel (http://exyui.com).  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. 

Debug Bottle required features are based on or derives from projects below:

Resources

Simplistic example app demonstrating using latest Firebase features. Checkout branches for each feature.

Shade can reduce code related to SharedPreferences operation efficiently using annotation processing.

Linear Timer is a custom view for Android that enables circular progress animation with respect to given duration.

There is a lovely method on the android.text.Html class, fromHtml(), that converts HTML into a Spannable for use with a TextView.

However, the documentation does not stipulate what HTML tags are supported, which makes this method a bit hit-or-miss. This small library provides a fluent API for building valid HTML for android.widget.TextView.

sandrios camera allows developers to integrate image and video capturing without dealing with the complicated camera APIs.

Take a screenshot of your view layout, programmatically!

Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes