Android SDK not able to get the Installation id

  • 1.3K Views
  • Last Post 15 July 2015
satellitemundo posted this 14 July 2015

Hi,

I am facing some issue in setting up the SDK for android. I got the Application id and password from abbyy site. According to their doc they have mentioned that in AsyncProcessTask we need to configure Application Id which is app name and password. Below is my code.

// Name of application you created
            restClient.applicationId = "AppName";
            // You should get e-mail from ABBYY Cloud OCR SDK service with the application password
            restClient.password = "SOME_ALPHA_NUMERIC_PASSWORD";

            Log.v("","**************** 2");
            // Obtain installation id when running the application for the first time
            SharedPreferences settings = activity.getPreferences(Activity.MODE_PRIVATE);
            String instIdName = "installationId";
            if( !settings.contains(instIdName)) {

                Log.v("","**************** 3");
                // Get installation id from server using device id
                String deviceId = android.provider.Settings.Secure.getString(activity.getContentResolver(), 
                        android.provider.Settings.Secure.ANDROID_ID);
                Log.v("","**************** 3.1");
                // Obtain installation id from server
                publishProgress( "First run: obtaining installation id..");
                String installationId = restClient.activateNewInstallation(deviceId);
                publishProgress( "Done. Installation id is '" + installationId + "'");
                Log.v("", "**************** 3.2");
                SharedPreferences.Editor editor = settings.edit();
                editor.putString(instIdName, installationId);
                editor.commit();
                Log.v("", "**************** 4");
            }

Its not going ahead after Log.v("","**** 3.1");

Oksana Serdyuk posted this 15 July 2015

Installation ID is the return value of the activateNewInstallation method that should be called to activate the installation on a mobile device. You should call the activateNewInstallation method once on each mobile device to get the Installation ID for this device. After your application has been activated on the device, you can use ABBYY Cloud OCR SDK, but specify the line "<ApplicationID><InstallationID>" instead of ApplicationID.

Also, please see the following article describing how to activate ABBYY Cloud OCR SDK “installations” on mobile devices: http://ocrsdk.com/documentation/apireference/mobile-installation/

Close