gt: 		else if (message.contains("RIGHT"))
context: package org.droidplanner.android.fragments.calibration.imu;
  
  import org.droidplanner.R;
  import org.droidplanner.android.DroidPlannerApp;
  import org.droidplanner.core.drone.DroneInterfaces.DroneEventsType;
  import org.droidplanner.core.drone.DroneInterfaces.OnDroneListener;
  import org.droidplanner.core.drone.variables.Calibration;
  import org.droidplanner.core.model.Drone;
  
  import android.content.Context;
  import android.graphics.drawable.Drawable;
  import android.os.Bundle;
  import android.os.Handler;
  import android.support.v4.app.Fragment;
  import android.text.TextUtils;
  import android.view.LayoutInflater;
  import android.view.View;
  import android.view.ViewGroup;
  import android.widget.Button;
  import android.widget.ProgressBar;
  import android.widget.TextView;
  import android.widget.Toast;
  
  public class FragmentSetupIMU extends Fragment implements OnDroneListener {
  
  	private final static long TIMEOUT_MAX = 30000l; //ms
      private final static long UPDATE_TIMEOUT_PERIOD = 100l; //ms
      private static final String EXTRA_UPDATE_TIMESTAMP = "extra_update_timestamp";
  
      private String msg;
  
      private long updateTimestamp;
  
  	private int calibration_step = 0;
  	private TextView textViewStep;
  	private TextView textViewOffset;
  	private TextView textViewScaling;
  	private TextView textViewTimeOut;
  	private ProgressBar pbTimeOut;
  	private String timeLeftStr;
  	private Drawable drawableGood, drawableWarning, drawablePoor;
  
  	private final Handler handler = new Handler();
  
  	private DroidPlannerApp app;
  
      private Button btnStep;
      private TextView textDesc;
  
      @Override
  	public void onActivityCreated(Bundle savedInstanceState) {
  		super.onActivityCreated(savedInstanceState);
  		app = (DroidPlannerApp) getActivity().getApplication();
  	}
  
  	@Override
  	public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
  		return inflater.inflate(R.layout.fragment_setup_imu_main, container, false);
  	}
  
  	@Override
  	public void onViewCreated(View view, Bundle savedInstanceState) {
  		super.onViewCreated(view, savedInstanceState);
  
  		textViewStep = (TextView) view.findViewById(R.id.textViewIMUStep);
  		textViewOffset = (TextView) view.findViewById(R.id.TextViewIMUOffset);
  		textViewScaling = (TextView) view.findViewById(R.id.TextViewIMUScaling);
  		textViewTimeOut = (TextView) view.findViewById(R.id.textViewIMUTimeOut);
  		pbTimeOut = (ProgressBar) view.findViewById(R.id.progressBarTimeOut);
  
          textDesc = (TextView) view.findViewById(R.id.textViewDesc);
  
          btnStep = (Button) view.findViewById(R.id.buttonStep);
          btnStep.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                  processCalibrationStep(calibration_step);
              }
          });
  
  		pbTimeOut.setVisibility(View.INVISIBLE);
  		textViewTimeOut.setVisibility(View.INVISIBLE);
  		textViewOffset.setVisibility(View.INVISIBLE);
  		textViewScaling.setVisibility(View.INVISIBLE);
  		timeLeftStr = getString(R.string.setup_imu_timeleft);
  
  		drawableGood = getResources().getDrawable(R.drawable.pstate_good);
  		drawableWarning = getResources().getDrawable(R.drawable.pstate_warning);
  		drawablePoor = getResources().getDrawable(R.drawable.pstate_poor);
  
          if(savedInstanceState != null){
              updateTimestamp = savedInstanceState.getLong(EXTRA_UPDATE_TIMESTAMP);
          }
  	}
  
      @Override
      public void onSaveInstanceState(Bundle outState){
          super.onSaveInstanceState(outState);
          outState.putLong(EXTRA_UPDATE_TIMESTAMP, updateTimestamp);
      }
  
  	@Override
  	public void onStart() {
  		super.onStart();
  		final Drone drone = app.getDrone();
  		if (drone != null && drone.getMavClient().isConnected() && !drone.getState().isFlying()) {
              btnStep.setEnabled(true);
  			if (drone.getCalibrationSetup().isCalibrating()) {
  				processMAVMessage(drone.getCalibrationSetup().getMessage(), false);
  			}
              else{
                  resetCalibration();
              }
  		} else {
              btnStep.setEnabled(false);
              resetCalibration();
  		}
  	}
  
      private void resetCalibration(){
          calibration_step = 0;
          updateDescription(calibration_step);
      }
  
      @Override
      public void onPause() {
          super.onPause();
          app.getDrone().removeDroneListener(this);
      }
  
      @Override
      public void onResume() {
          super.onResume();
          app.getDrone().addDroneListener(this);
      }
  
  	private void processCalibrationStep(int step) {
  		if (step == 0) {
  			startCalibration();
              updateTimestamp = System.currentTimeMillis();
  		} else if (step > 0 && step < 7) {
  			sendAck(step);
  		} else {
  			calibration_step = 0;
  
              textViewStep.setText(R.string.setup_imu_step);
  
              textViewOffset.setVisibility(View.INVISIBLE);
              textViewScaling.setVisibility(View.INVISIBLE);
  
              updateDescription(calibration_step);
  		}
  	}
  
      public void updateDescription(int calibration_step) {
          int id;
          switch (calibration_step) {
              case 0:
                  id = R.string.setup_imu_start;
                  break;
              case 1:
                  id = R.string.setup_imu_normal;
                  break;
              case 2:
                  id = R.string.setup_imu_left;
                  break;
              case 3:
                  id = R.string.setup_imu_right;
                  break;
              case 4:
                  id = R.string.setup_imu_nosedown;
                  break;
              case 5:
                  id = R.string.setup_imu_noseup;
                  break;
              case 6:
                  id = R.string.setup_imu_back;
                  break;
              case 7:
                  id = R.string.setup_imu_completed;
                  break;
              default:
                  return;
          }
  
          if (textDesc != null) {
              textDesc.setText(id);
          }
  
          if (btnStep != null) {
              if (calibration_step == 0)
                  btnStep.setText(R.string.button_setup_calibrate);
              else if (calibration_step == 7)
                  btnStep.setText(R.string.button_setup_done);
              else
                  btnStep.setText(R.string.button_setup_next);
          }
  
          if (calibration_step == 7 || calibration_step == 0) {
              handler.removeCallbacks(runnable);
  
              pbTimeOut.setVisibility(View.INVISIBLE);
              textViewTimeOut.setVisibility(View.INVISIBLE);
          } else {
              handler.removeCallbacks(runnable);
  
              textViewTimeOut.setVisibility(View.VISIBLE);
              pbTimeOut.setIndeterminate(true);
              pbTimeOut.setVisibility(View.VISIBLE);
              handler.postDelayed(runnable, UPDATE_TIMEOUT_PERIOD);
          }
      }
  
  	private void sendAck(int step) {
  		if (app.getDrone() != null) {
  			app.getDrone().getCalibrationSetup().sendAckk(step);
  		}
  	}
  
  	private void startCalibration() {
  		if (app.getDrone() != null) {
  			boolean isCalibrating = app.getDrone().getCalibrationSetup().startCalibration();
              if(!isCalibrating){
                  Toast.makeText(getActivity(), getString(R.string.failed_start_calibration_message),
                          Toast.LENGTH_LONG).show();
              }
  		}
  	}
  
  	@Override
  	public void onDroneEvent(DroneEventsType event, Drone drone) {
          switch(event){
              case CALIBRATION_IMU:
                  processMAVMessage(drone.getCalibrationSetup().getMessage(), true);
                  break;
  
              case CONNECTED:
                  if(calibration_step == 0) {
                      //Reset the screen, and enable the calibration button
                      resetCalibration();
                      btnStep.setEnabled(true);
                  }
                  break;
  
              case DISCONNECTED:
                  //Reset the screen, and disable the calibration button
                  btnStep.setEnabled(false);
                  resetCalibration();
                  break;
  
              case CALIBRATION_TIMEOUT:
                  if (drone != null) {
  				/*
  				 * here we will check if we are in calibration mode but if at
  				 * the same time 'msg' is empty - then it is actually not doing
  				 * calibration what we should do is to reset the calibration
  				 * flag and re-trigger the HEARBEAT_TIMEOUT this however should
  				 * not be happening
  				 */
                      final Calibration calibration = drone.getCalibrationSetup();
                      if (calibration.isCalibrating() && TextUtils.isEmpty(msg)) {
                          calibration.setCalibrating(false);
                          drone.notifyDroneEvent(DroneEventsType.HEARTBEAT_TIMEOUT);
                      } else {
                          app.mNotificationHandler.quickNotify(msg);
                      }
                  }
                  break;
          }
  	}
  
  	private void processMAVMessage(String message, boolean updateTime) {
  		if (message.contains("Place") || message.contains("Calibration")) {
              if(updateTime) {
                  updateTimestamp = System.currentTimeMillis();
              }
  
              processOrientation(message);
          }
  		else if (message.contains("Offsets")) {
              textViewOffset.setVisibility(View.VISIBLE);
  			textViewOffset.setText(message);
  		} else if (message.contains("Scaling")) {
              textViewScaling.setVisibility(View.VISIBLE);
  			textViewScaling.setText(message);
  		}
  	}
  
  	private void processOrientation(String message) {
  		if (message.contains("level"))
  			calibration_step = 1;
  		else if (message.contains("LEFT"))
  			calibration_step = 2;
  