Text

Recgnoizer Thread cannot be started

Hi,

I have imported ITC module according to the video tutorial and i am able to access all the MyScript objects.
I have followed the integration steps which you have mentioned in link
http://doc.myscript.com/MyScriptATK_1.3/Android/itc/index.html

Below is the code which does the same

void configureSmarPage() {
  pageInterpreter = new PageInterpreter();
  pageInterpreter.setPageInterpreterListener(this);

  final List resources = new ArrayList();
  resources.add("en_US/en_US-ak-cur.lite.res");
  resources.add("en_US/en_US-lk-text.lite.res");

  SimpleResourceHelper helper = new SimpleResourceHelper(getApplicationContext());
  final List paths = helper.getResourcePaths(resources);
  pageInterpreter.configure("en_US",
    paths,
    new ArrayList(),
    MyCertificate.getBytes(),
    this.getResources().getDisplayMetrics().densityDpi);

  strokeFactory = new StrokeFactory();
  WordFactory wordFactory = new WordFactory(strokeFactory);

  SmartPage page = new SmartPage(wordFactory);
  page.setSmartPageRecognitionListener(this);
  page.setSmartPageChangeListener(this);
  page.setSmartPageGestureListener(this);

  pageInterpreter.setPage(page);
 }

I have defined all the over riding functions which need to be defined for the abstract listeners(Smart Page listener, Gesture Listener e.t.c)

But the configuration is failing with below error
03-04 03:09:12.208 18291-18291/com.pnf.pen.test I/DrawViewActivity: Smart note taking component configuration began
03-04 03:09:12.288 18291-18431/com.pnf.pen.test I/DrawViewActivity: Smart note taking component configuration failed with error: 'Recognition thread cannot be started'

Can you please check and let me know how this issue can be resolved. Please let me know if you need any further information.

Thanks
Abhinay


Hi,

I have imported itc-sample into my existing android project in Android Studio.

Thanks
Abhinay

Hi,

Sorry for spamming. I have also copied the latest ATK java certificate and placed it the ATK certificate directory.

Thanks
ABhinay

Dear Abhinay,
I have just checked the console of ATK server, there's an error message:
Mismatch between certificate and application: com.myscript..+ != com.pnf.pen.test
Did you download the certificate of your app: com.pnf.pen.test.java?
Could you please make sure that you have added the same string in the Android Manifest of your app?
Best regards

Hi Cate,

Thanks for the reply. My AndroidManifest.xml has below line
package=com.pnf.pen.test

I have downloaded the com.pnf.pen.test certificate from the EquilAndroidSDK App on the ATK. I have renamed it to MyCertificate.java and placed it my project. I have renamed the package in certificate java file as below
package com.pnf.pen.drawingview;

But i am still getting the below error
Smart note taking component configuration failed with error: 'Recognition thread cannot be started'

Can you please check on the server side if it is still issue with the certificate.
The package name com.pnf.pen.test comes from another SDK. There might some one who might have created have the Myscript ATK certificate with same package name. If in this case will my certificate created with duplicate package name be still valid ?

Thanks
Abhinay

Thanks for those details.
From the log console, there is still the same error:
Mar 3, 2016 ATK Samples com.myscript..+ Mismatch between certificate and application: com.myscript..+ != com.pnf.pen.test
I don't think you need to rename your certificate file actually. From my understanding you should have downloaded com.pnf.pen.drawingview java file to put in your application with the same name.
I am not sure to get your last point, but if you have mistakenly created a certificate you can revoke it from your ATK console.
Best regards

Hi Cate,

The log console you have mentioned above points to 3rd March. I have have been doing aggressive testing since last couple of days and i have even tried just before writing this mail.

I have downloaded the com.pnf.pen.Medquil from the EquilAndroidSDK App on my ATK dashboard. Below is the line from my app AndroidManifest.xml.
package="com.pnf.pen.Medquil"

The file name of java file downloaded is com.pnf.pen.Medquil which has the class MyCertificate. Since we generally name the file after the class name i have renamed the file com.pnf.pen.Medquil to MyCertificate and added to my project.

But still i am getting the same error while configuring for handwriting recognition.
03-08 01:30:43.188 2362-2362/com.pnf.pen.test I/DrawViewActivity: Smart note taking component configuration began
03-08 01:30:43.198 2362-5247/com.pnf.pen.test I/DrawViewActivity: Smart note taking component configuration failed with error: 'Recognition thread cannot be started'

Can you please check from the latest server dated 6th Match 2016 or 7th March 2016 if it is still an issue with the certificate.

Thanks
Abhinay

Hi,

Can you please check the latest server log and let me know if still an issue with Certificate.

Thanks
Abhinay

From our logs, it seems you disabled several certificates, that's why there's no recognition in your application if you use the byte array from disabled certificates. If you log on your atk account https://atk.myscript.com/, you should notice a difference between enabled and disabled certificates.
Disabled certificates are greyed and there's a button to 'Enable' them.
Valid certificates are displayed next to a button 'Disable', in case you need to revoke it.

Best regards

Hi,

Yes i disabled all the certificates which i am not using and enabled only the certificates which i am using.
I have created a new app Testing SDK and using this certificate com.pnf.pen.Medquil which is enabled.
Below is the screen shot for the same
https://drive.google.com/file/d/0B7CcUOV3YOH7d2FxS0hVNzhlTUU/view?usp=sharing

Even with the above certificate i am still getting the same configure error.
03-08 22:21:22.343 9629-9629/com.pnf.pen.test I/DrawViewActivity: Smart note taking component configuration began
03-08 22:21:22.403 9629-9752/com.pnf.pen.test I/DrawViewActivity: Smart note taking component configuration failed with error: 'Recognition thread cannot be started'

So what would be the problem here. Is there any difference which you could see with the certificate.

Thanks for all the help and support.

BR
Abhinay

Hi,

I have taken some time and captured my screen how i copied the MyCertificate.
https://drive.google.com/file/d/0B7CcUOV3YOH7Z1ZzeEJmQUY0cDQ/view?usp=sharing

Can you please check if the procedure i followed is right. I couldnt see any errors in the console as well.

Thanks
Abhinay

Hi,

Any Update ? Please do let me know if you need any further information.

Thanks

Sorry for the delay, we have done some testing and found several mistakes on our side.
Could you please try first to replace in your code:
pageInterpreter = new PageInterpreter();
by
PageInterpreter pageInterpreter = new PageInterpreter(getApplicationContext());

If it still does not work, I will write a detailed article today to describe how to use ITC (ATK 1.3) in Android Studio in the 'ATK' 'Text' section:
http://developer-support.myscript.com/support/discussions/forums/16000094273
Best regards

Hi Cate,

Thanks for the reply. Yes i am now able to start the recognition thread with the above change. Thanks a lot for all the support.

Thanks
Abhinay

Login or Signup to post a comment