title: OPENCV+KIVY+BUILDOZER ON ANDROID PHONE
body: <p>I am trying to use opencv, kivy and buildzer to build an app on my android phone. I could debug successully the app and build to android phone. But when I open the app, the camera is not working.
  But after building this code with buildozer for android, when I open the App it shows a black screen with a small square in the left corner of the screen. Anyone can help me? I believe the camera is not being accessed.</p>
  <p>If you have any recommend or another way to do it, please let me know.</p>
  <p>Thank You!</p>
  <p>Here is the code I am using:</p>
  <pre><code># coding:utf-8
  from kivy.app import App
  from kivy.uix.image import Image
  from kivy.clock import Clock
  from kivy.graphics.texture import Texture
  import cv2
  
  
  class KivyCamera(Image):
      def __init__(self, capture, fps, **kwargs):
          super(KivyCamera, self).__init__(**kwargs)
          self.capture = capture
          Clock.schedule_interval(self.update, 1.0 / fps)
  
      def update(self, dt):
          ret, frame = self.capture.read()
          if ret:
              # convert it to texture
              buf1 = cv2.flip(frame, 0)
              buf = buf1.tostring()
              image_texture = Texture.create(
                  size=(frame.shape[1], frame.shape[0]), colorfmt='bgr')
              image_texture.blit_buffer(buf, colorfmt='bgr', bufferfmt='ubyte')
              # display image from the texture
              self.texture = image_texture
  
  
  class CamApp(App):
      def build(self):
          self.capture = cv2.VideoCapture(1)
          self.my_camera = KivyCamera(capture=self.capture, fps=30)
          return self.my_camera
  
      def on_stop(self):
          #without this, app will not exit even if the window is closed
          self.capture.release()
  
  
  if __name__ == '__main__':
      CamApp().run()
  </code></pre>