Info on extensions, as a newbie!

Hi.
I know very little Java, so I don’t claim to be developing useful extensions.
I’m having fun trying to understand .aix extensions.
I wrote these 20 lines, compiled with Rush, imported the extension into Kodular, and everything works!

package com.digitalmatik.Test1;

import com.google.appinventor.components.annotations.SimpleFunction;
import com.google.appinventor.components.runtime.AndroidNonvisibleComponent;
import com.google.appinventor.components.runtime.ComponentContainer;

import java.util.regex.Matcher;
import java.util.regex.Pattern;
import android.util.Patterns;
import java.util.Random;


public class Test1 extends AndroidNonvisibleComponent {

	public Test1(ComponentContainer container) {
		super(container.$form());
	}


    @SimpleFunction(description = "Returns left characters")

    public String SubStrLeft(String text, int nchar) 
	{

        if (text == null || nchar <= 0 || text.isEmpty()) {
            return "";
        }

        if (nchar >= text.length()) {
            return text;
        }

        return text.substring(0, nchar);
    }

}

I change the extension, for example, the last line in return “xxxxx”;, compile, import into kodular again, but the result remains the same.
I tried clearing the browser cache (I use Brave and Edge): the result remains unchanged.
I also tried increasing the ‘Version’ value in rush.yml, but the result remains unchanged.
I close the browser, reopen kodular, test, and it works!

Where or what am I doing wrong?

Thanks
Henry

If you have made any changes to the extension or assets, you will need to disconnect and reconnect the companion.

1 Like

Oh, there you go!!!
I hadn’t thought of that! :slight_smile:
Thanks

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.