Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ReadIt = new TessBaseAPI();
- ReadIt.init(datapath,"eng");
- class ProcessImageAsync extends AsyncTask<Void, Void, String> {
- @Override
- protected String doInBackground(Void... voids) {
- try{
- ReadIt.setImage(new File(currentPhotoPath));
- return ReadIt.getUTF8Text();
- }catch (Exception ex){
- ex.printStackTrace();
- return "";
- }
- }
- @Override
- protected void onPostExecute(String s) {
- if(!s.equalsIgnoreCase("")){
- TextView textView = (TextView)findViewById(R.id.textView);
- textView.setText(s);
- }else{
- Utility.showToast(MainActivity.this, "invalid Data");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement