0

Can I know what is the error when I debug my application? Below is my coding and the tessdata is saved inside my phone.

public class testingtesting extends Activity {

private static final String data_path = "/mnt/sdcard/tessdata";

 public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    //    setContentView(R.layout.image);

        ImageView a = (ImageView) findViewById (R.id.testingtesingt);
        Bitmap aa =  grayScale.bitmap_in_binarize;
  //      a.setImageBitmap(aa);

        TessBaseAPI baseApi = new TessBaseAPI();
        baseApi.setDebug(true);
        System.out.println("GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG");
        //error

      //  File myDir = getExternalFilesDir(Environment.DIRECTORY_DOWNLOADS);
        baseApi.init(data_path, "eng");
        //error
        baseApi.setImage(aa);
        System.out.println("adwdwawdada");
        String recognizedText = baseApi.getUTF8Text();
        baseApi.end();
        System.out.println("cimcaoioievfoaemmov");
        Intent intent = new Intent(testingtesting.this, result.class);
        intent.putExtra("title_input", recognizedText);
        startActivity(intent);


 }
4

1 回答 1

1

请提供错误信息。

据我所知,你遇到了麻烦System.out.println("GGGGGGGGGGGGGGGGGGGG");

Android 不使用标准的 Java 控制台。相反,像这样使用 Logcat:

Log.d("testingtesting", "GGGGGGGGGGGGGGGGG");

如果您使用的是 Eclipse,请在启动时打开 LogCat 视图以查看应用程序的输出:

窗口→显示视图→其他→Android→LogCat

有关 LogCat 的更多信息,请点击此处

于 2012-10-12T12:40:06.330 回答