Question About Service Using ItooX

Hi, it depends, normally when you want to utilize Itoo X functionality without including the whole Itoo source, you use the wrapper library.

Instructions to include ItooX Wrapper library:

  1. First download the wrapper JAR from releases:

  1. Then add it to your extension.

  2. Now once you have included Itoo X Wrapper JAR, you can now call any procedures in your Service:

if (FrameworkWrapper.isItooXPresent()) {
   // this checks if Itoo is present
   String myScreen = "Screen1"; // the screen in which procedure exists
   FrameworkWrapper wrapper = new FrameworkWrapper(context, myScreen);
   if (wrapper.success()) {
       wrapper.call("someProcedureName", arg1, arg2, arg3...);
   }
}

You need to use the above code in your onStartCommand

public class MyService extends Service {
...
    @Override
    public int onStartCommand(Intent intent, int flags, int startId) {
        ... add your ItooX code here
    }
}

Important Note:

  • Make sure the Itoo extension is added to your project, and is also present on the screen where the background procedure lies.
1 Like