title: how to capture image in android package import issue?
body: <p>I am trying to make hydrid application in which there is a  "button"  on <code>HTML</code> page .whenever I click on that button i want to call android code function <strong>(which is working fine when I called <code>test</code> function from javascript)</strong> .Now I want to capture image on button click
  I take help from below url.
  <a href="https://stackoverflow.com/questions/5991319/capture-image-from-camera-and-display-in-activity">Capture Image from Camera and Display in Activity</a>
  I do like this
  package com.example.myapp.myapplication;</p>
  
  <pre><code>import android.Manifest;
  import android.app.Activity;
  import android.content.Intent;
  import android.content.pm.PackageManager;
  import android.graphics.Bitmap;
  import android.os.Bundle;
  import android.support.annotation.NonNull;
  import android.support.v7.app.AppCompatActivity;
  import android.util.Base64;
  import android.util.Log;
  import android.webkit.JavascriptInterface;
  import android.webkit.WebChromeClient;
  import android.webkit.WebView;
  import android.widget.Toast;
  
  import java.io.ByteArrayOutputStream;
  
  public class MainActivity extends AppCompatActivity {
      private static final int CAMERA_REQUEST = 1888;
      private static final int MY_CAMERA_PERMISSION_CODE = 100;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
          WebView webView = (WebView) findViewById(R.id.webview);
          // webView.loadUrl("http://10.5.200.97:32671");
          webView.loadUrl("http://125.16.74.160:30019");
          JavaScriptInterface jsInterface = new JavaScriptInterface(this);
          webView.getSettings().setJavaScriptEnabled(true);
          webView.setWebChromeClient(new WebChromeClient());
          webView.addJavascriptInterface(jsInterface, "JSInterface");
      }
  
      @Override
      public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
          super.onRequestPermissionsResult(requestCode, permissions, grantResults);
          if (requestCode == MY_CAMERA_PERMISSION_CODE) {
              if (grantResults[0] == PackageManager.PERMISSION_GRANTED) {
                  Toast.makeText(this, "camera permission granted", Toast.LENGTH_LONG).show();
                  Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
                  startActivityForResult(cameraIntent, CAMERA_REQUEST);
              } else {
                  Toast.makeText(this, "camera permission denied", Toast.LENGTH_LONG).show();
              }
          }
  
      }
  
      protected void onActivityResult(int requestCode, int resultCode, Intent data) {
          if (requestCode == CAMERA_REQUEST &amp;&amp; resultCode == Activity.RESULT_OK) {
              Bitmap photo = (Bitmap) data.getExtras().get("data");
            //  Log.d("My map",photo,"");
          }
      }
  
      public void checkTest(){
          if (checkSelfPermission(Manifest.permission.CAMERA) != PackageManager.PERMISSION_GRANTED) {
              requestPermissions(new String[]{Manifest.permission.CAMERA}, MY_CAMERA_PERMISSION_CODE);
          } else {
              Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
              startActivityForResult(cameraIntent, CAMERA_REQUEST);
          }
      }
  }
  
  
  class JavaScriptInterface {
      private MainActivity activity;
  
  
      public JavaScriptInterface(MainActivity activity) {
          this.activity = activity;
      }
  
      @JavascriptInterface
      public void test() {
          this.activity.checkTest();
      }
  
  
      @JavascriptInterface
      public String bitMapToBase64()
      {
          ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
          //add support for jpg and more.
          bitMap.compress(Bitmap.CompressFormat.PNG, 50, byteArrayOutputStream);
          byte[] byteArray = byteArrayOutputStream .toByteArray();
  
          String encoded = Base64.encodeToString(byteArray, Base64.DEFAULT);
  
          return encoded;
      }
  
  
  }
  </code></pre>
  
  <p>I am getting import error
  <a href="https://i.stack.imgur.com/McdCU.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/McdCU.png" alt="enter image description here"></a></p>
  
  <p><strong>I am trying to call a android function which open camera and capture image and return to javascript.</strong></p>