Bee


Source link: https://github.com/orhanobut/bee

#Bee QA/Debug Tool

What is Bee?

Bee is a QA/Debug tool that works like a widget in any application. The idea is to add some features/options to developer and QA to configure the app, get some information. Bee works like an extra view when the user presses the bee icon. You can do the following operations :

  • Configure the application on the fly
  • Add button, spinner and checkbox options regarding to your needs
  • Show the predefined information such as version number, android version, package name. Add some other custom information such as current end point
  • Show the log for the important events, ie: An event is triggered and you want to see whether it is triggered or not

What Bee is not?

  • Bee is not an application
  • Bee is not for the release apk

Dependency

https://jitpack.io/#orhanobut/bee/1.5

repositories {

// ...
maven {
 url "https://jitpack.io" 
}
 
}
  dependencies {

compile 'com.github.orhanobut:bee:1.5' 
}

Usage

Extend BeeConfig class and add the functionalities as you needed.

public class SampleBeeConfig extends BeeConfig {

 /**   * Add extra information by using content object.   */
@Override public void onInfoContentCreated(Map<String, String> content) {

  content.put("Current End Point", "http://www.google.com");

}

 /**   * It is called when the close button is pressed    */
@Override public void onClose() {

  super.onClose();

}

  /**   * A sample button implementation   */
@Title("Reset")
@Button
public void onResetClicked() {

  Log.d(TAG, "onResetClicked");

}

  /**   * A sample checkbox implementation   */
@Title("Show splash screen")
@CheckBox
public void onShowSplashChecked(boolean isChecked) {

  Log.d(TAG, "onShowSplashChecked");

}

 /**   * A sample spinner implementation   */
@Title("End Point")
@Spinner({
"Staging", "Live", "Mock"
}
)
public void onEndPointSelected(String selectedValue) {

  Log.d(TAG, "onEndPointSelected");

}
 
}

Start Bee

In order to activate Bee, you need to pass activity as context. You can either initialize it in base activity and show in all activities or you can just initialize it in specific activities.

@Override protected void onCreate(Bundle savedInstanceState) {

  ...
 Bee.init(this)
  .setBeeSize(100)

  //optional bee button size
  .setBeePosition(Gravity.CENTER)  //optional bee button position
  .setBeeMargin(0, 0, 0, 400)

//optional margin for the bee button
  .inject(SampleBeeConfig.class);
  //required 
}

Add buttons to the settings menu

  • Use Button annotation to create a new button in the settings menu.
  • Use Title annotation to put a text for button
  • Use nullary method (no parameter should be added) signature.
  • Add as many button as you need. All methods will be called individually.
 @Title("Reset")
  @Button
  public void onResetClicked() {

Log.d(TAG, "onResetClicked");

  
}

Add checkbox to the settings menu

  • Use CheckBox annotation to create a new checkbox
  • Use Title annotation to put a label
  • Use following method signature. Only one parameter should be added and it should be boolean
  • Add as many checkbox as you need. All methods will be called individually.
 @Title("Show splash screen")
  @CheckBox
  public void onShowSplashChecked(boolean isChecked) {

Log.d(TAG, "onShowSplashChecked");

  
}

Add dropdown(Spinner) to the settings menu

  • Use Spinner annotation to create a new spinner
  • Use Title annotation to put a label
  • Use following method signature. Only one parameter should be added and it should be String
  • Add as many dropdown as you need. All methods will be called individually and it will return the selected value
 @Title("End Point")
  @Spinner({
"Staging", "Live", "Mock"
}
)
  public void onEndPointSelected(String selectedValue) {

Log.d(TAG, "onEndPointSelected");

  
}

Use BeeLog in order to show the log in the bee

BeeLog.d(TAG,"Some event triggered");

Add more options to the settings.

  • Just create a method and use annotation and provide the signature.
  • You can add as many as options you want. All methods will be called individually.

More

  • Long click to a list item will copy the value to the clipboard.

License

Copyright 2015 Orhan Obut  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. 

Resources

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