title: OpenCV Android without OpenCV Manager
body: <p>I know this question has been asked and answered several times here. But none of these solutions works for me:</p>
  
  <ul>
  <li><a href="https://stackoverflow.com/questions/20259309/how-to-integrate-opencv-manager-in-android-app">Solution 1</a></li>
  <li><a href="https://stackoverflow.com/questions/20990010/how-to-run-opencv-related-app-without-using-opencv-manager-in-android">Solution 2</a></li>
  <li><a href="https://stackoverflow.com/questions/12335680/opencv-for-android-do-i-need-to-install-opencv-manager-separately">Solution 3</a></li>
  </ul>
  
  <p>Here's my code (from <a href="http://docs.opencv.org/trunk/doc/tutorials/introduction/android_binary_package/dev_with_OCV_on_Android.html#hello-opencv-sample" rel="nofollow noreferrer">this page</a>):</p>
  
  <pre><code>package com.example.helloopencv;
  
  import org.opencv.android.BaseLoaderCallback;
  import org.opencv.android.CameraBridgeViewBase;
  import org.opencv.android.CameraBridgeViewBase.CvCameraViewFrame;
  import org.opencv.android.CameraBridgeViewBase.CvCameraViewListener2;
  import org.opencv.android.LoaderCallbackInterface;
  import org.opencv.android.OpenCVLoader;
  import org.opencv.core.Mat;
  
  import android.app.Activity;
  import android.os.Bundle;
  import android.util.Log;
  import android.view.SurfaceView;
  import android.view.WindowManager;
  
  public class HelloOpenCVActivity extends Activity implements CvCameraViewListener2 {
  
      protected static final String TAG = "HelloOpenCV";
  
      static {
          if (!OpenCVLoader.initDebug())
              Log.e(TAG, "Failed to load OpenCV!");
      }
  
      private BaseLoaderCallback mLoaderCallback = new BaseLoaderCallback(this) {
          @Override
          public void onManagerConnected(int status) {
              switch (status) {
              case LoaderCallbackInterface.SUCCESS:
                  {
                      Log.i(TAG, "OpenCV loaded successfully");
                      mOpenCvCameraView.enableView();
                  } break;
                  default:
                      super.onManagerConnected(status);
                  break;
              }
          }
      };
  
      private CameraBridgeViewBase mOpenCvCameraView;
  
      @Override
      public void onCreate(Bundle savedInstanceState) {
          Log.i(TAG, "called onCreate");
          super.onCreate(savedInstanceState);
          getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
          setContentView(R.layout.activity_hello_open_cv);
          mOpenCvCameraView = (CameraBridgeViewBase) findViewById(R.id.HelloOpenCVView);
          mOpenCvCameraView.setVisibility(SurfaceView.VISIBLE);
          mOpenCvCameraView.setCvCameraViewListener(this);
      }
  
      @Override
      public void onResume() {
          super.onResume();
          OpenCVLoader.initAsync(OpenCVLoader.OPENCV_VERSION_2_4_6, this, mLoaderCallback);
      }
  
      @Override
      public void onPause()
      {
          super.onPause();
          if (mOpenCvCameraView != null)
              mOpenCvCameraView.disableView();
      }
  
      public void onDestroy() {
          super.onDestroy();
          if (mOpenCvCameraView != null)
              mOpenCvCameraView.disableView();
      }
  
      public void onCameraViewStarted(int width, int height) {
      }
  
      public void onCameraViewStopped() {
      }
  
      public Mat onCameraFrame(CvCameraViewFrame inputFrame) {
          return inputFrame.rgba();
      }
  }
  </code></pre>
  
  <p>I have also followed the settings <a href="http://docs.opencv.org/trunk/doc/tutorials/introduction/android_binary_package/dev_with_OCV_on_Android.html#application-development-with-static-initialization" rel="nofollow noreferrer">here</a>. However, every time I try to run the code in my device (Galaxy Note 2), I am always asked to install OpenCV Manager package. Could I have missed something? Anybody can help me?</p>
  
  <p>Thanks!</p>