Forum Discussion

karimulla_shaik's avatar
karimulla_shaik
New Contributor
11 years ago

Where to update the PatchServices Library

Hi,



As part of "Preparing Android Applications", I need to update the code as below.



But, I am not sure where to update this information.



Is it in any of the below?



In PatchServices Library

In the APK of the Application we are testing



Please suggest how to do it.



Below is the extract I found from the help.





Initializing the PatchServices Library When Application Starts


The main goal of this step is to initialize TestComplete tools when the application starts. There are two ways to do that. If your application includes more than one activity, you need to place the initializing line in the constructor of your application.




JavaCopy Code




public class MyApplication extends Application

{

    public MyApplication()

    {

        // The method that initializes TestComplete tools

        com.smartbear.uibinder.Binder.Initialize(this);

 

        …

    }

}





If there is only one activity in the tested application, you can add the initializing line to the onCreate method of the activity.




JavaCopy Code




public class MainActivity extends Activity

{

    protected void onCreate(Bundle savedInstanceState)

    {

        // The method that initializes TestComplete tools

        com.smartbear.uibinder.Binder.Initialize(getApplication());

 

        …

    }

}



Regards

Karim





  • AlexKaras's avatar
    AlexKaras
    Champion Level 3
    Hi Karim,



    The com.smartbear.uibinder.Binder.Initialize line must be inserted in the source code of your tested application. Then the application must be recompiled to get a new .apk. This .apk must be specified as the tested Android application in TestComplete's project.
  • Thanks for the update!



    Let me try this out and hopefully it should work.



    Regards

    Karim