Could someone provide here a source code for a simple extension for ide.makeroid.io ?
Something very simple, send 2 numbers and return the result.
Thank you in advance.
Could someone provide here a source code for a simple extension for ide.makeroid.io ?
Something very simple, send 2 numbers and return the result.
Thank you in advance.
Another Greek:’)
thanks @pavi2410 but I couldn’t manage to finish it. The following is a copy of yours with some modifications in order to pass the compilation.
Differences are on the
The .aix file is compiled successfully. My problem is when I import the .aix into a project, I can’t find the methods Add, Sub
package io.makeroid.xxxxxxxxxx.SimpleMaths;
import com.google.appinventor.components.annotations.DesignerComponent;
import com.google.appinventor.components.annotations.DesignerProperty;
import com.google.appinventor.components.annotations.PropertyCategory;
import com.google.appinventor.components.annotations.SimpleEvent;
import com.google.appinventor.components.annotations.SimpleFunction;
import com.google.appinventor.components.annotations.SimpleObject;
import com.google.appinventor.components.annotations.SimpleProperty;
import com.google.appinventor.components.annotations.UsesPermissions;
import com.google.appinventor.components.common.ComponentCategory;
import com.google.appinventor.components.common.PropertyTypeConstants;
import com.google.appinventor.components.runtime.AndroidNonvisibleComponent;
import com.google.appinventor.components.runtime.ComponentContainer;
@DesignerComponent(
version = 1,
description = “Extension made with Makeroid IDE”,
category = ComponentCategory.EXTENSION,
nonVisible = true,
iconName = “https://ide.makeroid.io/assets/logo.png”)
@SimpleObject(external = true)
public final class SimpleMaths extends AndroidNonvisibleComponent {
/**
@SimpleFunction(description = "Simple addition of two numbers")
public double Add(double a, double b) {
return a;
}
@SimpleFunction(description = "Simple sub of two numbers")
public double Sub(double a, double b) {
return b;
}
}
edit:
Everything is ok except the syntax error I get when the line is return a+b; or return a-b;
Thanks again.
Someone else already reported that the + sign crashes the extension, I’ll take a look
I’ve just pushed an update which should fix the “+” sign (@Vasques1995)
Please test it again (remember to wait a few hours as cache will be there for a while, not only client side, also server side)
Yes, the +,- signs work fine now.
Thanks a lot
This post was flagged by the community and is temporarily hidden.