title: OCR for android application tess4j
body: <p>Basically am designing an application that will capture an image from the android devices default camera and will display that image in an image view! works fine! good enough!</p>
  
  <pre><code>capt_but.setOnClickListener(new View.OnClickListener()
      {
          //@Override
      // TODO Auto-generated method stub          
               public void onClick(View v)
               {
                   Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE); 
                   startActivityForResult(cameraIntent, CAMERA_REQUEST); 
               }
      }); 
  }
      protected void onActivityResult(int requestCode, int resultCode, Intent data)
      {  
         if (requestCode == CAMERA_REQUEST &amp;&amp; resultCode == RESULT_OK) 
         {  
              Bitmap photo = (Bitmap) data.getExtras().get("data"); 
              imageView.setImageBitmap(photo);
         }  
      }
  </code></pre>
  
  <p>My next task is to apply tess4j OCR functionality that will basically extract characters from the image i captured! tess4j is basically a java wrapper for the tesseract OCR!
  Am Programming in ECLIPSE!
  Here is the link for it!</p>
  
  <p>tess4j.sourceforge.net</p>
  
  <p>I added all the jars i could find in the open source files and added them to a folder i made that is lib to the main project directory in eclipse! i selected them all and also added them to build path!</p>
  
  <p>then i copied all the dll's i could find to the main project directory!
  Then using one example on the same link above i programmed my code as follows:</p>
  
  <pre><code>public void myfunction(Intent data)
      {
          Bitmap photo = (Bitmap) data.getExtras().get("data");
          Tesseract instance = Tesseract.getInstance(); // JNA Interface Mapping
          File imageFile = new File("myimage.tif");
          try 
          {   
              String result = instance.doOCR(imageFile)
              System.out.println(result);
          } 
          catch (TesseractException e)
          {
              System.err.println(e.getMessage());
          }
      }
  </code></pre>
  
  <p>My project is picking up the tesseract jar's and is enabling me to browse function directory on . operator!
  However on line,</p>
  
  <pre><code>String result = instance.doOCR(imageFile)
  </code></pre>
  
  <p>am getting the error that is:</p>
  
  <p>The type java.awt.image.BufferedImage cannot be resolved. It is indirectly referenced from required .class files</p>
  
  <p>the quick fix is:
  Configure build path!</p>
  
  <p>I cnt figure out what is the problem! am trying hard to figure out the problem! am i missing something from the steps i mentioned above? the tess4j i downloaded also had other files! kindly helper download the tess4j from the link above to examine the files that are in the download! any xml problem? or any build path problem?? </p>