Forum Xamarin Xamarin.Android

Where to place files (Tesseract language data and images) and what would the datapath str look like?

Hi,

I've been trying to call an image and tesseract language files and it keeps returning null.

using System.Drawing;
using System;
using System.Diagnostics;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Android.App;
using Android.Content.PM;
using TesApp_Mobile.Droid;
using MvvmCross.Platforms.Android.Views;
using Tesseract;
using System.IO;
using Android.Content.Res;
using Android.Graphics;

namespace TesApp_Mobile
{
    [Activity(
        Label = "TesApp_Mobile"
        , MainLauncher = true
        //, Icon = "@mipmap/icon"
        , Theme = "@style/Theme.Splash"
        , NoHistory = true
        , ScreenOrientation = ScreenOrientation.Portrait)]
    public class SplashScreen : MvxSplashScreenActivity
    {
        public SplashScreen() : base(Resource.Layout.SplashScreen)
        {
            System.Diagnostics.Debug.WriteLine("Start");
            var engine = new TesseractEngine(@"./tessdata", "eng", EngineMode.Default);
            System.Diagnostics.Debug.WriteLine("Started Engine");

        }
    }
}

Output
Loaded assembly: Mono.Android.dll [External]
Loaded assembly: Java.Interop.dll [External]
Loaded assembly: System.dll [External]
Loaded assembly: Mono.Security.dll [External]
Loaded assembly: System.Core.dll [External]
Loaded assembly: /storage/emulated/0/Android/data/TesApp_Mobile.Droid.TesApp_Mobile.Droid/files/.override/TesApp_Mobile.Droid.dll
Loaded assembly: netstandard.dll [External]
[0:] Start
Loaded assembly: System.Reflection.Emit.dll [External]
Loaded assembly: InteropRuntimeImplementer.LeptonicaApiSignaturesInstance [External]
Loaded assembly: System.Reflection.Emit.ILGeneration.dll [External]
07-25 20:33:14.954 E/Zygote (13518): isWhitelistProcess - Process is Whitelisted
07-25 20:33:14.955 E/libpersona(13518): scanKnoxPersonas
07-25 20:33:14.955 E/libpersona(13518): Couldn't open the File - /data/system/users/0/personalist.xml - No such file or directory
07-25 20:33:14.960 W/SELinux (13518): SELinux selinux_android_compute_policy_index : Policy Index[2], Con:u:r:zygote:s0 RAM:SEPF_SM-J327V_8.1.0_0008, [-1 -1 -1 -1 0 1]

Loaded assembly: Mono.Android.dll [External]
Loaded assembly: Java.Interop.dll [External]
Loaded assembly: System.dll [External]
Loaded assembly: Mono.Security.dll [External]
Loaded assembly: System.Core.dll [External]
Loaded assembly: /storage/emulated/0/Android/data/TesApp_Mobile.Droid.TesApp_Mobile.Droid/files/.override/TesApp_Mobile.Droid.dll
Loaded assembly: netstandard.dll [External]
[0:] Start
Loaded assembly: System.Reflection.Emit.dll [External]
Loaded assembly: InteropRuntimeImplementer.LeptonicaApiSignaturesInstance [External]
Loaded assembly: System.Reflection.Emit.ILGeneration.dll [External]
07-25 20:33:14.954 E/Zygote (13518): isWhitelistProcess - Process is Whitelisted
07-25 20:33:14.955 E/libpersona(13518): scanKnoxPersonas
07-25 20:33:14.955 E/libpersona(13518): Couldn't open the File - /data/system/users/0/personalist.xml - No such file or directory
07-25 20:33:14.960 W/SELinux (13518): SELinux selinux_android_compute_policy_index : Policy Index[2], Con:u:r:zygote:s0 RAM:SEPF_SM-J327V_8.1.0_0008, [-1 -1 -1 -1 0 1]

Sign In or Register to comment.