Home

Awesome

Android Arsenal API Join the chat at https://gitter.im/orhanobut/bee

#Bee QA/Debug Tool <br><br> <img src='https://github.com/orhanobut/bee/blob/master/images/bee_yellow.png' width='128' height='128'></img>

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 :

What Bee is not?

<img src='https://github.com/nr4bt/bee/blob/master/images/bee0.png' width='140' height='200'></img> <img src='https://github.com/nr4bt/bee/blob/master/images/bee_settings.png' width='140' height='200'></img> <img src='https://github.com/nr4bt/bee/blob/master/images/bee_info.png' width='140' height='200'></img> <img src='https://github.com/nr4bt/bee/blob/master/images/bee_log.png' width='140' height='200'></img>

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

    @Title("Reset")
    @Button
    public void onResetClicked() {
        Log.d(TAG, "onResetClicked");
    }

Add checkbox to the settings menu

    @Title("Show splash screen")
    @CheckBox
    public void onShowSplashChecked(boolean isChecked) {
        Log.d(TAG, "onShowSplashChecked");
    }

Add dropdown(Spinner) to the settings menu

    @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.

More

License

<pre> 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. </pre>