Exemplo n.º 1
0
        public override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            AssetManager assets      = Activity.Assets;
            var          filesToCopy = new string[] { "runtime_data/openalpr.conf"
                                                      , "runtime_data/region/eu.xml" };

            var AndroidDataDir       = Android.App.Application.Context.DataDir.AbsolutePath;
            var runtimeFolder        = new Java.IO.File(AndroidDataDir, "/files/runtime_data");
            var renamedRuntimeFolder = new Java.IO.File(AndroidDataDir, "runtime_data");

            runtimeFolder.RenameTo(renamedRuntimeFolder);

            var list = renamedRuntimeFolder.List();

            OpenALPRConfigFile = AndroidDataDir + "/runtime_data/openalpr.conf";

            var f       = new Java.IO.File(AndroidDataDir);
            var flist   = f.List();
            var lib     = new Java.IO.File(f, "lib");
            var liblist = lib.List();

            mStateCallback          = new CameraStateListener(this);
            mSurfaceTextureListener = new Camera2BasicSurfaceTextureListener(this);
            OpenALPRInstance        = new OpenALPR(this.Activity, AndroidDataDir, OpenALPRConfigFile, "eu", "ua");

            // fill ORIENTATIONS list
            ORIENTATIONS.Append((int)SurfaceOrientation.Rotation0, 90);
            ORIENTATIONS.Append((int)SurfaceOrientation.Rotation90, 0);
            ORIENTATIONS.Append((int)SurfaceOrientation.Rotation180, 270);
            ORIENTATIONS.Append((int)SurfaceOrientation.Rotation270, 180);
        }
Exemplo n.º 2
0
 public static void DeleteFileOrDirectory(File file)
 {
     if (file.IsDirectory)
     {
         string[] children = file.List();
         for (int i = 0; i < children.Length; i++)
         {
             if (new File(file, children[i]).IsDirectory&& !children[i].Equals("PreinstalledMaps") && !children[i].Equals("Maps"))
             {
                 DeleteFileOrDirectory(new File(file, children[i]));
             }
             else
             {
                 new File(file, children[i]).Delete();
             }
         }
     }
 }